From 5c49a00bbd991c9e1cc6ed5e8476d8bdc4b93ae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 5 Jan 2026 10:26:51 +0100 Subject: [PATCH] fix tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/twenty-candles-open.md | 6 ++++++ .../CatalogGraphPage/useCatalogGraphPage.test.tsx | 4 ++-- .../src/components/CatalogGraphPage/useCatalogGraphPage.ts | 6 ++++-- plugins/search/src/components/SearchPage/SearchPage.tsx | 2 +- plugins/search/src/components/SearchPage/UrlUpdater.tsx | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 .changeset/twenty-candles-open.md diff --git a/.changeset/twenty-candles-open.md b/.changeset/twenty-candles-open.md new file mode 100644 index 0000000000..94050dea05 --- /dev/null +++ b/.changeset/twenty-candles-open.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-catalog-graph': patch +'@backstage/plugin-search': patch +--- + +Update for the `qs` library bump: the old array limit setting has changed to be more strict; you can no longer just give a zero to mean unlimited. So we choose an arbitrary high value, to at least go higher than the default 20. diff --git a/plugins/catalog-graph/src/components/CatalogGraphPage/useCatalogGraphPage.test.tsx b/plugins/catalog-graph/src/components/CatalogGraphPage/useCatalogGraphPage.test.tsx index fa3d67520d..fbdfc3743b 100644 --- a/plugins/catalog-graph/src/components/CatalogGraphPage/useCatalogGraphPage.test.tsx +++ b/plugins/catalog-graph/src/components/CatalogGraphPage/useCatalogGraphPage.test.tsx @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { RELATION_MEMBER_OF } from '@backstage/catalog-model'; import { renderHook, waitFor } from '@testing-library/react'; -import { ReactNode } from 'react'; -import { act } from 'react-dom/test-utils'; +import { ReactNode, act } from 'react'; import { BrowserRouter } from 'react-router-dom'; import { Direction } from '../../lib/types'; import { useCatalogGraphPage } from './useCatalogGraphPage'; diff --git a/plugins/catalog-graph/src/components/CatalogGraphPage/useCatalogGraphPage.ts b/plugins/catalog-graph/src/components/CatalogGraphPage/useCatalogGraphPage.ts index efc2170153..94329d2c06 100644 --- a/plugins/catalog-graph/src/components/CatalogGraphPage/useCatalogGraphPage.ts +++ b/plugins/catalog-graph/src/components/CatalogGraphPage/useCatalogGraphPage.ts @@ -73,8 +73,10 @@ export function useCatalogGraphPage({ const query = useMemo( () => - (qs.parse(location.search, { arrayLimit: 0, ignoreQueryPrefix: true }) || - {}) as { + (qs.parse(location.search, { + arrayLimit: 10000, + ignoreQueryPrefix: true, + }) || {}) as { selectedRelations?: string[] | string; selectedKinds?: string[] | string; rootEntityRefs?: string[] | string; diff --git a/plugins/search/src/components/SearchPage/SearchPage.tsx b/plugins/search/src/components/SearchPage/SearchPage.tsx index 9baee0d8f9..8428fb6bb5 100644 --- a/plugins/search/src/components/SearchPage/SearchPage.tsx +++ b/plugins/search/src/components/SearchPage/SearchPage.tsx @@ -45,7 +45,7 @@ export const UrlUpdater = () => { } const query = - qs.parse(location.search.substring(1), { arrayLimit: 0 }) || {}; + qs.parse(location.search.substring(1), { arrayLimit: 10000 }) || {}; if (query.filters) { setFilters(query.filters as JsonObject); diff --git a/plugins/search/src/components/SearchPage/UrlUpdater.tsx b/plugins/search/src/components/SearchPage/UrlUpdater.tsx index d4bfe057a3..9e94fe6d61 100644 --- a/plugins/search/src/components/SearchPage/UrlUpdater.tsx +++ b/plugins/search/src/components/SearchPage/UrlUpdater.tsx @@ -43,7 +43,7 @@ export const UrlUpdater = () => { } const query = - qs.parse(location.search.substring(1), { arrayLimit: 0 }) || {}; + qs.parse(location.search.substring(1), { arrayLimit: 10000 }) || {}; if (query.filters) { setFilters(query.filters as JsonObject);