Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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,
];
Expand All @@ -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],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ export const BACKGROUND_TEXT_COLORS: Partial<Record<Color, BackgroundTextColors>
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ describe('<ContentPageLabelChip />', () => {
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', () => {
Expand Down