diff --git a/ui/src/react-admin/modules/content-page/const/background-text-colors.test.ts b/ui/src/react-admin/modules/content-page/const/background-text-colors.test.ts index c0b43ba7..9524b454 100644 --- a/ui/src/react-admin/modules/content-page/const/background-text-colors.test.ts +++ b/ui/src/react-admin/modules/content-page/const/background-text-colors.test.ts @@ -23,6 +23,7 @@ const EXPECTED_BACKGROUND_TEXT_COLORS: [string, Color, Color, Color, Color][] = // Merk ['Zwart', Color.Black, Color.White, Color.Zinc, Color.OceanGreen], ['Wit', Color.White, Color.Black, Color.Slate, Color.Jade], + ['Transparent', Color.Transparent, Color.Black, Color.Slate, Color.Jade], ['Teal', Color.OceanGreen, Color.Black, Color.Ink, Color.Black], // Functioneel ['Grafiet', Color.Graphite, Color.White, Color.Zinc, Color.OceanGreen], @@ -87,8 +88,7 @@ describe('getBackgroundTextColors()', () => { }); it('has a ruling for every selectable flat Archief background', () => { - const backgroundsWithoutOneTextColor = [ - Color.Transparent, + const backgroundsWithoutOneTextColor: (Color | GradientColor | CustomBackground)[] = [ GradientColor.BlackWhite, CustomBackground.MeemooLogo, ]; @@ -107,7 +107,6 @@ describe('getBackgroundTextColors()', () => { // Design specified nothing for these, so blocks keep whatever they inherit. In particular, // meemoo confirmed that BlackWhite must retain the existing per-block handling. it.each<[string, Color | GradientColor | CustomBackground | undefined]>([ - ['transparent', Color.Transparent], ['the separately handled black-white gradient', GradientColor.BlackWhite], ['the meemoo logo pattern', CustomBackground.MeemooLogo], ['an AVO-only color', Color.SoftBlue], diff --git a/ui/src/react-admin/modules/content-page/const/background-text-colors.ts b/ui/src/react-admin/modules/content-page/const/background-text-colors.ts index 8cd72b40..93749c2d 100644 --- a/ui/src/react-admin/modules/content-page/const/background-text-colors.ts +++ b/ui/src/react-admin/modules/content-page/const/background-text-colors.ts @@ -41,6 +41,11 @@ export const BACKGROUND_TEXT_COLORS: Partial secondary: Color.Slate, hyperlink: Color.Jade, }, // Wit + [Color.Transparent]: { + primary: Color.Black, + secondary: Color.Slate, + hyperlink: Color.Jade, + }, // Transparent = Same as white [Color.OceanGreen]: { primary: Color.Black, secondary: Color.Ink, diff --git a/ui/src/react-admin/modules/shared/components/ContentPageLabelChip/ContentPageLabelChip.test.tsx b/ui/src/react-admin/modules/shared/components/ContentPageLabelChip/ContentPageLabelChip.test.tsx index a59583b5..0e954174 100644 --- a/ui/src/react-admin/modules/shared/components/ContentPageLabelChip/ContentPageLabelChip.test.tsx +++ b/ui/src/react-admin/modules/shared/components/ContentPageLabelChip/ContentPageLabelChip.test.tsx @@ -34,8 +34,12 @@ describe('', () => { expect(renderChip(Color.Black).style.color).toEqual('rgb(255, 255, 255)'); }); - it('keeps white text when the background has no WCAG mapping', () => { - expect(renderChip(CustomBackground.MeemooLogo).style.color).toEqual('rgb(255, 255, 255)'); + it('uses the transparent WCAG mapping for the meemoo logo pattern', () => { + // The component looks up Color.Transparent for the meemoo logo (it renders that background + // as transparent, see the test below). Since ARC-3981 gave Color.Transparent its own WCAG + // text mapping (same as White: black), that lookup now returns black instead of falling + // back to white. + expect(renderChip(CustomBackground.MeemooLogo).style.color).toEqual('rgb(0, 0, 0)'); }); it('renders the meemoo logo background as transparent, since a chip cannot show the pattern', () => {