diff --git a/frontend/src/features/layout/LayoutGrid.refitEpoch.test.tsx b/frontend/src/features/layout/LayoutGrid.refitEpoch.test.tsx new file mode 100644 index 0000000..12820f4 --- /dev/null +++ b/frontend/src/features/layout/LayoutGrid.refitEpoch.test.tsx @@ -0,0 +1,136 @@ +import { useEffect } from "react"; +import { describe, expect, it, vi } from "vitest"; +import { render, screen, waitFor } from "@testing-library/react"; + +import type { Gateways } from "@/ports"; +import { MockLayoutGateway, MockTerminalGateway } from "@/adapters/mock"; +import { DIProvider } from "@/app/di"; + +const terminalViewSpy = vi.hoisted(() => vi.fn()); +const terminalMountSpy = vi.hoisted(() => vi.fn()); +const terminalUnmountSpy = vi.hoisted(() => vi.fn()); + +vi.mock("@/features/terminals", () => ({ + TerminalView: (props: { refitSignal?: number }) => { + terminalViewSpy(props); + useEffect(() => { + terminalMountSpy(); + return () => terminalUnmountSpy(); + }, []); + return ( +
+ ); + }, + ResumeConversationPopup: () => null, + useWritePortal: () => ({ + portal: { + onHumanData: () => {}, + isSuspended: () => false, + bindHandle: () => {}, + unbindHandle: () => {}, + }, + overlay: false, + }), +})); + +import { LayoutGrid } from "./LayoutGrid"; + +function renderGrid( + layout: MockLayoutGateway, + props: { projectId: string; cwd: string; layoutId?: string }, +) { + const gateways = { + layout, + terminal: new MockTerminalGateway(), + } as unknown as Gateways; + + return render( +