diff --git a/test/cypress/tests/collaborative-editing/OperationExecutor.spec.ts b/test/cypress/tests/collaborative-editing/OperationExecutor.spec.ts new file mode 100644 index 00000000..b8897a81 --- /dev/null +++ b/test/cypress/tests/collaborative-editing/OperationExecutor.spec.ts @@ -0,0 +1,9 @@ +describe('Operation Executor', () => { + it('should apply an Operation from OperationReceived event on Document State', () => { + console.log('todo'); + }); + + it('should emit OperationApplied event on receiving new operation', () => { + console.log('todo'); + }); +}); diff --git a/test/cypress/tests/collaborative-editing/OperationManager.spec.ts b/test/cypress/tests/collaborative-editing/OperationManager.spec.ts new file mode 100644 index 00000000..7d96f63a --- /dev/null +++ b/test/cypress/tests/collaborative-editing/OperationManager.spec.ts @@ -0,0 +1,53 @@ +describe('Operation Manager', () => { + /** + * Mock Private EventBus + * + * + */ + describe('Local changes', () => { + it('should put new operation to the end of Pending OPs queue', () => { + console.log('todo'); + }); + + it('should send first operation from the Pending OPs queue to the Server', () => { + console.log('todo'); + }); + + it('should remove operation from the start of Pending OPs queue after Acknowledgement from the Server', () => { + console.log('todo'); + }); + + it('should not send new operation to the Server if it\'s waiting for Acknowledgement from the Server', () => { + console.log('todo'); + }); + + it('should receive Acknowledgement from the Server and put Operations from response to the Resolved OPs', () => { + console.log('todo'); + }); + }); + + describe('Received changes', () => { + it('should execute Transformer over Pending OPs relative to the received operation and put them back to the Pending OPs', () => { + console.log('todo'); + // Think about how to check changes in the Pending OPs + }); + + it('should put received operation to the end of Resolved OPs', () => { + console.log('todo'); + }); + + it('should emit an OperationReceived event with received operation to the Private EventBus', () => { + console.log('todo'); + }); + }); + + describe('Document Revision', () => { + it('should send current Document Revision with a new Operation', () => { + console.log('todo'); + }); + + it('should set current Document Revision from received Operation', () => { + console.log('todo'); + }); + }); +}); diff --git a/test/cypress/tests/collaborative-editing/OperationObserver.spec.ts b/test/cypress/tests/collaborative-editing/OperationObserver.spec.ts new file mode 100644 index 00000000..3634c919 --- /dev/null +++ b/test/cypress/tests/collaborative-editing/OperationObserver.spec.ts @@ -0,0 +1,25 @@ +describe('Operation Observer', () => { + /** + * Mock Public EventBus + * Mock previous state in Document State Store + * + * Act - emulate Change Event at Public EventBus + * + * Expect - Private EventBus got correct operation + */ + it('should create INSERT operation when it receives a change event after adding data', () => { + console.log('todo'); + }); + + it('should create DELETE operation when it receives a change event after removing data', () => { + console.log('todo'); + }); + + it('should create DELETE and INSERT operations when it receives a change event after replacing data', () => { + console.log('todo'); + }); + + it('should put new Document State to the store', () => { + console.log('todo'); + }); +}); diff --git a/test/cypress/tests/collaborative-editing/operationExecutor.spec.ts b/test/cypress/tests/collaborative-editing/operationExecutor.spec.ts deleted file mode 100644 index 97376948..00000000 --- a/test/cypress/tests/collaborative-editing/operationExecutor.spec.ts +++ /dev/null @@ -1,9 +0,0 @@ -describe('Operation Executor', () => { - it('should change document state with received operation', () => { - console.log('todo'); - }); - - it('should fire \'OperationApplied\' event on receiving new operation', () => { - console.log('todo'); - }); -}); diff --git a/test/cypress/tests/collaborative-editing/operationManager.spec.ts b/test/cypress/tests/collaborative-editing/operationManager.spec.ts deleted file mode 100644 index d60f4e5a..00000000 --- a/test/cypress/tests/collaborative-editing/operationManager.spec.ts +++ /dev/null @@ -1,29 +0,0 @@ -describe('Operation Manager', () => { - describe('Local changes', () => { - it('should put new operation to the Pending OPs until sending to the server', () => { - console.log('todo'); - }); - - it('should remove operation from the Pending OPs after sending to the server', () => { - console.log('todo'); - }); - - it('should put received operation with acknowledgement to the Resolved OPs', () => { - console.log('todo'); - }); - }); - - describe('Received changes', () => { - it('should transform Pending OPs relative to the received operation', () => { - console.log('todo'); - }); - - it('should put received operation to the private Event Bus', () => { - console.log('todo'); - }); - - it('should put received operation to the Resolved OPs', () => { - console.log('todo'); - }); - }); -}); diff --git a/test/cypress/tests/collaborative-editing/operationObserver.spec.ts b/test/cypress/tests/collaborative-editing/operationObserver.spec.ts deleted file mode 100644 index e3c0d827..00000000 --- a/test/cypress/tests/collaborative-editing/operationObserver.spec.ts +++ /dev/null @@ -1,5 +0,0 @@ -describe('Operation Observer', () => { - it('should create operation by changes event from the public event bus', () => { - console.log('todo'); - }); -}); diff --git a/test/cypress/tests/collaborative-editing/transform/Transformer.spec.ts b/test/cypress/tests/collaborative-editing/transform/Transformer.spec.ts new file mode 100644 index 00000000..059eeaa1 --- /dev/null +++ b/test/cypress/tests/collaborative-editing/transform/Transformer.spec.ts @@ -0,0 +1,41 @@ +describe('Transformer', () => { + describe('Block Indices', () => { + it('should not transform the first Operation which index is less than index of the second Operation', () => { + console.log('todo'); + }); + + it('should transform the first Operation which index is more than index of the second Operation', () => { + console.log('todo'); + }); + }); + + describe('Symbol Indices', () => { + it('should not transform the first Operation which index is less than index of the second Operation', () => { + console.log('todo'); + }); + + it('should transform the first Operation which index is more than index of the second Operation', () => { + console.log('todo'); + }); + }); + + describe('Mixed Indices', () => { + it('should not transform the first Operation which block index is less than block index of the second Operation', () => { + console.log('todo'); + }); + + it('should transform the first Operation which block index is more than block index of the second Operation', () => { + console.log('todo'); + }); + }); + + describe('Inverting Operation', () => { + it('should invert INSERT Operation to DELETE Operation', () => { + console.log('todo'); + }); + + it('should invert DELETE Operation to INSERT Operation', () => { + console.log('todo'); + }); + }); +}); diff --git a/test/cypress/tests/collaborative-editing/transform/transformer.spec.ts b/test/cypress/tests/collaborative-editing/transform/transformer.spec.ts deleted file mode 100644 index fca92284..00000000 --- a/test/cypress/tests/collaborative-editing/transform/transformer.spec.ts +++ /dev/null @@ -1,5 +0,0 @@ -describe('Transformer', () => { - it('should transform the operation relative to the previous one', () => { - console.log('todo'); - }); -}); diff --git a/test/cypress/tests/collaborative-editing/undoRedo/manager.spec.ts b/test/cypress/tests/collaborative-editing/undoRedo/Manager.spec.ts similarity index 75% rename from test/cypress/tests/collaborative-editing/undoRedo/manager.spec.ts rename to test/cypress/tests/collaborative-editing/undoRedo/Manager.spec.ts index 98a5d2a4..a151abba 100644 --- a/test/cypress/tests/collaborative-editing/undoRedo/manager.spec.ts +++ b/test/cypress/tests/collaborative-editing/undoRedo/Manager.spec.ts @@ -1,4 +1,7 @@ describe('Undo Redo Manager', () => { + /** + * Need to draw work flow before describing tests + */ it('should do \'UNDO\' operation', () => { console.log('todo'); });