diff --git a/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx b/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx
index 700053bcd7..fc5676e7c9 100644
--- a/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx
+++ b/plugins/catalog-graph/src/components/CatalogGraphPage/CatalogGraphPage.test.tsx
@@ -45,6 +45,14 @@ describe('', () => {
value: () => ({ width: 100, height: 100 }),
configurable: true,
});
+ Object.defineProperty(window.SVGElement.prototype, 'viewBox', {
+ value: { baseVal: { x: 0, y: 0, width: 100, height: 100 } },
+ configurable: true,
+ });
+ Object.defineProperty(window.MouseEvent.prototype, 'view', {
+ value: window,
+ configurable: true,
+ });
});
beforeEach(() => {
@@ -194,6 +202,9 @@ describe('', () => {
expect(await findAllByTestId('node')).toHaveLength(2);
+ // We wait a bit here to reliably reproduce an issue where that requires the `baseVal` and `view` mocks
+ await new Promise(r => setTimeout(r, 100));
+
await userEvent.click(getByText('b:d/e'));
expect(analyticsSpy.getEvents()[0]).toMatchObject({