Skip to content

Commit

Permalink
test: fix host_isolation_exceptions integration tests selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
tkajtoch committed Nov 14, 2023
1 parent 9e212e7 commit 0e3ea13
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,28 +146,28 @@ describe('When on the host isolation exceptions entry form', () => {
});

it('should show policy as selected when user clicks on it', async () => {
userEvent.click(renderResult.getByTestId('perPolicy'));
userEvent.click(renderResult.getByTestId('hostIsolationExceptions-form-effectedPolicies-perPolicy'));
await clickOnEffectedPolicy(renderResult, testIdPrefix);

await expect(isEffectedPolicySelected(renderResult, testIdPrefix)).resolves.toBe(true);
});

it('should retain the previous policy selection when switching from per-policy to global', async () => {
// move to per-policy and select the first
userEvent.click(renderResult.getByTestId('perPolicy'));
userEvent.click(renderResult.getByTestId('hostIsolationExceptions-form-effectedPolicies-perPolicy'));
await clickOnEffectedPolicy(renderResult, testIdPrefix);

await expect(isEffectedPolicySelected(renderResult, testIdPrefix)).resolves.toBe(true);

// move back to global
userEvent.click(renderResult.getByTestId('globalPolicy'));
userEvent.click(renderResult.getByTestId('hostIsolationExceptions-form-effectedPolicies-global'));

expect(
renderResult.queryByTestId(`${testIdPrefix}-effectedPolicies-policiesSelectable`)
).toBeFalsy();

// move back to per-policy
userEvent.click(renderResult.getByTestId('perPolicy'));
userEvent.click(renderResult.getByTestId('hostIsolationExceptions-form-effectedPolicies-perPolicy'));
await expect(isEffectedPolicySelected(renderResult, testIdPrefix)).resolves.toBe(true);
});
});
Expand Down

0 comments on commit 0e3ea13

Please sign in to comment.