mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-18 14:13:21 +08:00
test: fix readonly test
This commit is contained in:
parent
db1b957974
commit
dd568dedea
@ -1,12 +1,18 @@
|
||||
context('/demos/Guide/Content/ReadOnly', () => {
|
||||
beforeEach(() => {
|
||||
before(() => {
|
||||
cy.visit('/demos/Guide/Content/ReadOnly')
|
||||
})
|
||||
|
||||
beforeEach(() => {
|
||||
cy.get('.ProseMirror').then(([{ editor }]) => {
|
||||
editor.commands.clearContent()
|
||||
})
|
||||
})
|
||||
|
||||
it('should be read-only', () => {
|
||||
cy.get('.ProseMirror').then(([{ editor }]) => {
|
||||
editor.setEditable(false)
|
||||
editor.commands.insertContent('Edited: ')
|
||||
cy.get('.ProseMirror').type('Edited: ')
|
||||
|
||||
cy.get('.ProseMirror p:first').should('not.contain', 'Edited: ')
|
||||
})
|
||||
@ -15,7 +21,7 @@ context('/demos/Guide/Content/ReadOnly', () => {
|
||||
it('should be editable', () => {
|
||||
cy.get('.ProseMirror').then(([{ editor }]) => {
|
||||
editor.setEditable(true)
|
||||
editor.commands.insertContent('Edited: ')
|
||||
cy.get('.ProseMirror').type('Edited: ')
|
||||
|
||||
cy.get('.ProseMirror p:first').should('contain', 'Edited: ')
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user