Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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({
Expand All @@ -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();
Expand Down
Loading