Files
t3code/apps/web/src/providerSkillPresentation.test.ts
T
5e4bb0cb0c Add provider skill discovery (#1905)
Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
2026-04-13 14:41:45 -07:00

58 lines
1.5 KiB
TypeScript

import { describe, expect, it } from "vitest";
import {
formatProviderSkillDisplayName,
formatProviderSkillInstallSource,
} from "./providerSkillPresentation";
describe("formatProviderSkillDisplayName", () => {
it("prefers the provider display name", () => {
expect(
formatProviderSkillDisplayName({
name: "review-follow-up",
displayName: "Review Follow-up",
}),
).toBe("Review Follow-up");
});
it("falls back to a title-cased skill name", () => {
expect(
formatProviderSkillDisplayName({
name: "review-follow-up",
}),
).toBe("Review Follow Up");
});
});
describe("formatProviderSkillInstallSource", () => {
it("marks plugin-backed skills as app installs", () => {
expect(
formatProviderSkillInstallSource({
path: "/Users/julius/.codex/plugins/cache/openai-curated/github/skills/gh-fix-ci/SKILL.md",
scope: "user",
}),
).toBe("App");
});
it("maps standard scopes to user-facing labels", () => {
expect(
formatProviderSkillInstallSource({
path: "/Users/julius/.agents/skills/agent-browser/SKILL.md",
scope: "user",
}),
).toBe("Personal");
expect(
formatProviderSkillInstallSource({
path: "/usr/local/share/codex/skills/imagegen/SKILL.md",
scope: "system",
}),
).toBe("System");
expect(
formatProviderSkillInstallSource({
path: "/workspace/.codex/skills/review-follow-up/SKILL.md",
scope: "project",
}),
).toBe("Project");
});
});