refactor: apply review suggestions

Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
Camila Belo
2022-08-29 15:07:18 +02:00
parent 18f60427f2
commit ca8d5a6eae
16 changed files with 684 additions and 968 deletions
@@ -55,7 +55,7 @@ describe('SearchModal', () => {
);
expect(screen.getByRole('dialog')).toBeInTheDocument();
expect(query).toHaveBeenCalledTimes(2);
expect(query).toHaveBeenCalledTimes(1);
});
it('Should use parent search context if defined', async () => {
@@ -133,7 +133,7 @@ describe('SearchModal', () => {
},
);
expect(query).toHaveBeenCalledTimes(2);
expect(query).toHaveBeenCalledTimes(1);
await userEvent.keyboard('{Escape}');
expect(toggleModal).toHaveBeenCalledTimes(1);
});
@@ -194,7 +194,7 @@ export const SearchModal = ({
hidden={hidden}
>
{open && (
<SearchContextProvider useParentContext>
<SearchContextProvider inheritParentContextIfAvailable>
{(children && children({ toggleModal })) ?? (
<Modal toggleModal={toggleModal} />
)}