@devries-cameron20 / t3code Mirror · read-only / commits / 19ea3c5beb
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 24, 09:00 UTC

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

Julius Marminge committed Sep 5, 2026 at 01:56 UTC 19ea3c5beb4cd93dd19f51f3e7c6d760357b41df
1 file changed -65
apps/web/src/components/diffs/AnnotatableCodeView.test.tsx deleted
-65
@@ -1,65 +0,0 @@
1 -import type { ReactNode } from "react";
2 -import { renderToStaticMarkup } from "react-dom/server";
3 -import { beforeEach, describe, expect, it, vi } from "vite-plus/test";
4 -
5 -const testState = vi.hoisted(() => ({
6 - codeViewOptions: null as Record<string, unknown> | null,
7 -}));
8 -
9 -vi.mock("@pierre/diffs/react", () => ({
10 - CodeView: (props: { options: Record<string, unknown> }) => {
11 - testState.codeViewOptions = props.options;
12 - return null;
13 - },
14 -}));
15 -
16 -vi.mock("../DiffWorkerPoolProvider", () => ({
17 - DiffWorkerPoolProvider: ({ children }: { children?: ReactNode }) => children,
18 -}));
19 -
20 -vi.mock("~/composerDraftStore", () => ({
21 - useComposerDraftStore: (selector: (store: Record<string, unknown>) => unknown) =>
22 - selector({
23 - addReviewComment: vi.fn(),
24 - removeReviewComment: vi.fn(),
25 - getComposerDraft: () => undefined,
26 - }),
27 -}));
28 -
29 -vi.mock("./DiffCommentAnnotation", () => ({
30 - DiffCommentAnnotation: () => null,
31 -}));
32 -
33 -vi.mock("../files/fileCommentAnnotations", () => ({
34 - nextFileCommentId: () => "comment-test",
35 -}));
36 -
37 -import { AnnotatableCodeView } from "./AnnotatableCodeView";
38 -
39 -describe("AnnotatableCodeView", () => {
40 - beforeEach(() => {
41 - testState.codeViewOptions = null;
42 - });
43 -
44 - it("opens comments from Pierre's gutter action without ending line selection", () => {
45 - renderToStaticMarkup(
46 - <AnnotatableCodeView
47 - codeViewKey="test-view"
48 - files={[]}
49 - sectionId="working-tree"
50 - sectionTitle="Working tree"
51 - composerDraftTarget={"draft-test" as never}
52 - options={{}}
53 - renderHeaderPrefix={() => null}
54 - renderHeaderFilenameSuffix={() => null}
55 - />,
56 - );
57 -
58 - expect(testState.codeViewOptions).toMatchObject({
59 - enableGutterUtility: true,
60 - enableLineSelection: true,
61 - onGutterUtilityClick: expect.any(Function),
62 - });
63 - expect(testState.codeViewOptions).not.toHaveProperty("onLineSelectionEnd");
64 - });
65 -});