Files
tiptap/demos/src/GuideContent/ReadOnly/Vue/index.spec.js
Philipp Kühn 2d129459ca fix tests
2021-08-26 14:07:37 +02:00

30 lines
743 B
JavaScript

context('/src/GuideContent/ReadOnly/Vue/', () => {
before(() => {
cy.visit('/src/GuideContent/ReadOnly/Vue/')
})
beforeEach(() => {
cy.get('.ProseMirror').then(([{ editor }]) => {
editor.commands.clearContent()
})
})
it('should be read-only', () => {
cy.get('.ProseMirror').then(([{ editor }]) => {
editor.setEditable(false)
cy.get('.ProseMirror').type('Edited: ')
cy.get('.ProseMirror p:first').should('not.contain', 'Edited: ')
})
})
it('should be editable', () => {
cy.get('.ProseMirror').then(([{ editor }]) => {
editor.setEditable(true)
cy.get('.ProseMirror').type('Edited: ')
cy.get('.ProseMirror p:first').should('contain', 'Edited: ')
})
})
})