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.", "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)', title: 'Over seat limit (6/5)',
link: { link: {
url: 'https://https://strapi.io/billing/manage-seats', url: 'https://strapi.io/billing/manage-seats',
label: 'MANAGE SEATS', label: 'Manage seats',
}, },
blockTransition: true, blockTransition: true,
onClose: expect.any(Function), 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.", "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)', title: 'Over seat limit (5/5)',
link: { link: {
url: 'https://cloud.strapi.io/profile/billing', url: 'https://strapi.io/billing/manage-seats',
label: 'ADD SEATS', label: 'Manage seats',
}, },
blockTransition: true, blockTransition: true,
onClose: expect.any(Function), 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 // @ts-expect-error mocked
useLicenseLimits.mockReturnValue({ useLicenseLimits.mockReturnValue({
...LICENSE_MOCK, ...LICENSE_MOCK,
license: { license: {
...LICENSE_MOCK.license, ...LICENSE_MOCK.license,
isHostedOnStrapiCloud: true, type: 'gold',
}, },
}); });
const { findByText, getByText } = render(<AdminSeatInfoEE />); const { getByText } = render(<AdminSeatInfoEE />);
await findByText('Add seats'); expect(getByText('Contact sales')).toBeInTheDocument();
// eslint-disable-next-line testing-library/no-node-access expect(
expect(getByText('Add seats').closest('a')).toHaveAttribute( // eslint-disable-next-line testing-library/no-node-access
getByText('Contact sales').closest('a')
).toHaveAttribute(
'href', 'href',
'https://cloud.strapi.io/profile/billing' 'https://strapi.io/billing/request-seats'
); );
}); });
}); });