Merge pull request #24430 from overleaf/ii-flexible-group-licensing-tear-down-feature-flag

[web] Tear down flexible group licensing feature flag

GitOrigin-RevId: 181713f1f2371b51cbc4256debea59bbcf3668f3
This commit is contained in:
ilkin-overleaf
2025-03-31 08:04:42 +00:00
committed by Copybot
parent f0fe0db10c
commit 61ce012fb5
19 changed files with 94 additions and 484 deletions
@@ -1,7 +1,6 @@
import GroupMembers from '@/features/group-management/components/group-members'
import { GroupMembersProvider } from '@/features/group-management/context/group-members-context'
import { User } from '../../../../../types/group-management/user'
import { SplitTestProvider } from '@/shared/context/split-test-context'
const GROUP_ID = '777fff777fff'
const PATHS = {
@@ -14,11 +13,9 @@ const PATHS = {
describe('GroupMembers', function () {
function mountGroupMembersProvider() {
cy.mount(
<SplitTestProvider>
<GroupMembersProvider>
<GroupMembers />
</GroupMembersProvider>
</SplitTestProvider>
<GroupMembersProvider>
<GroupMembers />
</GroupMembersProvider>
)
}
@@ -49,11 +46,9 @@ describe('GroupMembers', function () {
})
cy.mount(
<SplitTestProvider>
<GroupMembersProvider>
<GroupMembers />
</GroupMembersProvider>
</SplitTestProvider>
<GroupMembersProvider>
<GroupMembers />
</GroupMembersProvider>
)
})
@@ -517,9 +512,6 @@ describe('GroupMembers', function () {
win.metaAttributesCache.set('ol-groupId', GROUP_ID)
win.metaAttributesCache.set('ol-groupName', 'My Awesome Team')
win.metaAttributesCache.set('ol-groupSize', 10)
win.metaAttributesCache.set('ol-splitTestVariants', {
'flexible-group-licensing': 'enabled',
})
win.metaAttributesCache.set('ol-canUseFlexibleLicensing', true)
win.metaAttributesCache.set('ol-canUseAddSeatsFeature', true)
})
@@ -534,11 +526,9 @@ describe('GroupMembers', function () {
})
cy.mount(
<SplitTestProvider>
<GroupMembersProvider>
<GroupMembers />
</GroupMembersProvider>
</SplitTestProvider>
<GroupMembersProvider>
<GroupMembers />
</GroupMembersProvider>
)
cy.findByTestId('group-size-details').contains(
@@ -556,11 +546,9 @@ describe('GroupMembers', function () {
})
cy.mount(
<SplitTestProvider>
<GroupMembersProvider>
<GroupMembers />
</GroupMembersProvider>
</SplitTestProvider>
<GroupMembersProvider>
<GroupMembers />
</GroupMembersProvider>
)
cy.findByTestId('group-size-details').contains(
@@ -575,11 +563,9 @@ describe('GroupMembers', function () {
})
cy.mount(
<SplitTestProvider>
<GroupMembersProvider>
<GroupMembers />
</GroupMembersProvider>
</SplitTestProvider>
<GroupMembersProvider>
<GroupMembers />
</GroupMembersProvider>
)
cy.findByTestId('group-size-details').within(() => {
@@ -190,7 +190,7 @@ describe('<ManagedGroupSubscriptions />', function () {
},
],
})
await screen.findAllByText('Manage group settings')
await screen.findAllByText('Group settings')
await screen.findAllByText('Configure and manage SSO and Managed Users')
})
@@ -207,7 +207,7 @@ describe('<ManagedGroupSubscriptions />', function () {
},
],
})
await screen.findAllByText('Manage group settings')
await screen.findAllByText('Group settings')
await screen.findAllByText('Turn on Managed Users')
expect(screen.queryByText('Configure and manage SSO and Managed Users')).to
.not.exist
@@ -227,7 +227,7 @@ describe('<ManagedGroupSubscriptions />', function () {
},
],
})
await screen.findAllByText('Manage group settings')
await screen.findAllByText('Group settings')
await screen.findAllByText('Configure and manage SSO')
expect(screen.queryByText('Turn on Managed Users')).to.not.exist
expect(screen.queryByText('Configure and manage SSO and Managed Users')).to
@@ -72,7 +72,7 @@ describe('<PersonalSubscription />', function () {
],
})
screen.getByText('You are currently subscribed to the', { exact: false })
screen.getByRole('heading', { name: /billing/i })
})
it('renders the canceled dash', function () {
@@ -31,11 +31,8 @@ describe('<SubscriptionDashboard />', function () {
})
})
it('renders the "Get the most out of your" subscription text', function () {
screen.getByText(
'Get the most out of your Overleaf subscription by checking out',
{ exact: false }
)
it('renders the "Get the most from your subscription" text', function () {
screen.getByText(/get the most from your Overleaf subscription/i)
})
})
@@ -36,8 +36,8 @@ describe('successful subscription page', function () {
screen.getByText(
/it’s support from people like yourself that allows .* to continue to grow and improve/i
)
expect(screen.getByText(/get the most out of your/i).textContent).to.match(
/get the most out of your .* subscription by checking out .*’s features/i
expect(screen.getByText(/get the most from your/i).textContent).to.match(
/get the most from your .* subscription\. discover premium features/i
)
expect(
screen
@@ -66,9 +66,11 @@ describe('successful subscription page', function () {
)
const helpLink = screen.getByRole('link', {
name: /.*’s features/i,
name: /discover premium features/i,
})
expect(helpLink.getAttribute('href')).to.equal('/about/features-overview')
expect(helpLink.getAttribute('href')).to.equal(
'/learn/how-to/Overleaf_premium_features'
)
const backToYourProjectsLink = screen.getByRole('link', {
name: /back to your projects/i,
@@ -615,33 +615,6 @@ describe('SubscriptionGroupController', function () {
})
})
describe('flexibleLicensingSplitTest', function () {
it('passes when the variant is "enabled"', function (done) {
const res = sinon.stub()
const next = () => {
this.ErrorController.notFound.notCalled.should.equal(true)
done()
}
this.SplitTestHandler.promises.getAssignment.resolves({
variant: 'enabled',
})
this.Controller.flexibleLicensingSplitTest(this.req, res, next, done)
})
it('returns error page when the variant is "default"', function (done) {
const res = sinon.stub()
const next = sinon.stub()
this.ErrorController.notFound = sinon.stub().callsFake(() => {
next.notCalled.should.equal(true)
done()
})
this.SplitTestHandler.promises.getAssignment.resolves({
variant: 'default',
})
this.Controller.flexibleLicensingSplitTest(this.req, res, next, done)
})
})
describe('subscriptionUpgradePage', function () {
it('should render "subscription upgrade" page', function (done) {
const olSubscription = { membersLimit: 1, teamName: 'test team' }