From cd46080d104e0ae4a222075ad4d88a22d43512ea Mon Sep 17 00:00:00 2001 From: Ilya Maroz Date: Thu, 1 Dec 2022 13:52:37 +0000 Subject: [PATCH] test: add cases for collaborative editing managers --- .../operationExecutor.spec.ts | 9 ++++++ .../operationManager.spec.ts | 29 +++++++++++++++++++ .../operationObserver.spec.ts | 5 ++++ .../transform/transformer.spec.ts | 5 ++++ .../undoRedo/manager.spec.ts | 9 ++++++ 5 files changed, 57 insertions(+) create mode 100644 test/cypress/tests/collaborative-editing/operationExecutor.spec.ts create mode 100644 test/cypress/tests/collaborative-editing/operationManager.spec.ts create mode 100644 test/cypress/tests/collaborative-editing/operationObserver.spec.ts create mode 100644 test/cypress/tests/collaborative-editing/transform/transformer.spec.ts create mode 100644 test/cypress/tests/collaborative-editing/undoRedo/manager.spec.ts 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..97376948 --- /dev/null +++ b/test/cypress/tests/collaborative-editing/operationExecutor.spec.ts @@ -0,0 +1,9 @@ +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 new file mode 100644 index 00000000..d60f4e5a --- /dev/null +++ b/test/cypress/tests/collaborative-editing/operationManager.spec.ts @@ -0,0 +1,29 @@ +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 new file mode 100644 index 00000000..e3c0d827 --- /dev/null +++ b/test/cypress/tests/collaborative-editing/operationObserver.spec.ts @@ -0,0 +1,5 @@ +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..fca92284 --- /dev/null +++ b/test/cypress/tests/collaborative-editing/transform/transformer.spec.ts @@ -0,0 +1,5 @@ +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 new file mode 100644 index 00000000..98a5d2a4 --- /dev/null +++ b/test/cypress/tests/collaborative-editing/undoRedo/manager.spec.ts @@ -0,0 +1,9 @@ +describe('Undo Redo Manager', () => { + it('should do \'UNDO\' operation', () => { + console.log('todo'); + }); + + it('should do \'REDO\' operation', () => { + console.log('todo'); + }); +});