Skip to content

Commit

Permalink
Merge pull request #1611 from ecency/feature/image-upload-improvements
Browse files Browse the repository at this point in the history
Fixed tests
  • Loading branch information
feruzm authored May 20, 2024
2 parents 4e529a6 + 987355a commit e42660c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ exports[`(1) Default render 1`] = `
</div>
<div
className="editor-tool"
id="editor-tool-emoji-picker-6056c9be-39b8-42b9-9d62-21e0ce480ae2"
id="editor-tool-emoji-picker-f1601f2b-75bc-473e-b659-2525491c76ab"
role="none"
title="Emoji"
>
Expand Down Expand Up @@ -586,7 +586,7 @@ exports[`(2) Cancellable, in progress 1`] = `
</div>
<div
className="editor-tool"
id="editor-tool-emoji-picker-c2c59cbe-9589-4175-ba05-e7f55b678052"
id="editor-tool-emoji-picker-7005da35-392b-43e6-b1b6-870862697a79"
role="none"
title="Emoji"
>
Expand Down
13 changes: 11 additions & 2 deletions src/common/components/comment/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { entryInstance1, globalInstance, UiInstance } from "../../helper/test-he

import emojiData from "../../../../public/emoji.json";
import { withStore } from "../../tests/with-store";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";

jest.mock("../../api/misc", () => ({
getEmojiData: () =>
Expand Down Expand Up @@ -40,13 +41,21 @@ const defProps = {
it("(1) Default render", () => {
const props = { ...defProps };

const component = withStore(<Comment {...props} />);
const component = withStore(
<QueryClientProvider client={new QueryClient()}>
<Comment {...props} />
</QueryClientProvider>
);
expect(component.toJSON()).toMatchSnapshot();
});

it("(2) Cancellable, in progress", () => {
const props = { ...{ inProgress: true, cancellable: true, defText: "foo" }, ...defProps };

const component = withStore(<Comment {...props} />);
const component = withStore(
<QueryClientProvider client={new QueryClient()}>
<Comment {...props} />
</QueryClientProvider>
);
expect(component.toJSON()).toMatchSnapshot();
});

0 comments on commit e42660c

Please sign in to comment.