add read-only test
This commit is contained in:
@@ -2,4 +2,34 @@ context('read-only', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.visit('/examples/read-only')
|
cy.visit('/examples/read-only')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
describe('editable', () => {
|
||||||
|
it('should be editable', () => {
|
||||||
|
cy.get('.ProseMirror').window().then(window => {
|
||||||
|
const { editor } = window
|
||||||
|
|
||||||
|
cy.get('#editable').check()
|
||||||
|
|
||||||
|
editor.insertText('Edited: ')
|
||||||
|
|
||||||
|
cy.get('.ProseMirror h2:first')
|
||||||
|
.should('contain', 'Edited: ')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should be read-only', () => {
|
||||||
|
cy.get('.ProseMirror').window().then(window => {
|
||||||
|
const { editor } = window
|
||||||
|
|
||||||
|
cy.get('#editable').uncheck()
|
||||||
|
|
||||||
|
editor.insertText('Edited: ')
|
||||||
|
|
||||||
|
cy.get('.ProseMirror h2:first')
|
||||||
|
.should('not.contain', 'Edited: ')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
})
|
})
|
||||||
Reference in New Issue
Block a user