mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
68e61d7bb7
[web] Subscription page canceled subscription react migration GitOrigin-RevId: dd127d753e72c194cd6bbb90b1ca1557742896d9
24 lines
945 B
TypeScript
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')
|
|
})
|
|
})
|