Skip to content

Commit

Permalink
fix(read-only): make editor-state read-only not only editor-view (#386)
Browse files Browse the repository at this point in the history
* fix(read-only): make editor-state read-only not only editor-view

* update tests
  • Loading branch information
danilowoz authored Feb 21, 2022
1 parent e3fef1e commit 5a6a973
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 19 deletions.
21 changes: 21 additions & 0 deletions cypress/integration/CodeViewer.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
describe("CodeViewer", () => {
it("should not be editable", () => {
cy.viewport(600, 1000).visit(
`/iframe.html?id=components-code-viewer--component`
);

cy.get(".cm-content").type("{selectall}").type("{backspace}");

cy.get(".cm-content").snapshot();
});

it("should not be able to cut the content", () => {
cy.viewport(600, 1000).visit(
`/iframe.html?id=components-code-viewer--component`
);

cy.get(".cm-content").type("{selectall}").type("{meta}x");

cy.get(".cm-content").snapshot();
});
});
Loading

0 comments on commit 5a6a973

Please sign in to comment.