diff --git a/static/app/views/dashboardsV2/widgetBuilder/buildSteps/filterResultsStep/index.tsx b/static/app/views/dashboardsV2/widgetBuilder/buildSteps/filterResultsStep/index.tsx index d6ada1faf86a..8a2b9ad5d47f 100644 --- a/static/app/views/dashboardsV2/widgetBuilder/buildSteps/filterResultsStep/index.tsx +++ b/static/app/views/dashboardsV2/widgetBuilder/buildSteps/filterResultsStep/index.tsx @@ -73,17 +73,20 @@ export function FilterResultsStep({ }; }, []); - const handleBlur = useCallback((queryIndex: number) => { - return (field: string) => { - if (!blurTimeoutRef.current) { - const newQuery: WidgetQuery = { - ...queries[queryIndex], - conditions: field, - }; - onQueryChange(queryIndex, newQuery); - } - }; - }, []); + const handleBlur = useCallback( + (queryIndex: number) => { + return (field: string) => { + if (!blurTimeoutRef.current) { + const newQuery: WidgetQuery = { + ...queries[queryIndex], + conditions: field, + }; + onQueryChange(queryIndex, newQuery); + } + }; + }, + [queries] + ); return ( { + // Run all timers because the handleBlur contains a setTimeout + jest.runAllTimers(); + }); + }); + describe('Sort by selectors', function () { it('renders', async function () { renderTestComponent({