Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RAM] Try to fix flaky rules_list test - filter by rule state #150056

Merged
merged 10 commits into from
Feb 6, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,14 @@ describe('rules_list ', () => {
renderWithProviders(
<RulesList statusFilter={['disabled']} onStatusFilterChange={onStatusFilterChangeMock} />
);
await waitFor(() => screen.getByText('Rule state'));
await waitForElementToBeRemoved(() => screen.queryByTestId('centerJustifiedSpinner'));
expect(loadRulesWithKueryFilter).toHaveBeenLastCalledWith(
expect.objectContaining({
ruleStatusesFilter: ['disabled'],
})
);

fireEvent.click(screen.getAllByTestId('ruleStatusFilterButton')[0]);
fireEvent.click(screen.getAllByTestId('ruleStatusFilterOption-enabled')[0]);
fireEvent.click((await screen.findAllByTestId('ruleStatusFilterButton'))[0]);
fireEvent.click((await screen.findAllByTestId('ruleStatusFilterOption-enabled'))[0]);
expect(loadRulesWithKueryFilter).toHaveBeenLastCalledWith(
expect.objectContaining({
ruleStatusesFilter: ['disabled', 'enabled'],
Expand Down