mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
[ResponseOps][MaintenanceWindows] Fix flaky rules list MW callout test (#216270)
## Summary Attempts to fix the flakyness of #203179 by waiting for the mocked request to complete instead of the text finder to timeout. Timing analysis shows a reduction from `~4000ms` down to just `~70ms` of wait time for the final assertion. ## References Closes #203179
This commit is contained in:
parent
f1c61e43b0
commit
f49688f227
1 changed files with 5 additions and 7 deletions
|
@ -1382,8 +1382,7 @@ describe('rules_list with show only capability', () => {
|
|||
});
|
||||
});
|
||||
|
||||
// FLAKY: https://github.com/elastic/kibana/issues/203179
|
||||
describe.skip('MaintenanceWindowsMock', () => {
|
||||
describe('MaintenanceWindowsMock', () => {
|
||||
beforeEach(() => {
|
||||
fetchActiveMaintenanceWindowsMock.mockResolvedValue([]);
|
||||
|
||||
|
@ -1456,11 +1455,10 @@ describe.skip('MaintenanceWindowsMock', () => {
|
|||
|
||||
renderWithProviders(<RulesList />);
|
||||
|
||||
await expect(
|
||||
screen.findByText('Rule notifications are stopped while maintenance windows are running.')
|
||||
).rejects.toThrow();
|
||||
|
||||
expect(fetchActiveMaintenanceWindowsMock).toHaveBeenCalledTimes(1);
|
||||
await waitFor(() => expect(fetchActiveMaintenanceWindowsMock).toHaveBeenCalledTimes(1));
|
||||
expect(
|
||||
screen.queryByText('Rule notifications are stopped while maintenance windows are running.')
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('shows MaintenanceWindowCallout for a specific category', async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue