test(dashboard): eliminate race condition in FiltersConfigModal test (#35717)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Joe Li
2025-10-22 14:56:17 -07:00
committed by GitHub
parent 1234533c67
commit d09421230b

View File

@@ -337,19 +337,21 @@ test.skip('validates the default value', async () => {
test('validates the pre-filter value', async () => {
jest.useFakeTimers();
try {
defaultRender();
defaultRender();
await userEvent.click(screen.getByText(FILTER_SETTINGS_REGEX));
await userEvent.click(getCheckbox(PRE_FILTER_REGEX));
userEvent.click(screen.getByText(FILTER_SETTINGS_REGEX));
userEvent.click(getCheckbox(PRE_FILTER_REGEX));
jest.runAllTimers();
} finally {
jest.useRealTimers();
}
jest.runOnlyPendingTimers();
jest.useRealTimers();
expect(
await screen.findByText(PRE_FILTER_REQUIRED_REGEX),
).toBeInTheDocument();
}, 50000); // Slow-running test, increase timeout to 50 seconds.
await waitFor(() => {
expect(screen.getByText(PRE_FILTER_REQUIRED_REGEX)).toBeInTheDocument();
});
});
// eslint-disable-next-line jest/no-disabled-tests
test.skip("doesn't render time range pre-filter if there are no temporal columns in datasource", async () => {