Skip to content

Commit

Permalink
Fix frontend unit test (#1958)
Browse files Browse the repository at this point in the history
Signed-off-by: Cintia Sanchez Garcia <[email protected]>
  • Loading branch information
cynthia-sg authored May 10, 2022
1 parent de575d7 commit 50e20f9
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -460,11 +460,9 @@ describe('Authorization settings index', () => {
expect(API.getAllOrganizationMembers).toHaveBeenCalledWith('orgTest');
});

const switchBtn = await screen.findByText('Fine-grained access control');
await userEvent.click(switchBtn);
await userEvent.click(await screen.findByText('Fine-grained access control'));

const btn = await screen.findByRole('button', { name: 'Update authorization policy' });
await userEvent.click(btn);
await userEvent.click(await screen.findByRole('button', { name: 'Update authorization policy' }));

rerender(component);

Expand All @@ -482,9 +480,7 @@ describe('Authorization settings index', () => {
await screen.findByText('You do not have permissions to update the policy from the organization.')
).toBeInTheDocument();

waitFor(() => {
expect(switchBtn).toBeDisabled();
});
expect(await screen.findByRole('switch')).toBeDisabled();
});

it('Custom error', async () => {
Expand Down

0 comments on commit 50e20f9

Please sign in to comment.