mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
[web] Read subscription.features on Group Management rendering (#36168)
* [web] Read subscription.features on Group Management rendering Fixes 'ai-toggling' not properly read on Group Management rendering, causing the Feature Controls option not being displayed in certain scenarios. GitOrigin-RevId: 4465fea15279d650d9d231e85072f1d85f2358be
This commit is contained in:
+90
@@ -441,5 +441,95 @@ describe('<ManagedGroupSubscriptions />', function () {
|
||||
expect(screen.queryByText('Feature controls')).to.be.null
|
||||
})
|
||||
})
|
||||
|
||||
describe('AI toggling', function () {
|
||||
it('renders the feature controls row when the "ai-toggling" split test is enabled and the group has the aiToggling feature', async function () {
|
||||
renderWithSubscriptionDashContext(<ManagedGroupSubscriptions />, {
|
||||
metaTags: [
|
||||
{
|
||||
name: 'ol-managedGroupSubscriptions',
|
||||
value: makeSubscription({
|
||||
features: {
|
||||
groupSSO: false,
|
||||
managedUsers: false,
|
||||
aiToggling: true,
|
||||
},
|
||||
}),
|
||||
},
|
||||
{ name: 'ol-usersEmail', value: adminEmail },
|
||||
{
|
||||
name: 'ol-splitTestVariants',
|
||||
value: { 'ai-toggling': 'enabled' },
|
||||
},
|
||||
],
|
||||
})
|
||||
await screen.findByText('Feature controls')
|
||||
})
|
||||
|
||||
it('does not render the feature controls row when the "ai-toggling" split test is enabled but the group lacks the aiToggling feature', function () {
|
||||
renderWithSubscriptionDashContext(<ManagedGroupSubscriptions />, {
|
||||
metaTags: [
|
||||
{
|
||||
name: 'ol-managedGroupSubscriptions',
|
||||
value: makeSubscription({
|
||||
features: {
|
||||
groupSSO: false,
|
||||
managedUsers: false,
|
||||
aiToggling: false,
|
||||
},
|
||||
}),
|
||||
},
|
||||
{ name: 'ol-usersEmail', value: adminEmail },
|
||||
{
|
||||
name: 'ol-splitTestVariants',
|
||||
value: { 'ai-toggling': 'enabled' },
|
||||
},
|
||||
],
|
||||
})
|
||||
expect(screen.queryByText('Feature controls')).to.be.null
|
||||
})
|
||||
|
||||
it('does not render the feature controls row when the group has the aiToggling feature but the "ai-toggling" split test is disabled', function () {
|
||||
renderWithSubscriptionDashContext(<ManagedGroupSubscriptions />, {
|
||||
metaTags: [
|
||||
{
|
||||
name: 'ol-managedGroupSubscriptions',
|
||||
value: makeSubscription({
|
||||
features: {
|
||||
groupSSO: false,
|
||||
managedUsers: false,
|
||||
aiToggling: true,
|
||||
},
|
||||
}),
|
||||
},
|
||||
{ name: 'ol-usersEmail', value: adminEmail },
|
||||
],
|
||||
})
|
||||
expect(screen.queryByText('Feature controls')).to.be.null
|
||||
})
|
||||
|
||||
it('does not render the feature controls row when the user is not the group admin', function () {
|
||||
renderWithSubscriptionDashContext(<ManagedGroupSubscriptions />, {
|
||||
metaTags: [
|
||||
{
|
||||
name: 'ol-managedGroupSubscriptions',
|
||||
value: makeSubscription({
|
||||
features: {
|
||||
groupSSO: false,
|
||||
managedUsers: false,
|
||||
aiToggling: true,
|
||||
},
|
||||
}),
|
||||
},
|
||||
{ name: 'ol-usersEmail', value: 'other@example.com' },
|
||||
{
|
||||
name: 'ol-splitTestVariants',
|
||||
value: { 'ai-toggling': 'enabled' },
|
||||
},
|
||||
],
|
||||
})
|
||||
expect(screen.queryByText('Feature controls')).to.be.null
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user