-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: only run the collaborative env when needed
In an effort to reduce the flakiness of the tests, we now only run tests with multiple pages (multiple editors) when needed.
- Loading branch information
1 parent
33941cf
commit 1d0fc29
Showing
27 changed files
with
596 additions
and
367 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
packages/editor/e2e-tests/__tests__/annotations-across-blocks.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packages/editor/e2e-tests/__tests__/annotations-collaboration.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Feature: Annotations Collaboration | ||
|
||
Background: | ||
Given two editors | ||
And a global keymap | ||
|
||
Scenario: Editor B inserts text after Editor A's half-deleted annotation | ||
Given the text "foo" | ||
And a "comment" "c1" around "foo" | ||
When the caret is put after "foo" | ||
And "Backspace" is pressed | ||
And the caret is put after "fo" by editor B | ||
And "a" is typed by editor B | ||
Then the text is "fo,a" | ||
And "fo" has marks "c1" | ||
And "a" has no marks |
11 changes: 11 additions & 0 deletions
11
packages/editor/e2e-tests/__tests__/annotations-collaboration.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** @jest-environment ./setup/collaborative.jest.env.ts */ | ||
|
||
import {Feature} from '@sanity/gherkin-driver/jest' | ||
import annotationsCollaboration from './annotations-collaboration.feature' | ||
import {parameterTypes, stepDefinitions} from './gherkin-step-definitions' | ||
|
||
Feature({ | ||
featureText: annotationsCollaboration, | ||
stepDefinitions, | ||
parameterTypes, | ||
}) |
13 changes: 1 addition & 12 deletions
13
packages/editor/e2e-tests/__tests__/annotations-edge-cases.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/editor/e2e-tests/__tests__/annotations-overlapping-decorators.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/editor/e2e-tests/__tests__/annotations-overlapping.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
packages/editor/e2e-tests/__tests__/undo-redo-collaboration.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
Feature: Undo/Redo Collaboration | ||
|
||
Background: | ||
Given two editors | ||
And a global keymap | ||
|
||
Scenario: Undoing local annotation added before remote annotation | ||
Given the text "foobar" | ||
And a "comment" "c1" around "foo" | ||
And a "link" "l1" around "bar" by editor B | ||
When undo is performed | ||
Then the text is "foo,bar" | ||
And "foo" has no marks | ||
And "bar" has marks "l1" | ||
|
||
Scenario: Undoing local annotation added after remote annotation | ||
Given the text "foobar" | ||
And a "link" "l1" around "bar" by editor B | ||
And a "comment" "c1" around "foo" | ||
When undo is performed | ||
Then the text is "foo,bar" | ||
And "foo" has no marks | ||
And "bar" has marks "l1" | ||
|
||
Scenario: Undoing local same-type annotation added before remote annotation | ||
Given the text "foobar" | ||
And a "comment" "c1" around "foo" | ||
And a "comment" "c2" around "bar" by editor B | ||
When undo is performed | ||
Then the text is "foo,bar" | ||
And "foo" has no marks | ||
And "bar" has marks "c2" | ||
|
||
# Currently fails | ||
@skip | ||
Scenario: Undoing and redoing local annotation before remote annotation | ||
Given the text "foobar" | ||
And a "comment" "c1" around "foo" | ||
And a "comment" "c2" around "bar" by editor B | ||
When undo is performed | ||
Then the text is "foo,bar" | ||
And "foo" has no marks | ||
And "bar" has marks "c2" | ||
When redo is performed | ||
Then "foo" has marks "c1" | ||
And "bar" has marks "c2" |
11 changes: 11 additions & 0 deletions
11
packages/editor/e2e-tests/__tests__/undo-redo-collaboration.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** @jest-environment ./setup/collaborative.jest.env.ts */ | ||
|
||
import {Feature} from '@sanity/gherkin-driver/jest' | ||
import {parameterTypes, stepDefinitions} from './gherkin-step-definitions' | ||
import undoRedoCollaboration from './undo-redo-collaboration.feature' | ||
|
||
Feature({ | ||
featureText: undoRedoCollaboration, | ||
stepDefinitions, | ||
parameterTypes, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.