authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-05 00:20:11-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-05 00:20:11-07:00
log11cb88efc54c5690e25348ce5c889722a3615089
tree3787c0fc4457aaa86211774b0ea4ccc4032f474c
parent4f1dc55cabe6cb4a89c2180d6b0e270584bb8883
signature Signed by PGP key B5690EEEBB952194

test(web): keep the preview profile label helper private (#9997)


2 files changed, 2 insertions(+), 8 deletions(-)

apps/web/src/components/preview/PreviewView.test.tsx+1-7
...@@ -251,7 +251,7 @@ vi.mock("./AgentBrowserCursor", () => ({ AgentBrowserCursor: () => null }));...@@ -251,7 +251,7 @@ vi.mock("./AgentBrowserCursor", () => ({ AgentBrowserCursor: () => null }));
251vi.mock("~/browser/BrowserSurfaceSlot", () => ({ BrowserSurfaceSlot: () => null }));251vi.mock("~/browser/BrowserSurfaceSlot", () => ({ BrowserSurfaceSlot: () => null }));
252vi.mock("./usePreviewSession", () => ({ usePreviewSession: vi.fn() }));252vi.mock("./usePreviewSession", () => ({ usePreviewSession: vi.fn() }));
253253
254import { PreviewView, previewProfileName } from "./PreviewView";254import { PreviewView } from "./PreviewView";
255import { toastManager } from "~/components/ui/toast";255import { toastManager } from "~/components/ui/toast";
256import { previewRuntimeTabId } from "~/browser/previewRuntimeTabId";256import { previewRuntimeTabId } from "~/browser/previewRuntimeTabId";
257257
...@@ -352,12 +352,6 @@ describe("PreviewView navigation", () => {...@@ -352,12 +352,6 @@ describe("PreviewView navigation", () => {
352 mocks.recordVisitForThread.mockClear();352 mocks.recordVisitForThread.mockClear();
353 });353 });
354354
355 it("labels a tab whose saved profile was removed", () => {
356 expect(previewProfileName(BUILT_IN_BROWSER_PROFILES, "profile-removed")).toBe(
357 "Removed profile",
358 );
359 });
360
361 it("does not rerender while loading time passes", async () => {355 it("does not rerender while loading time passes", async () => {
362 vi.useFakeTimers();356 vi.useFakeTimers();
363 mocks.loading = true;357 mocks.loading = true;
apps/web/src/components/preview/PreviewView.tsx+1-1
...@@ -76,7 +76,7 @@ interface Props {...@@ -76,7 +76,7 @@ interface Props {
76 ) => void;76 ) => void;
77}77}
7878
79export function previewProfileName(79function previewProfileName(
80 profiles: ReadonlyArray<{ readonly id: string; readonly name: string }>,80 profiles: ReadonlyArray<{ readonly id: string; readonly name: string }>,
81 profileId: string,81 profileId: string,
82): string {82): string {