Skip to content

Commit

Permalink
chore: add coverage dependency and update live preview test assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
hiteshshetty-dev committed Oct 21, 2024
1 parent 2999970 commit 9197194
Show file tree
Hide file tree
Showing 4 changed files with 237 additions and 5 deletions.
234 changes: 231 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"@types/react": "^18.2.57",
"@types/react-dom": "^18.2.19",
"@types/uuid": "^8.3.1",
"@vitest/coverage-v8": "^2.1.2",
"@vitest/ui": "^2.1.2",
"esbuild-plugin-file-path-extensions": "^2.1.0",
"eslint": "^7.32.0",
Expand Down
5 changes: 4 additions & 1 deletion src/preview/__test__/contentstack-live-preview-HOC.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ describe("Live Preview HOC init", () => {

await sleep();
expect(livePreviewPostMessageSpy).toHaveBeenCalledTimes(1);
expect(visualBuilderPostMessageSpy).toHaveBeenCalledTimes(1);
console.log(visualBuilderPostMessageSpy.mock.calls);
expect(visualBuilderPostMessageSpy).toHaveBeenCalledWith('init', { isSSR: true, href: 'http://localhost:3000/' });
expect(visualBuilderPostMessageSpy).toHaveBeenCalledWith('send-variant-and-locale');
expect(visualBuilderPostMessageSpy).toHaveBeenCalledTimes(2);
});

test("should return the existing live preview instance if it is already initialized", async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/visualBuilder/__test__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ describe("Visual builder", () => {
});
expect(h1).toMatchSnapshot();
x.destroy();
});
}, { timeout: 10 * 1000 });

//TODO: Fix this test on CI
test.skip("file should render a replacer and remove when it is not", async () => {
Expand Down

0 comments on commit 9197194

Please sign in to comment.