|
@@ -6,7 +6,6 @@ import {
|
|
|
cleanUpContext,
|
|
cleanUpContext,
|
|
|
renderWithSubscriptionDashContext,
|
|
renderWithSubscriptionDashContext,
|
|
|
} from '../../helpers/render-with-subscription-dash-context'
|
|
} from '../../helpers/render-with-subscription-dash-context'
|
|
|
-import getMeta from '@/utils/meta'
|
|
|
|
|
|
|
|
|
|
function getManagedGroupSubscriptions(
|
|
function getManagedGroupSubscriptions(
|
|
|
groupSSO: boolean | null,
|
|
groupSSO: boolean | null,
|
|
@@ -180,209 +179,77 @@ describe('<ManagedGroupSubscriptions />', function () {
|
|
|
.be.null
|
|
.be.null
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- describe('with group SSO off by default', function () {
|
|
|
|
|
- beforeEach(function () {
|
|
|
|
|
- Object.assign(getMeta('ol-ExposedSettings'), {
|
|
|
|
|
- groupSSOEnabled: false,
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- it('renders the Manage group settings row when feature is turned on', async function () {
|
|
|
|
|
- renderWithSubscriptionDashContext(<ManagedGroupSubscriptions />, {
|
|
|
|
|
- metaTags: [
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-managedGroupSubscriptions',
|
|
|
|
|
- value: managedGroupSubscriptions2,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-groupSettingsEnabledFor',
|
|
|
|
|
- value: [managedGroupSubscriptions2[0]._id],
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- })
|
|
|
|
|
- await screen.findAllByText('Manage group settings')
|
|
|
|
|
- await screen.findAllByText('Configure and manage SSO and Managed Users')
|
|
|
|
|
|
|
+ it('renders Managed Group / Group SSO settings row when both features are turned on', async function () {
|
|
|
|
|
+ renderWithSubscriptionDashContext(<ManagedGroupSubscriptions />, {
|
|
|
|
|
+ metaTags: [
|
|
|
|
|
+ {
|
|
|
|
|
+ name: 'ol-managedGroupSubscriptions',
|
|
|
|
|
+ value: managedGroupSubscriptions2,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: 'ol-groupSettingsEnabledFor',
|
|
|
|
|
+ value: [managedGroupSubscriptions2[0]._id],
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
})
|
|
})
|
|
|
|
|
+ await screen.findAllByText('Manage group settings')
|
|
|
|
|
+ await screen.findAllByText('Configure and manage SSO and Managed Users')
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- describe('renders the the correct subText for Manage Group settings row', async function () {
|
|
|
|
|
- it('with managedUsers.enabled=true and groupSSO.enabled=true', async function () {
|
|
|
|
|
- renderWithSubscriptionDashContext(<ManagedGroupSubscriptions />, {
|
|
|
|
|
- metaTags: [
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-managedGroupSubscriptions',
|
|
|
|
|
- value: managedGroupSubscriptions2,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-groupSettingsEnabledFor',
|
|
|
|
|
- value: [managedGroupSubscriptions2[0]._id],
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- })
|
|
|
|
|
- await screen.findAllByText('Configure and manage SSO and Managed Users')
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- it('with managedUsers.enabled=false and groupSSO.enabled=true', async function () {
|
|
|
|
|
- renderWithSubscriptionDashContext(<ManagedGroupSubscriptions />, {
|
|
|
|
|
- metaTags: [
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-managedGroupSubscriptions',
|
|
|
|
|
- value: managedGroupSubscriptions3,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-groupSettingsEnabledFor',
|
|
|
|
|
- value: [managedGroupSubscriptions3[0]._id],
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- })
|
|
|
|
|
- await screen.findAllByText('Configure and manage SSO')
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- it('with managedUsers.enabled=true and groupSSO.enabled=false', async function () {
|
|
|
|
|
- renderWithSubscriptionDashContext(<ManagedGroupSubscriptions />, {
|
|
|
|
|
- metaTags: [
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-managedGroupSubscriptions',
|
|
|
|
|
- value: managedGroupSubscriptions4,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-groupSettingsEnabledFor',
|
|
|
|
|
- value: [managedGroupSubscriptions4[0]._id],
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- })
|
|
|
|
|
- await screen.findAllByText('Turn on Managed Users')
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- it('with managedUsers.enabled=true and groupSSO.enabled=null', async function () {
|
|
|
|
|
- renderWithSubscriptionDashContext(<ManagedGroupSubscriptions />, {
|
|
|
|
|
- metaTags: [
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-managedGroupSubscriptions',
|
|
|
|
|
- value: managedGroupSubscriptions5,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-groupSettingsEnabledFor',
|
|
|
|
|
- value: [managedGroupSubscriptions5[0]._id],
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- })
|
|
|
|
|
- await screen.findAllByText('Turn on Managed Users')
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ it('renders Group SSO settings when the feature is null', async function () {
|
|
|
|
|
+ renderWithSubscriptionDashContext(<ManagedGroupSubscriptions />, {
|
|
|
|
|
+ metaTags: [
|
|
|
|
|
+ {
|
|
|
|
|
+ name: 'ol-managedGroupSubscriptions',
|
|
|
|
|
+ value: managedGroupSubscriptions5,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: 'ol-groupSettingsEnabledFor',
|
|
|
|
|
+ value: [managedGroupSubscriptions5[0]._id],
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
})
|
|
})
|
|
|
|
|
+ await screen.findAllByText('Manage group settings')
|
|
|
|
|
+ await screen.findAllByText('Configure and manage SSO and Managed Users')
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- describe('with group SSO on by default', function () {
|
|
|
|
|
- it('renders the Manage group settings row when features are turned on', async function () {
|
|
|
|
|
- renderWithSubscriptionDashContext(<ManagedGroupSubscriptions />, {
|
|
|
|
|
- metaTags: [
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-managedGroupSubscriptions',
|
|
|
|
|
- value: managedGroupSubscriptions2,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-groupSettingsEnabledFor',
|
|
|
|
|
- value: [managedGroupSubscriptions2[0]._id],
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-ExposedSettings',
|
|
|
|
|
- value: {
|
|
|
|
|
- groupSSOEnabled: true,
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- })
|
|
|
|
|
- await screen.findAllByText('Manage group settings')
|
|
|
|
|
- await screen.findAllByText('Configure and manage SSO and Managed Users')
|
|
|
|
|
|
|
+ it('does not render Group SSO settings when the feature is turned off', async function () {
|
|
|
|
|
+ renderWithSubscriptionDashContext(<ManagedGroupSubscriptions />, {
|
|
|
|
|
+ metaTags: [
|
|
|
|
|
+ {
|
|
|
|
|
+ name: 'ol-managedGroupSubscriptions',
|
|
|
|
|
+ value: managedGroupSubscriptions4,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: 'ol-groupSettingsEnabledFor',
|
|
|
|
|
+ value: [managedGroupSubscriptions4[0]._id],
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
})
|
|
})
|
|
|
|
|
+ await screen.findAllByText('Manage group settings')
|
|
|
|
|
+ await screen.findAllByText('Turn on Managed Users')
|
|
|
|
|
+ expect(screen.queryByText('Configure and manage SSO and Managed Users')).to
|
|
|
|
|
+ .not.exist
|
|
|
|
|
+ expect(screen.queryByText('Configure and manage SSO')).to.not.exist
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- describe('renders the the correct subText for Manage Group settings row', async function () {
|
|
|
|
|
- it('with managedUsers.enabled=true and groupSSO.enabled=true', async function () {
|
|
|
|
|
- renderWithSubscriptionDashContext(<ManagedGroupSubscriptions />, {
|
|
|
|
|
- metaTags: [
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-managedGroupSubscriptions',
|
|
|
|
|
- value: managedGroupSubscriptions2,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-groupSettingsEnabledFor',
|
|
|
|
|
- value: [managedGroupSubscriptions2[0]._id],
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-ExposedSettings',
|
|
|
|
|
- value: {
|
|
|
|
|
- groupSSOEnabled: true,
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- })
|
|
|
|
|
- await screen.findAllByText('Configure and manage SSO and Managed Users')
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- it('with managedUsers.enabled=false and groupSSO.enabled=true', async function () {
|
|
|
|
|
- renderWithSubscriptionDashContext(<ManagedGroupSubscriptions />, {
|
|
|
|
|
- metaTags: [
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-managedGroupSubscriptions',
|
|
|
|
|
- value: managedGroupSubscriptions3,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-groupSettingsEnabledFor',
|
|
|
|
|
- value: [managedGroupSubscriptions3[0]._id],
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-ExposedSettings',
|
|
|
|
|
- value: {
|
|
|
|
|
- groupSSOEnabled: true,
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- })
|
|
|
|
|
- await screen.findAllByText('Configure and manage SSO')
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- it('with managedUsers.enabled=true and groupSSO.enabled=false', async function () {
|
|
|
|
|
- renderWithSubscriptionDashContext(<ManagedGroupSubscriptions />, {
|
|
|
|
|
- metaTags: [
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-managedGroupSubscriptions',
|
|
|
|
|
- value: managedGroupSubscriptions4,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-groupSettingsEnabledFor',
|
|
|
|
|
- value: [managedGroupSubscriptions4[0]._id],
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-ExposedSettings',
|
|
|
|
|
- value: {
|
|
|
|
|
- groupSSOEnabled: true,
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- })
|
|
|
|
|
- await screen.findAllByText('Turn on Managed Users')
|
|
|
|
|
- })
|
|
|
|
|
-
|
|
|
|
|
- it('with managedUsers.enabled=true and groupSSO.enabled=null', async function () {
|
|
|
|
|
- renderWithSubscriptionDashContext(<ManagedGroupSubscriptions />, {
|
|
|
|
|
- metaTags: [
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-managedGroupSubscriptions',
|
|
|
|
|
- value: managedGroupSubscriptions5,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-groupSettingsEnabledFor',
|
|
|
|
|
- value: [managedGroupSubscriptions5[0]._id],
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: 'ol-ExposedSettings',
|
|
|
|
|
- value: {
|
|
|
|
|
- groupSSOEnabled: true,
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- })
|
|
|
|
|
- await screen.findAllByText('Configure and manage SSO and Managed Users')
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ it('does not render MAnaged Group settings when the feature is turned off', async function () {
|
|
|
|
|
+ renderWithSubscriptionDashContext(<ManagedGroupSubscriptions />, {
|
|
|
|
|
+ metaTags: [
|
|
|
|
|
+ {
|
|
|
|
|
+ name: 'ol-managedGroupSubscriptions',
|
|
|
|
|
+ value: managedGroupSubscriptions3,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: 'ol-groupSettingsEnabledFor',
|
|
|
|
|
+ value: [managedGroupSubscriptions3[0]._id],
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
})
|
|
})
|
|
|
|
|
+ await screen.findAllByText('Manage 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
|
|
|
|
|
+ .not.exist
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|