overleaf/services/web/test/frontend/features/group-management/components/request-confirmation.spec.tsx
ilkin-overleaf 6345ec3b04 Merge pull request #21712 from overleaf/ii-flexible-group-licensing-confirmation-page
[web] Request confirmation page for flexible licensing

GitOrigin-RevId: 855dcbd46c645da75b8c641f0c49670b2e04df3f
2024-11-12 09:04:35 +00:00

40 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import '../../../helpers/bootstrap-5'
import RequestConfirmation from '@/features/group-management/components/request-confirmation'
describe('request confirmation page', function () {
beforeEach(function () {
cy.window().then(win => {
win.metaAttributesCache.set('ol-groupName', 'My Awesome Team')
})
cy.mount(<RequestConfirmation />)
})
it('renders the back button', function () {
cy.findByTestId('group-heading').within(() => {
cy.findByRole('button', { name: /back to subscription/i }).should(
'have.attr',
'href',
'/user/subscription'
)
})
})
it('shows the group name', function () {
cy.findByTestId('group-heading').within(() => {
cy.findByRole('heading', { name: 'My Awesome Team' })
})
})
it('indicates the message was received', function () {
cy.findByRole('heading', { name: /weve got your request/i })
cy.findByText(/our team will get back to you shortly/i)
})
it('renders the link to subscriptions', function () {
cy.findByRole('button', { name: /go to subscriptions/i }).should(
'have.attr',
'href',
'/user/subscription'
)
})
})