Skip to content

Commit c21c4e8

Browse files
committed
chore: review comments
1 parent fbb64a3 commit c21c4e8

1 file changed

Lines changed: 43 additions & 14 deletions

File tree

packages/react/src/components/auth0/my-organization/__tests__/sso-provider-edit.test.tsx

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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(/mappings.title/i)).not.toBeInTheDocument();
488+
expect(screen.queryByText(/mappings.title/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(/mappings.title/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(/mappings.title/i)).toBeInTheDocument();
520+
const provisioningTab = screen.getByText(/tabs.provisioning.name/i);
521+
await user.click(provisioningTab);
522+
523+
await waitFor(() => {
524+
expect(screen.queryByText(/mappings.title/i)).not.toBeInTheDocument();
525+
});
526+
});
498527
});
499528
});
500529
});

0 commit comments

Comments
 (0)