Merge pull request #11881 from overleaf/ab-custom-subscription-react-dash

[web] Add a contact support message for custom subsbcriptions on React dash

GitOrigin-RevId: e2a2bb27b4f1e70cbbe62f4c837fe63d81a820c2
This commit is contained in:
Alexandre Bourdin
2023-02-22 13:18:01 +01:00
committed by Copybot
parent e915f62907
commit 8b00a496e7
8 changed files with 72 additions and 10 deletions

View File

@@ -12,12 +12,49 @@ describe('<SubscriptionDashboard />', function () {
})
describe('Free Plan', function () {
it('does not render the "Get the most out of your" subscription text', 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(
`Youre 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(`Youre on an Overleaf Paid plan.`, {
exact: false,
})
screen.getByText(`Contact support`, {
exact: false,
})
})
})
})

View File

@@ -6,7 +6,10 @@ import { groupPriceByUsageTypeAndSize, plans } from '../fixtures/plans'
export function renderWithSubscriptionDashContext(
component: React.ReactElement,
options?: {
metaTags?: { name: string; value: string | object | Array<object> }[]
metaTags?: {
name: string
value: string | object | Array<object> | boolean
}[]
recurlyNotLoaded?: boolean
queryingRecurly?: boolean
currencyCode?: string