diff --git a/client/src/utils/__tests__/svg.test.ts b/client/src/utils/__tests__/svg.test.ts index 491084e128..ad86bb6cb1 100644 --- a/client/src/utils/__tests__/svg.test.ts +++ b/client/src/utils/__tests__/svg.test.ts @@ -208,6 +208,18 @@ describe('isMonochromeSvg', () => { ''; expect(isMonochromeSvg(svg)).toBe(true); }); + + it('tints a referenced glyph whose own fill overrides the use fill', () => { + const svg = + ''; + expect(isMonochromeSvg(svg)).toBe(true); + }); + + it('still counts a use fill that the referenced shape inherits', () => { + const svg = + ''; + expect(isMonochromeSvg(svg)).toBe(false); + }); }); describe('currentColor resolved against a fixed color', () => { @@ -308,6 +320,24 @@ describe('isMonochromeSvg', () => { ''; expect(isMonochromeSvg(svg)).toBe(false); }); + + it('tints a glyph whose root CSS fill is overridden by every rendered shape', () => { + const svg = + ''; + expect(isMonochromeSvg(svg)).toBe(true); + }); + + it('tints a glyph whose CSS group fill no rendered shape inherits', () => { + const svg = + ''; + expect(isMonochromeSvg(svg)).toBe(true); + }); + + it('still counts a CSS container fill inherited by an unpainted shape', () => { + const svg = + ''; + expect(isMonochromeSvg(svg)).toBe(false); + }); }); describe('default fills alongside