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

providerSkills.test.ts

77 lines2.0 KB

1import { describe, expect, it } from "vite-plus/test";
2​
3import {
4 formatProviderSkillDisplayName,
5 resolveProviderSkillSourceKind,
6} from "./providerSkills.ts";
7​
8describe("formatProviderSkillDisplayName", () => {
9 it("prefers the provider display name", () => {
10 expect(
11 formatProviderSkillDisplayName({
12 name: "review-follow-up",
13 displayName: "Review Follow-up",
14 }),
15 ).toBe("Review Follow-up");
16 });
17​
18 it("falls back to a title-cased skill name", () => {
19 expect(
20 formatProviderSkillDisplayName({
21 name: "review-follow-up",
22 }),
23 ).toBe("Review Follow Up");
24 });
25});
26​
27describe("resolveProviderSkillSourceKind", () => {
28 it("marks plugin-backed skills as app installs", () => {
29 expect(
30 resolveProviderSkillSourceKind({
31 path: "/Users/julius/.codex/plugins/cache/openai-curated/github/skills/gh-fix-ci/SKILL.md",
32 scope: "user",
33 }),
34 ).toBe("app");
35 });
36​
37 it("maps standard scopes to source kinds", () => {
38 expect(
39 resolveProviderSkillSourceKind({
40 path: "/workspace/.codex/skills/review-follow-up/SKILL.md",
41 scope: "repo",
42 }),
43 ).toBe("repo");
44 expect(
45 resolveProviderSkillSourceKind({
46 path: "/workspace/.codex/skills/review-follow-up/SKILL.md",
47 scope: "project",
48 }),
49 ).toBe("project");
50 expect(
51 resolveProviderSkillSourceKind({
52 path: "/Users/julius/.agents/skills/agent-browser/SKILL.md",
53 scope: "user",
54 }),
55 ).toBe("personal");
56 expect(
57 resolveProviderSkillSourceKind({
58 path: "/usr/local/share/codex/skills/imagegen/SKILL.md",
59 scope: "system",
60 }),
61 ).toBe("system");
62 });
63​
64 it("keeps unknown and missing scopes usable", () => {
65 expect(
66 resolveProviderSkillSourceKind({
67 path: "/opt/skills/team-review/SKILL.md",
68 scope: "team_shared",
69 }),
70 ).toBe("other");
71 expect(
72 resolveProviderSkillSourceKind({
73 path: "/opt/skills/team-review/SKILL.md",
74 }),
75 ).toBe("other");
76 });
77});