fix: updating tests for Managing seats

This commit is contained in:
Simon Norris 2025-03-24 11:55:24 +01:00
parent c7e57b2c40
commit c3f2ca2808
2 changed files with 13 additions and 11 deletions

View File

@ -109,8 +109,8 @@ describe('useLicenseLimitNotification', () => {
"Add seats to invite Users. If you already did it but it's not reflected in Strapi yet, make sure to restart your app.",
title: 'Over seat limit (6/5)',
link: {
url: 'https://https://strapi.io/billing/manage-seats',
label: 'MANAGE SEATS',
url: 'https://strapi.io/billing/manage-seats',
label: 'Manage seats',
},
blockTransition: true,
onClose: expect.any(Function),
@ -135,8 +135,8 @@ describe('useLicenseLimitNotification', () => {
"Add seats to invite Users. If you already did it but it's not reflected in Strapi yet, make sure to restart your app.",
title: 'Over seat limit (5/5)',
link: {
url: 'https://cloud.strapi.io/profile/billing',
label: 'ADD SEATS',
url: 'https://strapi.io/billing/manage-seats',
label: 'Manage seats',
},
blockTransition: true,
onClose: expect.any(Function),

View File

@ -74,23 +74,25 @@ describe('<AdminSeatInfo />', () => {
);
});
test('Render billing link (on strapi cloud)', async () => {
test('Render billing link (gold license)', () => {
// @ts-expect-error mocked
useLicenseLimits.mockReturnValue({
...LICENSE_MOCK,
license: {
...LICENSE_MOCK.license,
isHostedOnStrapiCloud: true,
type: 'gold',
},
});
const { findByText, getByText } = render(<AdminSeatInfoEE />);
const { getByText } = render(<AdminSeatInfoEE />);
await findByText('Add seats');
// eslint-disable-next-line testing-library/no-node-access
expect(getByText('Add seats').closest('a')).toHaveAttribute(
expect(getByText('Contact sales')).toBeInTheDocument();
expect(
// eslint-disable-next-line testing-library/no-node-access
getByText('Contact sales').closest('a')
).toHaveAttribute(
'href',
'https://cloud.strapi.io/profile/billing'
'https://strapi.io/billing/request-seats'
);
});
});