Co-authored-by: Julius Marminge <[email protected]> Co-authored-by: Cursor Agent <[email protected]>
37 lines
992 B
TypeScript
37 lines
992 B
TypeScript
import { describe, expect, it } from "vite-plus/test";
|
|
import type { ServerProviderModel } from "@t3tools/contracts";
|
|
|
|
import { deriveProviderModelsForDisplay } from "./ProviderInstanceCard";
|
|
|
|
describe("deriveProviderModelsForDisplay", () => {
|
|
it("uses current config custom models instead of stale live custom rows", () => {
|
|
const liveModels: ReadonlyArray<ServerProviderModel> = [
|
|
{
|
|
slug: "server-model",
|
|
name: "Server Model",
|
|
isCustom: false,
|
|
capabilities: null,
|
|
},
|
|
{
|
|
slug: "removed-custom",
|
|
name: "Removed Custom",
|
|
isCustom: true,
|
|
capabilities: null,
|
|
},
|
|
{
|
|
slug: "kept-custom",
|
|
name: "Kept Custom",
|
|
isCustom: true,
|
|
capabilities: null,
|
|
},
|
|
];
|
|
|
|
expect(
|
|
deriveProviderModelsForDisplay({
|
|
liveModels,
|
|
customModels: ["kept-custom"],
|
|
}).map((model) => model.slug),
|
|
).toEqual(["server-model", "kept-custom"]);
|
|
});
|
|
});
|