Skip to content

Commit

Permalink
refactor: cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
YvesRijckaert committed Jul 25, 2023
1 parent 9d756d6 commit 75be518
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
13 changes: 12 additions & 1 deletion cypress/e2e/rich-text/RichTextEditor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,18 @@ describe('Rich Text Editor', { viewportHeight: 2000 }, () => {
.type(`{${mod}+shift+e}`)
.type('{enter}');

richText.expectSnapshotValue();
const expectedValue = doc(
block(BLOCKS.UL_LIST, {}, block(BLOCKS.LIST_ITEM, {}, emptyParagraph())),
paragraphWithText('some text 1'),
entryBlock(),
emptyParagraph(),
paragraphWithText('some more text'),
entryBlock(),
emptyParagraph(),
emptyParagraph()
);

richText.expectValue(expectedValue);
cy.unsetShouldConfirm();
});
});
Expand Down
2 changes: 2 additions & 0 deletions cypress/e2e/rich-text/RichTextPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ export class RichTextPage {
cy.wait(500);

cy.getRichTextField().should((field) => {
console.log('actual:', field.getValue());
console.log('expected:', expectedValue);
expect(field.getValue()).to.deep.equal(expectedValue);
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"watch": "lerna run --stream watch",
"tsc": "turbo run tsc",
"test:ci": "turbo run test:ci",
"test:integration": "start-server-and-test storybook http://localhost:9000 cy:run",
"test:integration": "start-server-and-test storybook http://localhost:9000 cy:open",
"prettier": "prettier './**/*.{js,jsx,ts,tsx}' --write",
"cy:open": "TZ=UTC cypress open",
"cy:open:ct": "TZ=UTC cypress open --component",
Expand Down

0 comments on commit 75be518

Please sign in to comment.