add read-only test

This commit is contained in:
Hans Pagel
2020-08-19 17:55:08 +02:00
parent 45fb69aef6
commit 399be73e7b

View File

@@ -2,4 +2,34 @@ context('read-only', () => {
beforeEach(() => {
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: ')
})
})
})
})