minor improvements to the read-only example

This commit is contained in:
Hans Pagel 2020-08-19 17:57:55 +02:00
parent 399be73e7b
commit 99f3f1889b
2 changed files with 4 additions and 12 deletions

View File

@ -3,31 +3,26 @@ context('read-only', () => {
cy.visit('/examples/read-only')
})
describe('editable', () => {
it('should be editable', () => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
cy.get('#editable').check()
const { editor } = window
editor.insertText('Edited: ')
cy.get('.ProseMirror h2:first')
.should('contain', 'Edited: ')
cy.get('.ProseMirror p:first').should('contain', 'Edited: ')
})
})
it('should be read-only', () => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
cy.get('#editable').uncheck()
const { editor } = window
editor.insertText('Edited: ')
cy.get('.ProseMirror h2:first')
.should('not.contain', 'Edited: ')
cy.get('.ProseMirror p:first').should('not.contain', 'Edited: ')
})
})

View File

@ -27,9 +27,6 @@ export default {
this.editor = new Editor({
editable: false,
content: `
<h2>
Read-Only
</h2>
<p>
This text is <strong>read-only</strong>. You are not able to edit something. <a href="https://ueber.io/">Links to fancy websites</a> are still working.
</p>