mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-10-16 21:15:38 +08:00
* feat(pi): add native coding agent support * refactor(pi): align native provider management * fix(pi): allow removing global default provider * feat(pi): refine provider creation experience * refactor(pi): align prompt management UI * feat(pi): refine native prompt and provider UX * fix(pi): size config preview to content * feat(pi): refine native provider management * refactor(pi): remove unused integration paths * fix(pi): address review feedback * test(pi): align model picker assertions * fix(pi): preserve AGENTS.md during restore sync --------- Co-authored-by: Jason <farion1231@gmail.com>
52 lines
1.5 KiB
TypeScript
52 lines
1.5 KiB
TypeScript
import fs from "node:fs";
|
|
import path from "node:path";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
const PROVIDER_CARD_TSX = path.resolve(
|
|
__dirname,
|
|
"..",
|
|
"..",
|
|
"src",
|
|
"components",
|
|
"providers",
|
|
"ProviderCard.tsx",
|
|
);
|
|
const PROVIDER_LIST_TSX = path.resolve(
|
|
__dirname,
|
|
"..",
|
|
"..",
|
|
"src",
|
|
"components",
|
|
"providers",
|
|
"ProviderList.tsx",
|
|
);
|
|
|
|
describe("ProviderCard layout", () => {
|
|
const source = fs.readFileSync(PROVIDER_CARD_TSX, "utf8");
|
|
|
|
it("lets website links use available card width before truncating", () => {
|
|
expect(source).not.toContain("max-w-[280px]");
|
|
expect(source).toContain("flex min-w-0 flex-1 items-center gap-2");
|
|
expect(source).toContain("min-w-0 flex-1 space-y-1");
|
|
expect(source).toContain(
|
|
"inline-flex max-w-full items-center overflow-hidden text-left text-sm",
|
|
);
|
|
});
|
|
|
|
it("does not add a Pi-only model list to provider cards", () => {
|
|
expect(source).not.toContain("ProviderModelSummary");
|
|
expect(source).not.toContain("extractPiModelSummaryItems");
|
|
});
|
|
|
|
it("keeps Pi provider cards independent from routing capability state", () => {
|
|
const listSource = fs.readFileSync(PROVIDER_LIST_TSX, "utf8");
|
|
|
|
expect(source).not.toContain("piCurrentRoute");
|
|
expect(source).not.toContain("isFailoverEligible");
|
|
expect(listSource).not.toContain("gatewayStatus");
|
|
expect(listSource).not.toContain("activeRoute");
|
|
expect(listSource).not.toContain("pi.gatewayReason");
|
|
expect(listSource).not.toContain("pi.route");
|
|
});
|
|
});
|