diff --git a/static/app/views/dashboards/widgetBuilder/buildSteps/filterResultsStep/spansSearchBar.spec.tsx b/static/app/views/dashboards/widgetBuilder/buildSteps/filterResultsStep/spansSearchBar.spec.tsx index 976a90cfdd514a..edd8213bd23ebc 100644 --- a/static/app/views/dashboards/widgetBuilder/buildSteps/filterResultsStep/spansSearchBar.spec.tsx +++ b/static/app/views/dashboards/widgetBuilder/buildSteps/filterResultsStep/spansSearchBar.spec.tsx @@ -134,9 +134,10 @@ describe('SpansSearchBar', () => { const searchInput = await screen.findByRole('combobox', { name: 'Add a search term', }); + await userEvent.click(searchInput); await userEvent.type(searchInput, 'span.op:', {delay: null}); await userEvent.keyboard('function', {delay: null}); - await userEvent.keyboard('{enter}'); + await userEvent.keyboard('{enter}', {delay: null}); await waitFor(() => { expect(onSearch).toHaveBeenCalledWith( @@ -146,9 +147,7 @@ describe('SpansSearchBar', () => { }); }); - // TODO(nikki): Flaky test - // eslint-disable-next-line jest/no-disabled-tests - it.skip('triggers onClose when the query changes', async () => { + it('triggers onClose when the query changes', async () => { const onClose = jest.fn(); renderWithProvider({ @@ -160,10 +159,12 @@ describe('SpansSearchBar', () => { const searchInput = await screen.findByRole('combobox', { name: 'Add a search term', }); - await userEvent.type(searchInput, 'span.op:'); - await userEvent.keyboard('{enter}'); - await userEvent.keyboard('function'); - await userEvent.keyboard('{enter}'); + await userEvent.click(searchInput); + await userEvent.type(searchInput, 'span.op:', {delay: null}); + await userEvent.keyboard('{enter}', {delay: null}); + await screen.findByRole('row', {name: /span\.op/}); + await userEvent.keyboard('function', {delay: null}); + await userEvent.keyboard('{enter}', {delay: null}); await waitFor(() => { expect(onClose).toHaveBeenCalled();