-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
53873a7
commit 2aec14d
Showing
4 changed files
with
57 additions
and
223 deletions.
There are no files selected for viewing
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
42 changes: 42 additions & 0 deletions
42
test/e2e/tests/array-editing/ArrayEditingNavigation.spec.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,42 @@ | ||
import {expect} from '@playwright/test' | ||
import {test} from '@sanity/test' | ||
|
||
test.describe('navigation - breadcrumb', () => { | ||
test.beforeEach(async ({page, createDraftDocument}) => { | ||
// set up an array with two items: Albert, the whale and Lucy, the cat | ||
await createDraftDocument('/test/content/input-debug;objectsDebug') | ||
await expect(page.getByTestId('document-panel-scroller')).toBeAttached({ | ||
timeout: 40000, | ||
}) | ||
|
||
// first element | ||
await expect(page.getByTestId('field-animals')).toBeVisible() | ||
await page.getByTestId('field-animals').getByRole('button', {name: 'Add item'}).click() | ||
await expect(page.getByTestId('array-editing-dialog')).toBeAttached() | ||
|
||
await page | ||
.getByTestId('array-editing-dialog') | ||
.getByTestId('string-input') | ||
.fill('Albert, the whale') | ||
await page.getByRole('button', {name: 'Done'}).click() | ||
|
||
// wait for the modal to close | ||
page.on('dialog', async () => { | ||
await expect(page.getByTestId('array-editing-dialog')).not.toBeVisible() | ||
}) | ||
|
||
// second element | ||
await expect(page.getByTestId('field-animals')).toBeVisible() | ||
await page.getByTestId('field-animals').getByRole('button', {name: 'Add item'}).click() | ||
await expect(page.getByTestId('array-editing-dialog')).toBeAttached() | ||
|
||
await page.getByTestId('array-editing-dialog').getByTestId('string-input').fill('Lucy, the cat') | ||
await page.getByRole('button', {name: 'Done'}).click() | ||
|
||
/* structure: | ||
{ | ||
Albert, the whale | ||
Lucy, the cat | ||
} */ | ||
}) | ||
}) |
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
208 changes: 0 additions & 208 deletions
208
test/e2e/tests/tree-editing/TreeEditingNavigation.spec.ts
This file was deleted.
Oops, something went wrong.