chore(org): improve precision of OwnershipCard link tests
Signed-off-by: Carl-Erik Bergström <cbergstrom@spotify.com>
This commit is contained in:
@@ -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/,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user