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:
committed by
GitHub
parent
4181107e56
commit
602f170156
10
cypress/integration/readonly.ts
Normal file
10
cypress/integration/readonly.ts
Normal 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')
|
||||
})
|
||||
})
|
@@ -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',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
Reference in New Issue
Block a user