1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-22 08:02:25 +01:00
Julian Krispel-Samsel 737aaa9cde
Fix iframe crash (#4219)
* fixes #4170

* add smoke test for iframe example

* add changeset

* update changeset wording
2021-04-26 14:47:12 +01:00

32 lines
689 B
TypeScript

// Taken from https://www.cypress.io/blog/2020/02/12/working-with-iframes-in-cypress/
const getIframeDocument = () => {
return cy
.get('iframe')
.its('0.contentDocument')
.should('exist')
}
const getIframeBody = () => {
return (
getIframeDocument()
.its('body')
// automatically retries until body is loaded
.should('not.be.undefined')
.then(cy.wrap)
)
}
describe('iframe editor', () => {
beforeEach(() => {
cy.visit('examples/iframe')
})
it('should be editable', () => {
getIframeBody()
.findByRole('textbox')
.type('{movetostart}')
.type('Hello World')
.should('contain.text', 'Hello World')
})
})