diff --git a/cypress/integration/readonly.ts b/cypress/integration/readonly.ts new file mode 100644 index 000000000..3a4825d1e --- /dev/null +++ b/cypress/integration/readonly.ts @@ -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') + }) +}) diff --git a/site/examples/read-only.tsx b/site/examples/read-only.tsx index 41aaff524..566b9e32c 100644 --- a/site/examples/read-only.tsx +++ b/site/examples/read-only.tsx @@ -17,7 +17,8 @@ const initialValue: Descendant[] = [ type: 'paragraph', children: [ { - text: 'This is editable plain text, just like a