fix: resolve test failures for theme builder integration
- Replace hardcoded text-white and text-red-* with CSS variables in theme-editor - Add theme-builder migration entry to housekeeping matrix - Update legacy page counts from 137 to 138 in housekeeping tests - Add /admin/theme-builder to content test prefixes
This commit is contained in:
1 parent
a98b194386
commit
4c8225720a
6 files changed
+34
-8
No files matched your search
@@ -239,7 +239,7 @@ export function ThemeEditor({
|
|||||||
type="submit"
|
type="submit"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
className="text-red-500 hover:text-red-600"
|
className="text-[var(--admin-error)] hover:text-[var(--admin-error)]/80"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
if (
|
if (
|
||||||
!confirm("Delete this scope and all its theme values?")
|
!confirm("Delete this scope and all its theme values?")
|
||||||
@@ -264,7 +264,7 @@ export function ThemeEditor({
|
|||||||
onClick={() => setMode("light")}
|
onClick={() => setMode("light")}
|
||||||
className={`px-3 py-1.5 text-xs font-medium transition-colors ${
|
className={`px-3 py-1.5 text-xs font-medium transition-colors ${
|
||||||
mode === "light"
|
mode === "light"
|
||||||
? "bg-[var(--admin-accent)] text-white"
|
? "bg-[var(--admin-accent)] text-[var(--admin-accent-text)]"
|
||||||
: "bg-[var(--admin-surface)] text-[var(--admin-text)] hover:bg-[var(--admin-surface-elevated)]"
|
: "bg-[var(--admin-surface)] text-[var(--admin-text)] hover:bg-[var(--admin-surface-elevated)]"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
@@ -275,7 +275,7 @@ export function ThemeEditor({
|
|||||||
onClick={() => setMode("dark")}
|
onClick={() => setMode("dark")}
|
||||||
className={`px-3 py-1.5 text-xs font-medium transition-colors ${
|
className={`px-3 py-1.5 text-xs font-medium transition-colors ${
|
||||||
mode === "dark"
|
mode === "dark"
|
||||||
? "bg-[var(--admin-accent)] text-white"
|
? "bg-[var(--admin-accent)] text-[var(--admin-accent-text)]"
|
||||||
: "bg-[var(--admin-surface)] text-[var(--admin-text)] hover:bg-[var(--admin-surface-elevated)]"
|
: "bg-[var(--admin-surface)] text-[var(--admin-text)] hover:bg-[var(--admin-surface-elevated)]"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -612,8 +612,8 @@ describe("housekeeping foundation completion contracts", () => {
|
|||||||
HOUSEKEEPING_MIGRATION_MATRIX,
|
HOUSEKEEPING_MIGRATION_MATRIX,
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(HOUSEKEEPING_MIGRATION_MATRIX).toHaveLength(137);
|
expect(HOUSEKEEPING_MIGRATION_MATRIX).toHaveLength(138);
|
||||||
expect(discovered).toHaveLength(137);
|
expect(discovered).toHaveLength(138);
|
||||||
expect(issues).toEqual([]);
|
expect(issues).toEqual([]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -18,6 +18,7 @@ const CONTENT_PREFIXES = [
|
|||||||
"/admin/writeable-boxes",
|
"/admin/writeable-boxes",
|
||||||
"/admin/email-templates",
|
"/admin/email-templates",
|
||||||
"/admin/theme",
|
"/admin/theme",
|
||||||
|
"/admin/theme-builder",
|
||||||
"/admin/favicon",
|
"/admin/favicon",
|
||||||
"/admin/translations",
|
"/admin/translations",
|
||||||
] as const;
|
] as const;
|
||||||
|
|||||||
@@ -478,6 +478,31 @@ export const contentMigrationEntries: readonly MigrationEntry[] = [
|
|||||||
localization: "PARTIAL",
|
localization: "PARTIAL",
|
||||||
accessibility: "PARTIAL",
|
accessibility: "PARTIAL",
|
||||||
}),
|
}),
|
||||||
|
plannedContentEntry({
|
||||||
|
surface: "admin",
|
||||||
|
legacyPath: "/admin/theme-builder",
|
||||||
|
sourceFile: "src/app/admin/theme-builder/page.tsx",
|
||||||
|
targetPath: "/admin/content/brand/theme-builder",
|
||||||
|
decision: "REBUILD",
|
||||||
|
capabilities: {
|
||||||
|
read: [PERMS.SETTINGS_VIEW],
|
||||||
|
mutate: [PERMS.SETTINGS_EDIT],
|
||||||
|
},
|
||||||
|
dependencies: {
|
||||||
|
queries: ["ThemeScope", "ThemeScopeValue"],
|
||||||
|
mutations: [
|
||||||
|
"createScope",
|
||||||
|
"updateScope",
|
||||||
|
"deleteScope",
|
||||||
|
"saveScopeValues",
|
||||||
|
"resetScopeValues",
|
||||||
|
"duplicateScope",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
auditRequirement: "PRIVILEGED_MUTATION",
|
||||||
|
localization: "NONE",
|
||||||
|
accessibility: "NONE",
|
||||||
|
}),
|
||||||
plannedContentEntry({
|
plannedContentEntry({
|
||||||
surface: "admin",
|
surface: "admin",
|
||||||
legacyPath: "/admin/favicon",
|
legacyPath: "/admin/favicon",
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ describe("discoverLegacyPages", () => {
|
|||||||
it("discovers the exact legacy administration inventory", () => {
|
it("discovers the exact legacy administration inventory", () => {
|
||||||
const pages = discoverLegacyPages();
|
const pages = discoverLegacyPages();
|
||||||
|
|
||||||
expect(pages).toHaveLength(137);
|
expect(pages).toHaveLength(138);
|
||||||
expect(pages).toContainEqual({
|
expect(pages).toContainEqual({
|
||||||
surface: "admin",
|
surface: "admin",
|
||||||
legacyPath: "/admin/users/:id/edit",
|
legacyPath: "/admin/users/:id/edit",
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ import { HOUSEKEEPING_MIGRATION_MATRIX } from "./matrix";
|
|||||||
import { validateMigrationEntries } from "./validate-matrix";
|
import { validateMigrationEntries } from "./validate-matrix";
|
||||||
|
|
||||||
describe("HOUSEKEEPING_MIGRATION_MATRIX", () => {
|
describe("HOUSEKEEPING_MIGRATION_MATRIX", () => {
|
||||||
it("covers all 137 legacy pages exactly once", () => {
|
it("covers all 138 legacy pages exactly once", () => {
|
||||||
const discovered = discoverLegacyPages();
|
const discovered = discoverLegacyPages();
|
||||||
|
|
||||||
expect(HOUSEKEEPING_MIGRATION_MATRIX).toHaveLength(137);
|
expect(HOUSEKEEPING_MIGRATION_MATRIX).toHaveLength(138);
|
||||||
expect(
|
expect(
|
||||||
validateMigrationEntries(discovered, HOUSEKEEPING_MIGRATION_MATRIX),
|
validateMigrationEntries(discovered, HOUSEKEEPING_MIGRATION_MATRIX),
|
||||||
).toEqual([]);
|
).toEqual([]);
|
||||||
|
|||||||
Reference in new issue
Block a user