1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-13 02:34:05 +02:00

cypress: shadow-dom example test (#4413)

This commit is contained in:
Samarjeet
2021-08-05 21:38:37 +05:30
committed by GitHub
parent 81d62e129d
commit 8def57665c
2 changed files with 11 additions and 1 deletions

View File

@@ -0,0 +1,10 @@
describe('shadow-dom example', () => {
beforeEach(() => cy.visit('examples/shadow-dom'))
it('renders slate editor inside nested shadow', () => {
const outerShadow = cy.dataCy('outer-shadow-root').shadow()
const innerShadow = outerShadow.find('> div').shadow()
innerShadow.findByRole('textbox').should('exist')
})
})

View File

@@ -24,7 +24,7 @@ const ShadowDOM = () => {
ReactDOM.render(<ShadowEditor />, reactRoot)
})
return <div ref={container} />
return <div ref={container} data-cy="outer-shadow-root" />
}
const ShadowEditor = () => {