fix tests

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2026-01-05 10:26:51 +01:00
parent 38d2da95a7
commit 5c49a00bbd
5 changed files with 14 additions and 6 deletions
+6
View File
@@ -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.
@@ -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';
@@ -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;
@@ -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);
@@ -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);