refactor: apply review suggestions
Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
@@ -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} />
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user