mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[ResponseOps][Cases] SyncAlertsToggle
flaky test (#201534)
## Summary The test failed again after the last fix. I added `within` to try and improve the time of the dom traversals in the failing test.
This commit is contained in:
parent
99eb6823e6
commit
e4d32fd527
1 changed files with 8 additions and 7 deletions
|
@ -33,9 +33,10 @@ describe('SyncAlertsToggle', () => {
|
|||
</FormTestComponent>
|
||||
);
|
||||
|
||||
expect(await screen.findByTestId('caseSyncAlerts')).toBeInTheDocument();
|
||||
expect(await screen.findByRole('switch')).toHaveAttribute('aria-checked', 'true');
|
||||
expect(await screen.findByText('On')).toBeInTheDocument();
|
||||
const syncAlerts = await screen.findByTestId('caseSyncAlerts');
|
||||
expect(syncAlerts).toBeInTheDocument();
|
||||
expect(within(syncAlerts).getByRole('switch')).toHaveAttribute('aria-checked', 'true');
|
||||
expect(within(syncAlerts).getByText('On')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('it toggles the switch', async () => {
|
||||
|
@ -45,9 +46,9 @@ describe('SyncAlertsToggle', () => {
|
|||
</FormTestComponent>
|
||||
);
|
||||
|
||||
const synAlerts = await screen.findByTestId('caseSyncAlerts');
|
||||
const syncAlerts = await screen.findByTestId('caseSyncAlerts');
|
||||
|
||||
await userEvent.click(within(synAlerts).getByRole('switch'));
|
||||
await userEvent.click(within(syncAlerts).getByRole('switch'));
|
||||
|
||||
expect(await screen.findByRole('switch')).toHaveAttribute('aria-checked', 'false');
|
||||
expect(await screen.findByText('Off')).toBeInTheDocument();
|
||||
|
@ -60,9 +61,9 @@ describe('SyncAlertsToggle', () => {
|
|||
</FormTestComponent>
|
||||
);
|
||||
|
||||
const synAlerts = await screen.findByTestId('caseSyncAlerts');
|
||||
const syncAlerts = await screen.findByTestId('caseSyncAlerts');
|
||||
|
||||
await userEvent.click(within(synAlerts).getByRole('switch'));
|
||||
await userEvent.click(within(syncAlerts).getByRole('switch'));
|
||||
|
||||
await userEvent.click(await screen.findByText('Submit'));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue