48 lines · 1.4 KB · TypeScript
RawDownload
import { EnvironmentId } from "@t3tools/contracts";import { describe, expect, it } from "vite-plus/test"; import { shouldShowOpenInPicker } from "./ChatHeader"; describe("shouldShowOpenInPicker", () => {  const primaryEnvironmentId = EnvironmentId.make("environment-primary");   it("shows the picker for projects in the primary environment", () => {    expect(      shouldShowOpenInPicker({        activeProjectName: "codething-mvp",        activeThreadEnvironmentId: primaryEnvironmentId,        primaryEnvironmentId,      }),    ).toBe(true);  });   it("hides the picker when hosted static mode has no primary environment", () => {    expect(      shouldShowOpenInPicker({        activeProjectName: "codething-mvp",        activeThreadEnvironmentId: EnvironmentId.make("environment-remote"),        primaryEnvironmentId: null,      }),    ).toBe(false);  });   it("hides the picker for remote environments", () => {    expect(      shouldShowOpenInPicker({        activeProjectName: "codething-mvp",        activeThreadEnvironmentId: EnvironmentId.make("environment-remote"),        primaryEnvironmentId,      }),    ).toBe(false);  });   it("hides the picker when there is no active project", () => {    expect(      shouldShowOpenInPicker({        activeProjectName: undefined,        activeThreadEnvironmentId: primaryEnvironmentId,        primaryEnvironmentId,      }),    ).toBe(false);  });});

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t