settingsBreadcrumbReplacesBackNavigation.test.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { readFileSync } from "node:fs";
  2. import { describe, expect, it } from "vitest";
  3. function readSource(name: string): string {
  4. return readFileSync(new URL(`../src/settings/${name}.tsx`, import.meta.url), "utf8");
  5. }
  6. describe("Settings breadcrumb replaces detail back navigation", () => {
  7. it.each([
  8. "MemorySettingsViewer",
  9. "PluginStoreDetailView",
  10. "SubagentsSection",
  11. "McpSettingsSection",
  12. "CommandsSection",
  13. "HookForm",
  14. ])("removes SettingsBackButton from %s", (name) => {
  15. expect(readSource(name)).not.toContain("SettingsBackButton");
  16. });
  17. it.each(["AutomationEditView", "OffPeakEditView"])(
  18. "moves %s back navigation into the breadcrumb",
  19. (name) => {
  20. const source = readSource(name);
  21. expect(source).toContain("SettingsBreadcrumbReporter");
  22. expect(source).not.toContain("AUTOMATION_BACK_TRIGGER_CLASSNAME");
  23. },
  24. );
  25. it.each([
  26. "CommandsSection",
  27. "SubagentsSection",
  28. "McpSettingsSection",
  29. "HookForm",
  30. ])("uses the xl UI token for the current form title in %s", (name) => {
  31. const source = readSource(name);
  32. expect(source).toContain("text-ui-xl font-semibold text-foreground");
  33. expect(source).not.toContain("text-xl");
  34. });
  35. });