| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- import { expect } from 'chai'
- import { screen } from '@testing-library/react'
- import SubscriptionDashboard from '../../../../../../frontend/js/features/subscription/components/dashboard/subscription-dashboard'
- import {
- cleanUpContext,
- renderWithSubscriptionDashContext,
- } from '../../helpers/render-with-subscription-dash-context'
- describe('<SubscriptionDashboard />', function () {
- afterEach(function () {
- cleanUpContext()
- })
- describe('Free Plan', function () {
- beforeEach(function () {
- renderWithSubscriptionDashContext(<SubscriptionDashboard />)
- })
- it('does not render the "Get the most out of your" subscription text', function () {
- const text = screen.queryByText('Get the most out of your', {
- exact: false,
- })
- expect(text).to.be.null
- })
- it('does not render the contact support message', function () {
- const text = screen.queryByText(
- `You’re on an Overleaf Paid plan. Contact`,
- {
- exact: false,
- }
- )
- expect(text).to.be.null
- })
- })
- describe('Custom subscription', function () {
- it('renders the contact support message', function () {
- renderWithSubscriptionDashContext(<SubscriptionDashboard />, {
- metaTags: [
- {
- name: 'ol-currentInstitutionsWithLicence',
- value: [],
- },
- {
- name: 'ol-hasSubscription',
- value: true,
- },
- ],
- })
- screen.getByText(`You’re on an Overleaf Paid plan.`, {
- exact: false,
- })
- screen.getByText(`Contact support`, {
- exact: false,
- })
- })
- })
- })
|