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:
openhands committed 2026-08-31 17:21:37 +02:00
1 parent a98b194386
commit 4c8225720a
6 files changed
+34 -8

No files matched your search

+3 -3
View File
@@ -239,7 +239,7 @@ export function ThemeEditor({
type="submit"
variant="outline"
size="sm"
className="text-red-500 hover:text-red-600"
className="text-[var(--admin-error)] hover:text-[var(--admin-error)]/80"
onClick={(e) => {
if (
!confirm("Delete this scope and all its theme values?")
@@ -264,7 +264,7 @@ export function ThemeEditor({
onClick={() => setMode("light")}
className={`px-3 py-1.5 text-xs font-medium transition-colors ${
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)]"
}`}
>
@@ -275,7 +275,7 @@ export function ThemeEditor({
onClick={() => setMode("dark")}
className={`px-3 py-1.5 text-xs font-medium transition-colors ${
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)]"
}`}
>
@@ -612,8 +612,8 @@ describe("housekeeping foundation completion contracts", () => {
HOUSEKEEPING_MIGRATION_MATRIX,
);
expect(HOUSEKEEPING_MIGRATION_MATRIX).toHaveLength(137);
expect(discovered).toHaveLength(137);
expect(HOUSEKEEPING_MIGRATION_MATRIX).toHaveLength(138);
expect(discovered).toHaveLength(138);
expect(issues).toEqual([]);
});
});
@@ -18,6 +18,7 @@ const CONTENT_PREFIXES = [
"/admin/writeable-boxes",
"/admin/email-templates",
"/admin/theme",
"/admin/theme-builder",
"/admin/favicon",
"/admin/translations",
] as const;
@@ -478,6 +478,31 @@ export const contentMigrationEntries: readonly MigrationEntry[] = [
localization: "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({
surface: "admin",
legacyPath: "/admin/favicon",
@@ -29,7 +29,7 @@ describe("discoverLegacyPages", () => {
it("discovers the exact legacy administration inventory", () => {
const pages = discoverLegacyPages();
expect(pages).toHaveLength(137);
expect(pages).toHaveLength(138);
expect(pages).toContainEqual({
surface: "admin",
legacyPath: "/admin/users/:id/edit",
@@ -4,10 +4,10 @@ import { HOUSEKEEPING_MIGRATION_MATRIX } from "./matrix";
import { validateMigrationEntries } from "./validate-matrix";
describe("HOUSEKEEPING_MIGRATION_MATRIX", () => {
it("covers all 137 legacy pages exactly once", () => {
it("covers all 138 legacy pages exactly once", () => {
const discovered = discoverLegacyPages();
expect(HOUSEKEEPING_MIGRATION_MATRIX).toHaveLength(137);
expect(HOUSEKEEPING_MIGRATION_MATRIX).toHaveLength(138);
expect(
validateMigrationEntries(discovered, HOUSEKEEPING_MIGRATION_MATRIX),
).toEqual([]);