test: fix readonly test
This commit is contained in:
@@ -1,12 +1,18 @@
|
|||||||
context('/demos/Guide/Content/ReadOnly', () => {
|
context('/demos/Guide/Content/ReadOnly', () => {
|
||||||
beforeEach(() => {
|
before(() => {
|
||||||
cy.visit('/demos/Guide/Content/ReadOnly')
|
cy.visit('/demos/Guide/Content/ReadOnly')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.get('.ProseMirror').then(([{ editor }]) => {
|
||||||
|
editor.commands.clearContent()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
it('should be read-only', () => {
|
it('should be read-only', () => {
|
||||||
cy.get('.ProseMirror').then(([{ editor }]) => {
|
cy.get('.ProseMirror').then(([{ editor }]) => {
|
||||||
editor.setEditable(false)
|
editor.setEditable(false)
|
||||||
editor.commands.insertContent('Edited: ')
|
cy.get('.ProseMirror').type('Edited: ')
|
||||||
|
|
||||||
cy.get('.ProseMirror p:first').should('not.contain', 'Edited: ')
|
cy.get('.ProseMirror p:first').should('not.contain', 'Edited: ')
|
||||||
})
|
})
|
||||||
@@ -15,7 +21,7 @@ context('/demos/Guide/Content/ReadOnly', () => {
|
|||||||
it('should be editable', () => {
|
it('should be editable', () => {
|
||||||
cy.get('.ProseMirror').then(([{ editor }]) => {
|
cy.get('.ProseMirror').then(([{ editor }]) => {
|
||||||
editor.setEditable(true)
|
editor.setEditable(true)
|
||||||
editor.commands.insertContent('Edited: ')
|
cy.get('.ProseMirror').type('Edited: ')
|
||||||
|
|
||||||
cy.get('.ProseMirror p:first').should('contain', 'Edited: ')
|
cy.get('.ProseMirror p:first').should('contain', 'Edited: ')
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user