Skip to content

Commit

Permalink
Add value change test
Browse files Browse the repository at this point in the history
  • Loading branch information
zenoamaro committed Apr 13, 2020
1 parent be1c14d commit 0994be7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,28 @@ describe("<ReactQuill />", () => {
cy.getEditor().should("contain", text);
});

it("updates the content when the value prop changes", () => {
const text = "Hello, world";
const change = "Goodbye, world";
cy.renderWithProps({value: text})
.getEditor()
.should("contain", text)
.setProps({value: change})
.getEditor()
.should("contain", change)
.should("not.contain", text);
});


it("allows using Deltas as defaultValue", () => {
const text = "Hello, world";
const delta = { ops: [{ insert: text }] };
cy.renderWithProps({
defaultValue: delta
});
cy.getEditor().should("contain", text);
});

it("allows using Deltas as defaultValue", () => {
const text = "Hello, world";
const delta = { ops: [{ insert: text }] };
Expand Down

0 comments on commit 0994be7

Please sign in to comment.