mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-29 09:59:48 +02:00
Add Safari workaround inside shadow DOM. (#5648)
* Add Safari workaround inside shadow DOM. * Add E2E test. * Move browser checks to environment.ts * Remove leftover @ts-ignore. Fix linting change. * Update `getActiveElement` * Create red-poems-wave.md * Fix prettier. * Update E2E test.
This commit is contained in:
@@ -12,4 +12,22 @@ test.describe('shadow-dom example', () => {
|
||||
|
||||
await expect(innerShadow.getByRole('textbox')).toHaveCount(1)
|
||||
})
|
||||
|
||||
test('renders slate editor inside nested shadow and edits content', async ({
|
||||
page,
|
||||
}) => {
|
||||
const outerShadow = page.locator('[data-cy="outer-shadow-root"]')
|
||||
const innerShadow = outerShadow.locator('> div')
|
||||
const textbox = innerShadow.getByRole('textbox')
|
||||
|
||||
// Ensure the textbox is present
|
||||
await expect(textbox).toHaveCount(1)
|
||||
|
||||
// Clear any existing text and type new text into the textbox
|
||||
await textbox.fill('') // Clears the textbox
|
||||
await textbox.type('Hello, Playwright!')
|
||||
|
||||
// Assert that the textbox contains the correct text
|
||||
await expect(textbox).toHaveValue('Hello, Playwright!')
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user