overleaf/services/web/test/frontend/features/subscription/components/canceled-subscription/canceled-subscription.test.tsx
Jessica Lawshe 68e61d7bb7 Merge pull request #11973 from overleaf/ii-react-canceled-subscription
[web] Subscription page canceled subscription react migration

GitOrigin-RevId: dd127d753e72c194cd6bbb90b1ca1557742896d9
2023-02-24 09:05:28 +00:00

24 lines
945 B
TypeScript

import { expect } from 'chai'
import { render, screen, within } from '@testing-library/react'
import CanceledSubscription from '../../../../../../frontend/js/features/subscription/components/canceled-subscription/canceled'
describe('canceled subscription page', function () {
it('renders the invoices link', function () {
render(<CanceledSubscription />)
screen.getByRole('heading', { name: /subscription canceled/i })
const alert = screen.getByRole('alert')
within(alert).getByText(/to modify your subscription go to/i)
const manageSubscriptionLink = within(alert).getByRole('link', {
name: /manage subscription/i,
})
expect(manageSubscriptionLink.getAttribute('href')).to.equal(
'/user/subscription'
)
const backToYourProjectsLink = screen.getByRole('link', {
name: /back to your projects/i,
})
expect(backToYourProjectsLink.getAttribute('href')).to.equal('/project')
})
})