Skip to content
TypeScript

test(web): remove mocked annotation options snapshot (#10074)

Julius Marminge19ea3c5beb4c
diff --git a/apps/web/src/components/diffs/AnnotatableCodeView.test.tsx b/apps/web/src/components/diffs/AnnotatableCodeView.test.tsx
deleted file mode 100644
index 81cd5625e62..00000000000
--- a/apps/web/src/components/diffs/AnnotatableCodeView.test.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import type { ReactNode } from "react";
-import { renderToStaticMarkup } from "react-dom/server";
-import { beforeEach, describe, expect, it, vi } from "vite-plus/test";
-
-const testState = vi.hoisted(() => ({
- codeViewOptions: null as Record<string, unknown> | null,
-}));
-
-vi.mock("@pierre/diffs/react", () => ({
- CodeView: (props: { options: Record<string, unknown> }) => {
- testState.codeViewOptions = props.options;
- return null;
- },
-}));
-
-vi.mock("../DiffWorkerPoolProvider", () => ({
- DiffWorkerPoolProvider: ({ children }: { children?: ReactNode }) => children,
-}));
-
-vi.mock("~/composerDraftStore", () => ({
- useComposerDraftStore: (selector: (store: Record<string, unknown>) => unknown) =>
- selector({
- addReviewComment: vi.fn(),
- removeReviewComment: vi.fn(),
- getComposerDraft: () => undefined,
- }),
-}));
-
-vi.mock("./DiffCommentAnnotation", () => ({
- DiffCommentAnnotation: () => null,
-}));
-
-vi.mock("../files/fileCommentAnnotations", () => ({
- nextFileCommentId: () => "comment-test",
-}));
-
-import { AnnotatableCodeView } from "./AnnotatableCodeView";
-
-describe("AnnotatableCodeView", () => {
- beforeEach(() => {
- testState.codeViewOptions = null;
- });
-
- it("opens comments from Pierre's gutter action without ending line selection", () => {
- renderToStaticMarkup(
- <AnnotatableCodeView
- codeViewKey="test-view"
- files={[]}
- sectionId="working-tree"
- sectionTitle="Working tree"
- composerDraftTarget={"draft-test" as never}
- options={{}}
- renderHeaderPrefix={() => null}
- renderHeaderFilenameSuffix={() => null}
- />,
- );
-
- expect(testState.codeViewOptions).toMatchObject({
- enableGutterUtility: true,
- enableLineSelection: true,
- onGutterUtilityClick: expect.any(Function),
- });
- expect(testState.codeViewOptions).not.toHaveProperty("onLineSelectionEnd");
- });
-});