From a58bcdcb47ae4135c16f35a525c0f629e0f9c8e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 20 May 2026 08:41:04 +0200 Subject: [PATCH] Add initialRouteEntries to fix flaky entity page test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The entity page resolves route params via useRouteRefParams. Without initialRouteEntries, the MemoryRouter starts at '/' which doesn't match the entity route pattern. On fast machines the mock entity resolves before the useEffect error check fires, but on slow CI runners the timing differs and the "No name provided!" error path wins, causing the test to flake. Adding initialRouteEntries ensures the router starts at a URL that matches /catalog/:namespace/:kind/:name, so route params are always available regardless of timing. Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Fredrik Adelöw --- plugins/catalog/src/alpha/pages.test.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/plugins/catalog/src/alpha/pages.test.tsx b/plugins/catalog/src/alpha/pages.test.tsx index 48eac13d5b..3cd14cb510 100644 --- a/plugins/catalog/src/alpha/pages.test.tsx +++ b/plugins/catalog/src/alpha/pages.test.tsx @@ -156,6 +156,7 @@ describe('Entity page', () => { [catalogApiRef, mockCatalogApi], [starredEntitiesApiRef, mockStarredEntitiesApi], ], + initialRouteEntries: ['/catalog/default/component/artist-lookup'], config: { app: { title: 'Custom app', @@ -203,6 +204,7 @@ describe('Entity page', () => { [catalogApiRef, mockCatalogApi], [starredEntitiesApiRef, mockStarredEntitiesApi], ], + initialRouteEntries: ['/catalog/default/component/artist-lookup'], config: { app: { title: 'Custom app', @@ -243,6 +245,7 @@ describe('Entity page', () => { [catalogApiRef, mockCatalogApi], [starredEntitiesApiRef, mockStarredEntitiesApi], ], + initialRouteEntries: ['/catalog/default/component/artist-lookup'], config: { app: { title: 'Custom app', @@ -296,6 +299,7 @@ describe('Entity page', () => { [catalogApiRef, mockCatalogApi], [starredEntitiesApiRef, mockStarredEntitiesApi], ], + initialRouteEntries: ['/catalog/default/component/artist-lookup'], config: { app: { title: 'Custom app', @@ -337,6 +341,7 @@ describe('Entity page', () => { [catalogApiRef, mockCatalogApi], [starredEntitiesApiRef, mockStarredEntitiesApi], ], + initialRouteEntries: ['/catalog/default/component/artist-lookup'], config: { app: { title: 'Custom app', @@ -371,6 +376,7 @@ describe('Entity page', () => { [catalogApiRef, mockCatalogApi], [starredEntitiesApiRef, mockStarredEntitiesApi], ], + initialRouteEntries: ['/catalog/default/component/artist-lookup'], config: { app: { title: 'Custom app', @@ -417,6 +423,7 @@ describe('Entity page', () => { [catalogApiRef, mockCatalogApi], [starredEntitiesApiRef, mockStarredEntitiesApi], ], + initialRouteEntries: ['/catalog/default/component/artist-lookup'], config: { app: { title: 'Custom app', @@ -453,6 +460,7 @@ describe('Entity page', () => { [catalogApiRef, mockCatalogApi], [starredEntitiesApiRef, mockStarredEntitiesApi], ], + initialRouteEntries: ['/catalog/default/component/artist-lookup'], config: { app: { title: 'Custom app', @@ -494,6 +502,7 @@ describe('Entity page', () => { [catalogApiRef, mockCatalogApi], [starredEntitiesApiRef, mockStarredEntitiesApi], ], + initialRouteEntries: ['/catalog/default/component/artist-lookup'], config: { app: { title: 'Custom app', @@ -543,6 +552,7 @@ describe('Entity page', () => { [catalogApiRef, mockCatalogApi], [starredEntitiesApiRef, mockStarredEntitiesApi], ], + initialRouteEntries: ['/catalog/default/component/artist-lookup'], config: { app: { title: 'Custom app', @@ -592,6 +602,7 @@ describe('Entity page', () => { [catalogApiRef, mockCatalogApi], [starredEntitiesApiRef, mockStarredEntitiesApi], ], + initialRouteEntries: ['/catalog/default/component/artist-lookup'], config: { app: { title: 'Custom app', @@ -629,6 +640,7 @@ describe('Entity page', () => { [catalogApiRef, mockCatalogApi], [starredEntitiesApiRef, mockStarredEntitiesApi], ], + initialRouteEntries: ['/catalog/default/component/artist-lookup'], config: { app: { title: 'Custom app', @@ -668,6 +680,7 @@ describe('Entity page', () => { [catalogApiRef, mockCatalogApi], [starredEntitiesApiRef, mockStarredEntitiesApi], ], + initialRouteEntries: ['/catalog/default/component/artist-lookup'], config: { app: { title: 'Custom app', @@ -727,6 +740,7 @@ describe('Entity page', () => { [catalogApiRef, mockCatalogApi], [starredEntitiesApiRef, mockStarredEntitiesApi], ], + initialRouteEntries: ['/catalog/default/component/artist-lookup'], config: { app: { title: 'Custom app', @@ -782,6 +796,7 @@ describe('Entity page', () => { [catalogApiRef, mockCatalogApi], [starredEntitiesApiRef, mockStarredEntitiesApi], ], + initialRouteEntries: ['/catalog/default/component/artist-lookup'], config: { app: { title: 'Custom app',