@@ -2,9 +2,10 @@ import type { CustomPage } from '@clerk/shared/types';
22import { describe , expect , it } from 'vitest' ;
33
44import { bindCreateFixtures } from '@/test/create-fixtures' ;
5- import { render , screen , waitFor } from '@/test/utils' ;
5+ import { cleanup , render , screen , waitFor } from '@/test/utils' ;
66
77import { OrganizationProfile } from '../' ;
8+ import { OrganizationSelfServeSSOPage } from '../OrganizationSelfServeSSOPage' ;
89
910const { createFixtures } = bindCreateFixtures ( 'OrganizationProfile' ) ;
1011
@@ -494,7 +495,7 @@ describe('OrganizationProfile', () => {
494495 } ) ;
495496
496497 render ( < OrganizationProfile /> , { wrapper } ) ;
497- expect ( await screen . findByText ( 'Self-Serve SSO' ) ) . toBeDefined ( ) ;
498+ expect ( await screen . findByText ( 'Single Sign-On ( SSO) ' ) ) . toBeDefined ( ) ;
498499 } ) ;
499500
500501 it ( 'does not include SSO when disabled at the instance level' , async ( ) => {
@@ -514,7 +515,7 @@ describe('OrganizationProfile', () => {
514515 } ) ;
515516
516517 const { queryByText } = render ( < OrganizationProfile /> , { wrapper } ) ;
517- await waitFor ( ( ) => expect ( queryByText ( 'Self-Serve SSO' ) ) . toBeNull ( ) ) ;
518+ await waitFor ( ( ) => expect ( queryByText ( 'Single Sign-On ( SSO) ' ) ) . toBeNull ( ) ) ;
518519 } ) ;
519520
520521 it ( 'does not include SSO when the org has not opted in, even if the instance has it enabled' , async ( ) => {
@@ -534,10 +535,10 @@ describe('OrganizationProfile', () => {
534535 } ) ;
535536
536537 const { queryByText } = render ( < OrganizationProfile /> , { wrapper } ) ;
537- await waitFor ( ( ) => expect ( queryByText ( 'Self-Serve SSO' ) ) . toBeNull ( ) ) ;
538+ await waitFor ( ( ) => expect ( queryByText ( 'Single Sign-On ( SSO) ' ) ) . toBeNull ( ) ) ;
538539 } ) ;
539540
540- it ( 'includes SSO even when the user does not have the manage enterprise connections permission' , async ( ) => {
541+ it ( 'includes SSO even when the user does not have the manage enterprise connections permission, but the page surfaces a warning ' , async ( ) => {
541542 const { wrapper } = await createFixtures ( f => {
542543 f . withEnterpriseSso ( { selfServeSSO : true } ) ;
543544 f . withOrganizations ( ) ;
@@ -553,9 +554,15 @@ describe('OrganizationProfile', () => {
553554 } ) ;
554555 } ) ;
555556
556- // TODO -> Add assertions for page content warning
557557 render ( < OrganizationProfile /> , { wrapper } ) ;
558- expect ( await screen . findByText ( 'Self-Serve SSO' ) ) . toBeDefined ( ) ;
558+ expect ( await screen . findByText ( 'Single Sign-On (SSO)' ) ) . toBeDefined ( ) ;
559+
560+ cleanup ( ) ;
561+ render ( < OrganizationSelfServeSSOPage /> , { wrapper } ) ;
562+ expect ( await screen . findByText ( / y o u d o n o t h a v e p e r m i s s i o n t o m a n a g e e n t e r p r i s e c o n n e c t i o n s / i) ) . toBeDefined ( ) ;
563+ expect (
564+ screen . queryByText ( / c o n t a c t y o u r o r g a n i z a t i o n a d m i n i s t r a t o r i n o r d e r t o h a v e p e r m i s s i o n s / i) ,
565+ ) . toBeInTheDocument ( ) ;
559566 } ) ;
560567 } ) ;
561568
0 commit comments