overleaf-cep/services/web/test/frontend/features/group-management/components/request-status.spec.tsx
Rebeka Dekany 271635491a Remove incorrect "button" role from navigational links that are styled as buttons (#25504)
GitOrigin-RevId: 717b20a6f2e893034eb12547fa663d358c0de419
2025-05-14 08:05:21 +00:00

44 lines
1.1 KiB
TypeScript

import RequestStatus from '@/features/group-management/components/request-status'
describe('<RequestStatus />', function () {
beforeEach(function () {
cy.window().then(win => {
win.metaAttributesCache.set('ol-groupName', 'My Awesome Team')
})
cy.mount(
<RequestStatus icon="email" title="Test title" content="Test content" />
)
})
it('renders the back button', function () {
cy.findByTestId('group-heading').within(() => {
cy.findByRole('link', { 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('shows the title', function () {
cy.findByTestId('title').should('contain.text', 'Test title')
})
it('shows the content', function () {
cy.findByText('Test content')
})
it('renders the link to subscriptions', function () {
cy.findByRole('link', { name: /go to subscriptions/i }).should(
'have.attr',
'href',
'/user/subscription'
)
})
})