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') cy.visit('/examples/read-only')
}) })
describe('editable', () => { describe('editable', () => {
it('should be editable', () => { it('should be editable', () => {
cy.get('.ProseMirror').window().then(window => { cy.get('.ProseMirror').window().then(window => {
const { editor } = window
cy.get('#editable').check() cy.get('#editable').check()
const { editor } = window
editor.insertText('Edited: ') editor.insertText('Edited: ')
cy.get('.ProseMirror h2:first') cy.get('.ProseMirror p:first').should('contain', 'Edited: ')
.should('contain', 'Edited: ')
}) })
}) })
it('should be read-only', () => { it('should be read-only', () => {
cy.get('.ProseMirror').window().then(window => { cy.get('.ProseMirror').window().then(window => {
const { editor } = window
cy.get('#editable').uncheck() cy.get('#editable').uncheck()
const { editor } = window
editor.insertText('Edited: ') editor.insertText('Edited: ')
cy.get('.ProseMirror h2:first') cy.get('.ProseMirror p:first').should('not.contain', 'Edited: ')
.should('not.contain', 'Edited: ')
}) })
}) })

View File

@@ -27,9 +27,6 @@ export default {
this.editor = new Editor({ this.editor = new Editor({
editable: false, editable: false,
content: ` content: `
<h2>
Read-Only
</h2>
<p> <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. 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> </p>