mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-30 20:31:34 +02:00
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:
committed by
Copybot
parent
e915f62907
commit
8b00a496e7
@@ -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(
|
||||
`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,
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user