Skip to content
Source
Sign inSign up
Open History to see the last commit

guestView.test.ts

35 lines1.0 KB

1import { describe, expect, it } from "@effect/vitest";
2​
3import { guestThreadModel } from "./guestView.ts";
4​
5describe("guestThreadModel", () => {
6 const providers = [
7 {
8 instanceId: "claude-work",
9 driver: "claudeAgent",
10 models: [
11 {
12 slug: "claude-opus",
13 name: "Claude Opus",
14 shortName: "Opus",
15 isCustom: false,
16 capabilities: null,
17 },
18 ],
19 },
20 ] as unknown as Parameters<typeof guestThreadModel>[1];
21​
22 it("names the model as the owner's picker does, or by its id when it is not listed", () => {
23 const selection = (instanceId: string, model: string) =>
24 ({ instanceId, model }) as Parameters<typeof guestThreadModel>[0];
25 expect(guestThreadModel(selection("claude-work", "claude-opus"), providers)).toEqual({
26 driver: "claudeAgent",
27 name: "Claude Opus",
28 shortName: "Opus",
29 });
30 expect(guestThreadModel(selection("removed", "gpt-5"), providers)).toEqual({
31 driver: null,
32 name: "gpt-5",
33 });
34 });
35});