Skip to content

Commit 58ff99b

Browse files
fix: also the onClose test
Made-with: Cursor
1 parent fea44f9 commit 58ff99b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

static/app/views/dashboards/widgetBuilder/buildSteps/filterResultsStep/spansSearchBar.spec.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,7 @@ describe('SpansSearchBar', () => {
152152
});
153153
});
154154

155-
// TODO(nikki): Flaky test
156-
// eslint-disable-next-line jest/no-disabled-tests
157-
it.skip('triggers onClose when the query changes', async () => {
155+
it('triggers onClose when the query changes', async () => {
158156
const onClose = jest.fn();
159157

160158
renderWithProvider({
@@ -166,11 +164,15 @@ describe('SpansSearchBar', () => {
166164
const searchInput = await screen.findByRole('combobox', {
167165
name: 'Add a search term',
168166
});
167+
await userEvent.click(searchInput);
169168
await userEvent.type(searchInput, 'span.op:');
170169
await userEvent.keyboard('{enter}');
171170
await userEvent.keyboard('function');
172171
await userEvent.keyboard('{enter}');
173172

173+
// Wait for the filter token to be created before typing the value
174+
await screen.findByRole('row', {name: /span\.op/});
175+
174176
await waitFor(() => {
175177
expect(onClose).toHaveBeenCalled();
176178
});

0 commit comments

Comments
 (0)