|
@@ -658,6 +658,11 @@ describe('<UserNotifications />', function () {
|
|
|
totalSize: projects.length,
|
|
totalSize: projects.length,
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+ window.metaAttributesCache.set(
|
|
|
|
|
+ 'ol-groupsAndEnterpriseBannerVariant',
|
|
|
|
|
+ 'did-you-know'
|
|
|
|
|
+ )
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
afterEach(function () {
|
|
afterEach(function () {
|
|
@@ -665,7 +670,7 @@ describe('<UserNotifications />', function () {
|
|
|
window.metaAttributesCache = window.metaAttributesCache || new Map()
|
|
window.metaAttributesCache = window.metaAttributesCache || new Map()
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- it('does not show the banner for users that are in group or are affiliated or assigned in the `default` variant', async function () {
|
|
|
|
|
|
|
+ it('does not show the banner for users that are in group or are affiliated', async function () {
|
|
|
window.metaAttributesCache.set('ol-showGroupsAndEnterpriseBanner', false)
|
|
window.metaAttributesCache.set('ol-showGroupsAndEnterpriseBanner', false)
|
|
|
|
|
|
|
|
renderWithinProjectListProvider(GroupsAndEnterpriseBanner)
|
|
renderWithinProjectListProvider(GroupsAndEnterpriseBanner)
|
|
@@ -674,13 +679,45 @@ describe('<UserNotifications />', function () {
|
|
|
expect(screen.queryByRole('link', { name: 'Contact Sales' })).to.be.null
|
|
expect(screen.queryByRole('link', { name: 'Contact Sales' })).to.be.null
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- it('does not show the banner for users that have already dismissed it', async function () {
|
|
|
|
|
|
|
+ it('shows the banner for users that have dismissed the previous banners', async function () {
|
|
|
window.metaAttributesCache.set('ol-showGroupsAndEnterpriseBanner', true)
|
|
window.metaAttributesCache.set('ol-showGroupsAndEnterpriseBanner', true)
|
|
|
localStorage.setItem('has_dismissed_groups_and_enterprise_banner', true)
|
|
localStorage.setItem('has_dismissed_groups_and_enterprise_banner', true)
|
|
|
|
|
|
|
|
renderWithinProjectListProvider(GroupsAndEnterpriseBanner)
|
|
renderWithinProjectListProvider(GroupsAndEnterpriseBanner)
|
|
|
await fetchMock.flush(true)
|
|
await fetchMock.flush(true)
|
|
|
|
|
|
|
|
|
|
+ expect(screen.queryByRole('link', { name: 'Contact Sales' })).to.not.be
|
|
|
|
|
+ .null
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ it('shows the banner for users that have dismissed the banner more than 30 days ago', async function () {
|
|
|
|
|
+ const dismissed = new Date()
|
|
|
|
|
+ dismissed.setDate(dismissed.getDate() - 31) // 31 days
|
|
|
|
|
+ window.metaAttributesCache.set('ol-showGroupsAndEnterpriseBanner', true)
|
|
|
|
|
+ localStorage.setItem(
|
|
|
|
|
+ 'has_dismissed_groups_and_enterprise_banner',
|
|
|
|
|
+ dismissed
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
|
|
+ renderWithinProjectListProvider(GroupsAndEnterpriseBanner)
|
|
|
|
|
+ await fetchMock.flush(true)
|
|
|
|
|
+
|
|
|
|
|
+ expect(screen.queryByRole('link', { name: 'Contact Sales' })).to.not.be
|
|
|
|
|
+ .null
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ it('does not show the banner for users that have dismissed the banner within the last 30 days', async function () {
|
|
|
|
|
+ const dismissed = new Date()
|
|
|
|
|
+ dismissed.setDate(dismissed.getDate() - 29) // 29 days
|
|
|
|
|
+ window.metaAttributesCache.set('ol-showGroupsAndEnterpriseBanner', true)
|
|
|
|
|
+ localStorage.setItem(
|
|
|
|
|
+ 'has_dismissed_groups_and_enterprise_banner',
|
|
|
|
|
+ dismissed
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
|
|
+ renderWithinProjectListProvider(GroupsAndEnterpriseBanner)
|
|
|
|
|
+ await fetchMock.flush(true)
|
|
|
|
|
+
|
|
|
expect(screen.queryByRole('link', { name: 'Contact Sales' })).to.be.null
|
|
expect(screen.queryByRole('link', { name: 'Contact Sales' })).to.be.null
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -711,55 +748,72 @@ describe('<UserNotifications />', function () {
|
|
|
localStorage.clear()
|
|
localStorage.clear()
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- it('will show the correct text for the `save` split test variant', async function () {
|
|
|
|
|
|
|
+ it('will show the correct text for the `did-you-know` variant', async function () {
|
|
|
window.metaAttributesCache.set(
|
|
window.metaAttributesCache.set(
|
|
|
'ol-groupsAndEnterpriseBannerVariant',
|
|
'ol-groupsAndEnterpriseBannerVariant',
|
|
|
- 'save'
|
|
|
|
|
|
|
+ 'did-you-know'
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
renderWithinProjectListProvider(GroupsAndEnterpriseBanner)
|
|
renderWithinProjectListProvider(GroupsAndEnterpriseBanner)
|
|
|
await fetchMock.flush(true)
|
|
await fetchMock.flush(true)
|
|
|
|
|
|
|
|
screen.getByText(
|
|
screen.getByText(
|
|
|
- /Groups, Companies and Research Organizations can save money with our Group and Enterprise plans — request information or a quote./
|
|
|
|
|
|
|
+ 'Did you know that Overleaf offers group and organization-wide subscription options? Request information or a quote.'
|
|
|
)
|
|
)
|
|
|
const link = screen.getByRole('link', { name: 'Contact Sales' })
|
|
const link = screen.getByRole('link', { name: 'Contact Sales' })
|
|
|
|
|
|
|
|
- expect(link.getAttribute('href')).to.equal(`/for/contact-sales`)
|
|
|
|
|
|
|
+ expect(link.getAttribute('href')).to.equal(`/for/contact-sales-1`)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- it('will show the correct text for the `did-you-know` split test variant', async function () {
|
|
|
|
|
|
|
+ it('will show the correct text for the `on-premise` variant', async function () {
|
|
|
window.metaAttributesCache.set(
|
|
window.metaAttributesCache.set(
|
|
|
'ol-groupsAndEnterpriseBannerVariant',
|
|
'ol-groupsAndEnterpriseBannerVariant',
|
|
|
- 'did-you-know'
|
|
|
|
|
|
|
+ 'on-premise'
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
renderWithinProjectListProvider(GroupsAndEnterpriseBanner)
|
|
renderWithinProjectListProvider(GroupsAndEnterpriseBanner)
|
|
|
await fetchMock.flush(true)
|
|
await fetchMock.flush(true)
|
|
|
|
|
|
|
|
screen.getByText(
|
|
screen.getByText(
|
|
|
- 'Did you know that Overleaf offers group and organization-wide subscription options? Request information or a quote.'
|
|
|
|
|
|
|
+ 'Overleaf On-Premises: Does your company want to keep its data within its firewall? Overleaf offers Server Pro, an on-premises solution for companies. Get in touch to learn more.'
|
|
|
|
|
+ )
|
|
|
|
|
+ const link = screen.getByRole('link', { name: 'Contact Sales' })
|
|
|
|
|
+
|
|
|
|
|
+ expect(link.getAttribute('href')).to.equal(`/for/contact-sales-2`)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ it('will show the correct text for the `people` variant', async function () {
|
|
|
|
|
+ window.metaAttributesCache.set(
|
|
|
|
|
+ 'ol-groupsAndEnterpriseBannerVariant',
|
|
|
|
|
+ 'people'
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
|
|
+ renderWithinProjectListProvider(GroupsAndEnterpriseBanner)
|
|
|
|
|
+ await fetchMock.flush(true)
|
|
|
|
|
+
|
|
|
|
|
+ screen.getByText(
|
|
|
|
|
+ 'Other people at your company may already be using Overleaf. Save money with Overleaf group and company-wide subscriptions. Request more information.'
|
|
|
)
|
|
)
|
|
|
const link = screen.getByRole('link', { name: 'Contact Sales' })
|
|
const link = screen.getByRole('link', { name: 'Contact Sales' })
|
|
|
|
|
|
|
|
- expect(link.getAttribute('href')).to.equal(`/for/contact-sales`)
|
|
|
|
|
|
|
+ expect(link.getAttribute('href')).to.equal(`/for/contact-sales-3`)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- it('will show the correct text for the `empower` split test variant', async function () {
|
|
|
|
|
|
|
+ it('will show the correct text for the `FOMO` variant', async function () {
|
|
|
window.metaAttributesCache.set(
|
|
window.metaAttributesCache.set(
|
|
|
'ol-groupsAndEnterpriseBannerVariant',
|
|
'ol-groupsAndEnterpriseBannerVariant',
|
|
|
- 'empower'
|
|
|
|
|
|
|
+ 'FOMO'
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
renderWithinProjectListProvider(GroupsAndEnterpriseBanner)
|
|
renderWithinProjectListProvider(GroupsAndEnterpriseBanner)
|
|
|
await fetchMock.flush(true)
|
|
await fetchMock.flush(true)
|
|
|
|
|
|
|
|
screen.getByText(
|
|
screen.getByText(
|
|
|
- 'Empower your organization to work in Overleaf! Get a group or organizational plan.'
|
|
|
|
|
|
|
+ 'Why do Fortune 500 companies and top research institutions trust Overleaf to streamline their collaboration? Get in touch to learn more.'
|
|
|
)
|
|
)
|
|
|
const link = screen.getByRole('link', { name: 'Contact Sales' })
|
|
const link = screen.getByRole('link', { name: 'Contact Sales' })
|
|
|
|
|
|
|
|
- expect(link.getAttribute('href')).to.equal(`/for/contact-sales`)
|
|
|
|
|
|
|
+ expect(link.getAttribute('href')).to.equal(`/for/contact-sales-4`)
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|