mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-18 22:36:14 +08:00
minor improvements to the read-only example
This commit is contained in:
parent
399be73e7b
commit
99f3f1889b
@ -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: ')
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user