diff --git a/client/src/utils/__tests__/svg.test.ts b/client/src/utils/__tests__/svg.test.ts
index 2d7c01f8ba..9a200e9166 100644
--- a/client/src/utils/__tests__/svg.test.ts
+++ b/client/src/utils/__tests__/svg.test.ts
@@ -143,6 +143,43 @@ describe('isMonochromeSvg', () => {
expect(isMonochromeSvg(svg)).toBe(false);
});
});
+
+ describe('embedded raster/foreign content (not tintable)', () => {
+ it('rejects an SVG wrapping an embedded raster image (href)', () => {
+ const svg = '';
+ expect(isMonochromeSvg(svg)).toBe(false);
+ });
+
+ it('rejects an SVG wrapping an embedded raster image (xlink:href)', () => {
+ const svg =
+ '';
+ expect(isMonochromeSvg(svg)).toBe(false);
+ });
+
+ it('rejects an SVG embedding foreignObject content', () => {
+ const svg = '';
+ expect(isMonochromeSvg(svg)).toBe(false);
+ });
+ });
+
+ describe('parser robustness', () => {
+ it('tints a namespaced monochrome svg', () => {
+ const svg =
+ '';
+ expect(isMonochromeSvg(svg)).toBe(true);
+ });
+
+ it('preserves a namespaced multi-color svg', () => {
+ const svg =
+ '';
+ expect(isMonochromeSvg(svg)).toBe(false);
+ });
+
+ it('does not tint unparseable input', () => {
+ expect(isMonochromeSvg('')).toBe(false);
+ expect(isMonochromeSvg('