settingsEmptyStateStyle.test.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import { readFileSync } from "node:fs";
  2. import { describe, expect, it } from "vitest";
  3. function readSource(path: string): string {
  4. return readFileSync(path, "utf8");
  5. }
  6. describe("settings empty state style", () => {
  7. it.each([
  8. "packages/ui/src/settings/PluginStoreListView.tsx",
  9. "packages/ui/src/settings/McpServerList.tsx",
  10. ])("uses a dashed transparent empty state in %s", (path) => {
  11. const source = readSource(path);
  12. expect(source).toContain("border-dashed");
  13. });
  14. it.each([
  15. "packages/ui/src/settings/CommandsSection.tsx",
  16. "packages/ui/src/settings/HooksList.tsx",
  17. "packages/ui/src/settings/SubagentsSection.tsx",
  18. ])("uses the shared dashed Plugin empty state in %s", (path) => {
  19. const source = readSource(path);
  20. expect(source).toContain("<PluginInstallEmptyState");
  21. });
  22. it("uses the shared dashed Plugin empty state for Skills", () => {
  23. const source = readSource("packages/ui/src/settings/SkillsSection.tsx");
  24. expect(source).toContain("<PluginInstallEmptyState");
  25. });
  26. it("keeps the automations empty state aligned with the Figma card surface", () => {
  27. const source = readSource(
  28. "packages/ui/src/settings/AutomationsSection.tsx",
  29. );
  30. expect(source).toContain("border-card-border bg-background");
  31. expect(source).not.toContain(
  32. 'data-automations-empty-state\n className="flex h-[226px] w-full items-center justify-center rounded-2xl border border-dashed',
  33. );
  34. });
  35. it("keeps the shared usage empty state transparent", () => {
  36. const source = readSource(
  37. "packages/ui/src/settings/usage-stats/usageStatsUiParts.tsx",
  38. );
  39. expect(source).toContain(
  40. 'className="rounded-xl border border-dashed border-border px-4 py-10 text-center"',
  41. );
  42. });
  43. });