move examples to own directory, add demo component to all example pages
This commit is contained in:
29
docs/src/demos/Examples/ReadOnly/index.spec.js
Normal file
29
docs/src/demos/Examples/ReadOnly/index.spec.js
Normal file
@@ -0,0 +1,29 @@
|
||||
context('read-only', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/examples/read-only')
|
||||
})
|
||||
|
||||
describe('editable', () => {
|
||||
it('should be read-only', () => {
|
||||
cy.get('.ProseMirror').window().then(window => {
|
||||
cy.get('#editable').uncheck()
|
||||
|
||||
const { editor } = window
|
||||
editor.insertText('Edited: ')
|
||||
|
||||
cy.get('.ProseMirror p:first').should('not.contain', 'Edited: ')
|
||||
})
|
||||
})
|
||||
|
||||
it('should be editable', () => {
|
||||
cy.get('.ProseMirror').window().then(window => {
|
||||
cy.get('#editable').check()
|
||||
|
||||
const { editor } = window
|
||||
editor.insertText('Edited: ')
|
||||
|
||||
cy.get('.ProseMirror p:first').should('contain', 'Edited: ')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user