settingsCommandRowContent.test.ts 1.2 KB

123456789101112131415161718192021222324252627
  1. import { readFile } from "node:fs/promises";
  2. import { describe, expect, it } from "vitest";
  3. describe("settings command row content", () => {
  4. it("does not expose backing paths or repeat plugin-management guidance", async () => {
  5. const cardSource = await readFile(
  6. new URL("../src/settings/CommandCard.tsx", import.meta.url),
  7. "utf8",
  8. );
  9. const sectionSource = await readFile(
  10. new URL("../src/settings/CommandsSection.tsx", import.meta.url),
  11. "utf8",
  12. );
  13. expect(cardSource).not.toContain("command.location.directoryPath");
  14. expect(cardSource).not.toContain("pluginManagedHint");
  15. expect(sectionSource).not.toContain("settings.pluginManaged.modifyInPlugin");
  16. expect(sectionSource).not.toContain("pluginManagedHint");
  17. expect(cardSource).not.toContain("DirectoryBadges");
  18. expect(cardSource).not.toContain('"settings.scope.user"');
  19. expect(cardSource).not.toContain("command.pluginName}");
  20. expect(cardSource).toContain("<PluginStoreAvatar");
  21. expect(cardSource).toContain('className="size-9 bg-background"');
  22. expect(cardSource).toContain('fallbackIcon={<Terminal className="size-4" />}');
  23. expect(cardSource).not.toContain("rounded-md bg-surface");
  24. });
  25. });