minor improvements to the read-only example
This commit is contained in:
@@ -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: ')
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user