Skip to content

Commit

Permalink
TASK: Introduce tests for sync workflow edge-cases
Browse files Browse the repository at this point in the history
- test for selecting 'Discard workspace "User workspace"' as resolution during publishing (previously froze)

- test for navigating back after selecting 'Discard workspace "User workspace"' in sync mode and selecting another strategy
  • Loading branch information
mhsdesign committed Jan 25, 2025
1 parent acc8a23 commit 6ee4e83
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions Tests/IntegrationTests/Fixtures/1Dimension/syncing.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ test('Syncing: Create a conflict state between two editors and choose "Discard a
await prepareContentElementConflictBetweenAdminAndEditor(t);
await chooseDiscardAllAsResolutionStrategy(t);
await performResolutionStrategy(t);
await finishDiscard(t);

await assertThatWeAreOnPage(t, 'Home');
await assertThatWeCannotSeePageInTree(t, 'Sync Demo #1');
Expand Down Expand Up @@ -55,20 +56,26 @@ test('Syncing: Create a conflict state between two editors, start and cancel res
await assertThatWeCannotSeePageInTree(t, 'Sync Demo #3');
});

test('Syncing: Create a conflict state between two editors and choose "Drop conflicting changes" as a resolution strategy, then cancel and choose "Discard all" as a resolution strategy during rebase', async t => {
test('Syncing: Create a conflict state between two editors and switch between "Drop conflicting changes" and "Discard all" as a resolution strategy during rebase', async t => {
await prepareContentElementConflictBetweenAdminAndEditor(t);

// switch back and forth
await chooseDiscardAllAsResolutionStrategy(t);
await cancelResolutionStrategy(t);
await chooseDropConflictingChangesAsResolutionStrategy(t);
await cancelResolutionStrategy(t);
await chooseDiscardAllAsResolutionStrategy(t);

await performResolutionStrategy(t);
await finishDiscard(t);

await assertThatWeAreOnPage(t, 'Home');
await assertThatWeCannotSeePageInTree(t, 'Sync Demo #1');
await assertThatWeCannotSeePageInTree(t, 'Sync Demo #2');
await assertThatWeCannotSeePageInTree(t, 'Sync Demo #3');
});

test('Publish + Syncing: Create a conflict state between two editors, then try to publish and choose "Drop conflicting changes" as a resolution strategy during automatic rebase', async t => {
test('Publish + Syncing: Create a conflict state between two editors, then try to publish the site and choose "Drop conflicting changes" as a resolution strategy during automatic rebase', async t => {
await prepareDocumentConflictBetweenAdminAndEditor(t);
await startPublishAll(t);
await assertThatConflictResolutionHasStarted(t);
Expand All @@ -80,7 +87,7 @@ test('Publish + Syncing: Create a conflict state between two editors, then try t
await assertThatWeCannotSeePageInTree(t, 'This page will be deleted during sync');
});

test('Publish + Syncing: Create a conflict state between two editors, then try to publish the document only and choose "Drop conflicting changes" as a resolution strategy during automatic rebase', async t => {
test('Publish + Syncing: Create a conflict state between two editors, then try to publish the document and choose "Drop conflicting changes" as a resolution strategy during automatic rebase', async t => {
await prepareDocumentConflictBetweenAdminAndEditor(t);
await startPublishDocument(t);
await assertThatConflictResolutionHasStarted(t);
Expand All @@ -92,6 +99,18 @@ test('Publish + Syncing: Create a conflict state between two editors, then try t
await assertThatWeCannotSeePageInTree(t, 'This page will be deleted during sync');
});

test('Publish + Syncing: Create a conflict state between two editors, then try to publish the site and choose "Discard all" as a resolution strategy', async t => {
await prepareDocumentConflictBetweenAdminAndEditor(t);
await startPublishAll(t);
await assertThatConflictResolutionHasStarted(t);
await chooseDiscardAllAsResolutionStrategy(t);
await performResolutionStrategy(t);
await finishDiscard(t);

await assertThatWeAreOnPage(t, 'Home');
await assertThatWeCannotSeePageInTree(t, 'This page will be deleted during sync');
});

async function prepareContentElementConflictBetweenAdminAndEditor(t) {
await loginAsEditorOnceToInitializeAContentStreamForTheirWorkspaceIfNeeded(t);

Expand Down Expand Up @@ -315,6 +334,11 @@ async function finishPublish(t) {
await t.wait(2000);
}

async function finishDiscard(t) {
await t.click(Selector('#neos-DiscardDialog-Acknowledge'));
await t.wait(2000);
}

async function startSynchronization(t) {
await t.click(Selector('#neos-workspace-rebase'));
await t.click(Selector('#neos-SyncWorkspace-Confirm'));
Expand Down

0 comments on commit 6ee4e83

Please sign in to comment.