diff --git a/tests/components/SpellCheck.test.tsx b/tests/components/SpellCheck.test.tsx index e9e655ee..addb1947 100644 --- a/tests/components/SpellCheck.test.tsx +++ b/tests/components/SpellCheck.test.tsx @@ -49,29 +49,29 @@ describe('SpellCheck', () => { expect(label).toEqual(mockedState.spellCheck?.correctedQuery); }); - // it('Fires onClick when provided', async () => { - // const props = { - // onClick: jest.fn() - // }; - // const onClick = jest.spyOn(props, 'onClick'); - // const actions = spyOnActions(); + it('Fires onClick when provided', async () => { + const props = { + onClick: jest.fn() + }; + const onClick = jest.spyOn(props, 'onClick'); + const actions = spyOnActions(); - // render(); - // await userEvent.click(screen.getByRole('button')); + render(); + await userEvent.click(screen.getByRole('button')); - // const verticalKey = mockedState.vertical?.verticalKey; - // const correctedQuery = mockedState.spellCheck?.correctedQuery; - // expect(actions.setQuery).toHaveBeenCalledWith(correctedQuery); - // expect(onClick).toHaveBeenCalledWith({ correctedQuery, verticalKey }); - // }); + const verticalKey = mockedState.vertical?.verticalKey; + const correctedQuery = mockedState.spellCheck?.correctedQuery; + expect(actions.setQuery).toHaveBeenCalledWith(correctedQuery); + expect(onClick).toHaveBeenCalledWith({ correctedQuery, verticalKey }); + }); - // it('Fires executeSearch when no onClick is provided', async () => { - // const actions = spyOnActions(); - // render(); - // await userEvent.click(screen.getByRole('button')); + it('Fires executeSearch when no onClick is provided', async () => { + const actions = spyOnActions(); + render(); + await userEvent.click(screen.getByRole('button')); - // const correctedQuery = mockedState.spellCheck?.correctedQuery; - // expect(actions.setQuery).toHaveBeenCalledWith(correctedQuery); - // expect(actions.executeVerticalQuery).toHaveBeenCalledTimes(1); - // }); + const correctedQuery = mockedState.spellCheck?.correctedQuery; + expect(actions.setQuery).toHaveBeenCalledWith(correctedQuery); + expect(actions.executeVerticalQuery).toHaveBeenCalledTimes(1); + }); });