diff --git a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.test.tsx b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.test.tsx index 4541a74a6e..faba9b5627 100644 --- a/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.test.tsx +++ b/plugins/org/src/components/Cards/OwnershipCard/OwnershipCard.test.tsx @@ -263,10 +263,11 @@ describe('OwnershipCard', () => { }, ); - expect(getByText('OPENAPI').closest('a')).toHaveAttribute( - 'href', - '/create/?filters%5Bkind%5D=api&filters%5Btype%5D=openapi&filters%5Bowners%5D=my-team&filters%5Buser%5D=all', - ); + const href = getByText('OPENAPI').closest('a')?.href ?? ''; + // This env does not support URLSearchParams + const queryParams = decodeURIComponent(href); + + expect(queryParams).toContain('filters[owners]=my-team'); }); it('links to the catalog with the user and groups filters from an user profile', async () => { @@ -309,9 +310,11 @@ describe('OwnershipCard', () => { }, ); - expect(getByText('OPENAPI').closest('a')).toHaveAttribute( - 'href', - '/create/?filters%5Bkind%5D=api&filters%5Btype%5D=openapi&filters%5Bowners%5D=user%3Athe-user&filters%5Bowners%5D=my-team&filters%5Bowners%5D=custom%2Fsome-team&filters%5Buser%5D=all', + const href = getByText('OPENAPI').closest('a')?.href ?? ''; + // This env does not support URLSearchParams + const queryParams = decodeURIComponent(href); + expect(queryParams).toMatch( + /filters\[owners\]=custom\/some\-team.*filters\[owners\]=user:the-user/, ); });