-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): unable to open block style select when in nested PTEs in f…
…ullscreen (#6738) * chore(dev): update schema * fix(core): unable to open block style select when in nested PTEs * test(@sanity, sanity, test): update e2e tests * chore(sanity): remove unneded zindex * test(test): update e2e to wait for the second full screen in pte
- Loading branch information
Showing
6 changed files
with
139 additions
and
6 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import {expect, type Locator} from '@playwright/test' | ||
import {test} from '@sanity/test' | ||
|
||
test.describe('Portable Text Input - Open Block Style Select', () => { | ||
let pteInput: Locator | ||
|
||
test.beforeEach(async ({page, createDraftDocument}) => { | ||
await createDraftDocument( | ||
'/test/content/input-standard;portable-text;pt_allTheBellsAndWhistles', | ||
) | ||
|
||
pteInput = page.getByTestId('field-content') | ||
|
||
// set up the portable text editor | ||
await pteInput.focus() | ||
await pteInput.click() | ||
}) | ||
|
||
test('on a simple editor', async ({page}) => { | ||
await pteInput.getByTestId('block-style-select').click() | ||
|
||
expect(await page.locator('[data-ui="MenuButton__popover"]')).toBeVisible() | ||
}) | ||
|
||
test('on a full screen simple editor', async ({page}) => { | ||
await pteInput.getByLabel('Expand editor').click() | ||
await page.locator('[data-testid="block-style-select"]').click() | ||
|
||
await expect(await page.locator('[data-ui="MenuButton__popover"]')).toBeVisible() | ||
}) | ||
|
||
test('on a full screen multi nested PTE', async ({page}) => { | ||
await pteInput.getByLabel('Expand editor').click() | ||
|
||
// add a object with a nested PTE | ||
await page.getByRole('button', {name: 'Insert Nested (inline)'}).click() | ||
|
||
// click the block | ||
await page.getByTestId('pt-inline-object').click() | ||
|
||
// set up object | ||
await page.getByTestId('add-single-object-button').click() | ||
|
||
// set up nested PTE | ||
const nestedPTE = page.locator('[data-testid^="field-content"][data-testid$=".deep"]') | ||
|
||
await nestedPTE.focus() | ||
await nestedPTE.click() | ||
|
||
// nested block full screen | ||
await nestedPTE.getByLabel('Expand editor').click() | ||
|
||
// click the block style select | ||
await page.locator('[data-testid="block-style-select"]').nth(1).click() | ||
|
||
await expect(await page.locator('[data-ui="MenuButton__popover"]')).toBeVisible() | ||
}) | ||
}) |