settingsSkillScopeBadge.test.ts 1.3 KB

1234567891011121314151617181920212223242526272829
  1. import { readSourceTextAsync } from "./readSourceText.js";
  2. import { describe, expect, it } from "vitest";
  3. describe("settings skill scope badge", () => {
  4. it("reuses the Skills navigation icon for list items", async () => {
  5. const source = await readSourceTextAsync(
  6. new URL("../src/settings/SkillsSection.tsx", import.meta.url),
  7. );
  8. expect(source).toContain('<WandSparkles className="size-4"');
  9. expect(source).not.toContain('<Box className="size-4"');
  10. });
  11. it("does not repeat scope metadata beside the skill name in Plugin", async () => {
  12. const source = await readSourceTextAsync(
  13. new URL("../src/settings/SkillsSection.tsx", import.meta.url),
  14. );
  15. expect(source).not.toContain("<Badge");
  16. expect(source).not.toContain("data-skill-scope");
  17. expect(source).toContain('case "workspace"');
  18. expect(source).toContain('case "plugin"');
  19. // c0a58959fc 起插件 label 统一走 marketplace listing 解析(同名插件跨市场保持独立
  20. // label),skill 分组标题由 listing 元数据解析,不再使用 canonical slug 直出。
  21. expect(source).toContain("resolvePluginDisplayName(");
  22. expect(source).toContain("name: group.label,");
  23. expect(source).not.toContain("pluginManagedBadge");
  24. expect(source).not.toContain("pluginManagedHint");
  25. });
  26. });