diff --git a/plugins/search/src/components/SearchModal/SearchModal.test.tsx b/plugins/search/src/components/SearchModal/SearchModal.test.tsx
index d3b2a825e2..9b3f04ad46 100644
--- a/plugins/search/src/components/SearchModal/SearchModal.test.tsx
+++ b/plugins/search/src/components/SearchModal/SearchModal.test.tsx
@@ -68,7 +68,7 @@ describe('SearchModal', () => {
);
expect(query).toHaveBeenCalledTimes(1);
- userEvent.keyboard('{esc}');
+ await userEvent.keyboard('{Escape}');
expect(toggleModal).toHaveBeenCalledTimes(1);
});
diff --git a/plugins/search/src/components/SearchType/SearchType.Accordion.test.tsx b/plugins/search/src/components/SearchType/SearchType.Accordion.test.tsx
index 1aae64c463..a62d061663 100644
--- a/plugins/search/src/components/SearchType/SearchType.Accordion.test.tsx
+++ b/plugins/search/src/components/SearchType/SearchType.Accordion.test.tsx
@@ -78,19 +78,19 @@ describe('SearchType.Accordion', () => {
await act(() => Promise.resolve());
});
- it('should set entire types array when a type is selected', () => {
+ it('should set entire types array when a type is selected', async () => {
const { getByText } = render(
,
);
- user.click(getByText(expectedType.name));
+ await user.click(getByText(expectedType.name));
expect(contextSpy.setTypes).toHaveBeenCalledWith([expectedType.value]);
});
- it('should reset types array when all is selected', () => {
+ it('should reset types array when all is selected', async () => {
const { getByText } = render(
{
,
);
- user.click(getByText('All'));
+ await user.click(getByText('All'));
expect(contextSpy.setTypes).toHaveBeenCalledWith([]);
});
- it('should reset page cursor when a new type is selected', () => {
+ it('should reset page cursor when a new type is selected', async () => {
const { getByText } = render(
,
);
- user.click(getByText(expectedType.name));
+ await user.click(getByText(expectedType.name));
expect(contextSpy.setPageCursor).toHaveBeenCalledWith(undefined);
});
- it('should collapse when a new type is selected', () => {
+ it('should collapse when a new type is selected', async () => {
const { getByText, queryByText } = render(
,
);
- user.click(getByText(expectedType.name));
+ await user.click(getByText(expectedType.name));
expect(queryByText('Collapse')).not.toBeInTheDocument();
});
diff --git a/plugins/search/src/components/SearchType/SearchType.Tabs.test.tsx b/plugins/search/src/components/SearchType/SearchType.Tabs.test.tsx
index 741ee6e83f..2886b63ae7 100644
--- a/plugins/search/src/components/SearchType/SearchType.Tabs.test.tsx
+++ b/plugins/search/src/components/SearchType/SearchType.Tabs.test.tsx
@@ -70,19 +70,19 @@ describe('SearchType.Tabs', () => {
await act(() => Promise.resolve());
});
- it('should set entire types array when a type is selected', () => {
+ it('should set entire types array when a type is selected', async () => {
const { getByText } = render(
,
);
- user.click(getByText(expectedType.name));
+ await user.click(getByText(expectedType.name));
expect(contextSpy.setTypes).toHaveBeenCalledWith([expectedType.value]);
});
- it('should reset types array when all is selected', () => {
+ it('should reset types array when all is selected', async () => {
const { getByText } = render(
{
,
);
- user.click(getByText('All'));
+ await user.click(getByText('All'));
expect(contextSpy.setTypes).toHaveBeenCalledWith([]);
});
- it('should reset page cursor when a new type is selected', () => {
+ it('should reset page cursor when a new type is selected', async () => {
const { getByText } = render(
,
);
- user.click(getByText(expectedType.name));
+ await user.click(getByText(expectedType.name));
expect(contextSpy.setPageCursor).toHaveBeenCalledWith(undefined);
});