@@ -474,27 +474,56 @@ describe('SsoProviderEdit', () => {
474474 } ) ;
475475
476476 describe ( 'hideAttributeMappings' , ( ) => {
477- describe ( 'when is true' , ( ) => {
478- it ( 'should not display attribute mappings section' , async ( ) => {
479- renderWithProviders (
480- < SsoProviderEdit { ...createMockSsoProviderEditProps ( { hideAttributeMappings : true } ) } /> ,
481- ) ;
477+ describe ( 'on SSO tab' , ( ) => {
478+ describe ( 'when is true' , ( ) => {
479+ it ( 'should not display attribute mappings section' , async ( ) => {
480+ renderWithProviders (
481+ < SsoProviderEdit
482+ { ...createMockSsoProviderEditProps ( { hideAttributeMappings : true } ) }
483+ /> ,
484+ ) ;
482485
483- await waitForComponentToLoad ( ) ;
486+ await waitForComponentToLoad ( ) ;
484487
485- expect ( screen . queryByText ( / m a p p i n g s .t i t l e / i) ) . not . toBeInTheDocument ( ) ;
488+ expect ( screen . queryByText ( / m a p p i n g s .t i t l e / i) ) . not . toBeInTheDocument ( ) ;
489+ } ) ;
490+ } ) ;
491+
492+ describe ( 'when is false' , ( ) => {
493+ it ( 'should display attribute mappings section' , async ( ) => {
494+ renderWithProviders (
495+ < SsoProviderEdit
496+ { ...createMockSsoProviderEditProps ( { hideAttributeMappings : false } ) }
497+ /> ,
498+ ) ;
499+
500+ await waitForComponentToLoad ( ) ;
501+
502+ expect ( screen . queryByText ( / m a p p i n g s .t i t l e / i) ) . toBeInTheDocument ( ) ;
503+ } ) ;
486504 } ) ;
487505 } ) ;
488506
489- describe ( 'when is false' , ( ) => {
490- it ( 'should display attribute mappings section' , async ( ) => {
491- renderWithProviders (
492- < SsoProviderEdit { ...createMockSsoProviderEditProps ( { hideAttributeMappings : false } ) } /> ,
493- ) ;
507+ describe ( 'on Provisioning tab' , ( ) => {
508+ describe ( 'when is true' , ( ) => {
509+ it ( 'should not display attribute mappings section' , async ( ) => {
510+ const user = userEvent . setup ( ) ;
494511
495- await waitForComponentToLoad ( ) ;
512+ renderWithProviders (
513+ < SsoProviderEdit
514+ { ...createMockSsoProviderEditProps ( { hideAttributeMappings : true } ) }
515+ /> ,
516+ ) ;
517+
518+ await waitForComponentToLoad ( ) ;
496519
497- expect ( screen . queryByText ( / m a p p i n g s .t i t l e / i) ) . toBeInTheDocument ( ) ;
520+ const provisioningTab = screen . getByText ( / t a b s .p r o v i s i o n i n g .n a m e / i) ;
521+ await user . click ( provisioningTab ) ;
522+
523+ await waitFor ( ( ) => {
524+ expect ( screen . queryByText ( / m a p p i n g s .t i t l e / i) ) . not . toBeInTheDocument ( ) ;
525+ } ) ;
526+ } ) ;
498527 } ) ;
499528 } ) ;
500529 } ) ;
0 commit comments