1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-31 02:49:56 +02:00

Update readonly example and add test (#4212)

* fixes #4039, update readonly example

* add cypress test for readonly mode
This commit is contained in:
Julian Krispel-Samsel
2021-04-21 09:29:19 +01:00
committed by GitHub
parent 4181107e56
commit 602f170156
2 changed files with 12 additions and 1 deletions

View File

@@ -0,0 +1,10 @@
describe('readonly editor', () => {
it('should not be editable', () => {
cy.visit('examples/read-only')
.get('[data-slate-editor="true"]')
.should('not.have.attr', 'contentEditable', 'true')
.should('not.have.attr', 'role', 'textbox')
.click()
.should('not.be.focused')
})
})

View File

@@ -17,7 +17,8 @@ const initialValue: Descendant[] = [
type: 'paragraph',
children: [
{
text: 'This is editable plain text, just like a <textarea>!',
text:
'This example shows what happens when the Editor is set to readOnly, it is not editable',
},
],
},