|
|
@@ -246,12 +246,7 @@ describe('<CurrentPlanWidget />', function () {
|
|
|
})
|
|
|
})
|
|
|
|
|
|
- describe('features page split test', function () {
|
|
|
- const variants = [
|
|
|
- { name: 'default', link: '/learn/how-to/Overleaf_premium_features' },
|
|
|
- { name: 'new', link: '/about/features-overview' },
|
|
|
- ]
|
|
|
-
|
|
|
+ describe('features page', function () {
|
|
|
const plans = [
|
|
|
{ type: 'free' },
|
|
|
{
|
|
|
@@ -281,38 +276,21 @@ describe('<CurrentPlanWidget />', function () {
|
|
|
},
|
|
|
]
|
|
|
|
|
|
- for (const variant of variants) {
|
|
|
- describe(`${variant.name} variant`, function () {
|
|
|
- beforeEach(function () {
|
|
|
- window.metaAttributesCache.set('ol-splitTestVariants', {
|
|
|
- 'features-page': variant.name,
|
|
|
- })
|
|
|
- })
|
|
|
- afterEach(function () {
|
|
|
- window.metaAttributesCache.delete('ol-splitTestVariants')
|
|
|
+ for (const plan of plans) {
|
|
|
+ it(`links to features page on ${plan.type} plan`, function () {
|
|
|
+ window.metaAttributesCache.set('ol-usersBestSubscription', {
|
|
|
+ ...plan,
|
|
|
})
|
|
|
+ render(<CurrentPlanWidget />)
|
|
|
|
|
|
- for (const plan of plans) {
|
|
|
- it(`links to ${variant.name} features page on ${plan.type} plan and sends analytics event`, function () {
|
|
|
- window.metaAttributesCache.set('ol-usersBestSubscription', {
|
|
|
- ...plan,
|
|
|
- })
|
|
|
- render(<CurrentPlanWidget />)
|
|
|
-
|
|
|
- const links = screen.getAllByRole('link')
|
|
|
- expect(links[0].getAttribute('href')).to.equal(variant.link)
|
|
|
-
|
|
|
- fireEvent.click(links[0])
|
|
|
- expect(sendMBSpy).to.be.calledOnce
|
|
|
- expect(sendMBSpy).calledWith('features-page-link', {
|
|
|
- splitTest: 'features-page',
|
|
|
- splitTestVariant: variant.name,
|
|
|
- page: '/',
|
|
|
- })
|
|
|
-
|
|
|
- window.metaAttributesCache.delete('ol-usersBestSubscription')
|
|
|
- })
|
|
|
- }
|
|
|
+ const links = screen.getAllByRole('link')
|
|
|
+ expect(links[0].getAttribute('href')).to.equal(
|
|
|
+ '/learn/how-to/Overleaf_premium_features'
|
|
|
+ )
|
|
|
+
|
|
|
+ fireEvent.click(links[0])
|
|
|
+
|
|
|
+ window.metaAttributesCache.delete('ol-usersBestSubscription')
|
|
|
})
|
|
|
}
|
|
|
})
|