Merge pull request #22578 from overleaf/ii-fl-add-seats-upgrade-plan-link

[web] Add seats "Upgrade my plan" link

GitOrigin-RevId: 7c72101be6b22feee9e3fb2ec119336e0e092ca9
This commit is contained in:
ilkin-overleaf
2024-12-19 09:05:01 +00:00
committed by Copybot
parent 7a48061d31
commit 48c0aaf940
5 changed files with 44 additions and 15 deletions
@@ -16,6 +16,7 @@ describe('<AddSeats />', function () {
'2025-01-01T12:00:00.000Z'
)
win.metaAttributesCache.set('ol-totalLicenses', this.totalLicenses)
win.metaAttributesCache.set('ol-isProfessional', false)
})
cy.mount(
@@ -69,14 +70,6 @@ describe('<AddSeats />', function () {
})
})
it('shows the "Upgrade my plan" link', function () {
cy.findByRole('link', { name: /upgrade my plan/i }).should(
'have.attr',
'href',
'/user/subscription/group/upgrade-subscription'
)
})
it('renders the cancel button', function () {
cy.findByRole('button', { name: /cancel/i }).should(
'have.attr',
@@ -85,6 +78,30 @@ describe('<AddSeats />', function () {
)
})
describe('"Upgrade my plan" link', function () {
it('shows the link', function () {
cy.findByRole('link', { name: /upgrade my plan/i }).should(
'have.attr',
'href',
'/user/subscription/group/upgrade-subscription'
)
})
it('hides the link', function () {
cy.window().then(win => {
win.metaAttributesCache.set('ol-isProfessional', true)
})
cy.mount(
<SplitTestProvider>
<AddSeats />
</SplitTestProvider>
)
cy.findByRole('link', { name: /upgrade my plan/i }).should('not.exist')
})
})
describe('cost summary', function () {
beforeEach(function () {
cy.findByLabelText(/how many users do you want to add/i).as('input')