-###############################################################################
-#
-# CoCalc: Collaborative web-based calculation
-# Copyright (C) 2017, Sagemath Inc.
-# AGPLv3
-#
+###
+
+CoCalc: Collaborative web-based calculation
+Copyright (C) 2017, Sagemath Inc.
+AGPLv3
+
+TODO: trying to test this way via mocking all the db queries is just **TOO** hard.
+I need to write tests that really do use the database instead and get rid of this.
+Sorry...
+
 ###############################################################################
 require('coffee-cache')
 

        client.once 'query', (opts) ->
            opts.cb()
            queries[1].patches.cb(undefined, {new_val:opts.query[0].patches})
        ss[0].save()

    it 'and the other direction', (done) ->
        ss[0].once 'change', ->
            expect(ss[0].to_str()).toEqual('YcocalcX')
            done()
        # Note that when ss[1] above changed it also sent out its patch already, so
        # we can't wait for it here like we did above.  It is in all_queries.
        queries[0].patches.cb(undefined, {new_val:all_queries[all_queries.length-1].query[0].patches})

    it 'closes the sync strings', ->
        ss[0].close()
        ss[1].close()



describe "test conflicting changes to two syncstrings -- ", ->

        # Note that when ss[1] above changed it also sent out its patch already, so
        # we can't wait for it here like we did above.  It is in all_queries.
        queries[0].patches.cb(undefined, {new_val:all_queries[all_queries.length-1].query[0].patches})
    ###

    it 'closes the sync strings', ->
        ss[0].close()
