Skip to content

Commit

Permalink
fix failing tests for searchbar component
Browse files Browse the repository at this point in the history
  • Loading branch information
RitikJaiswal75 committed Jun 16, 2023
1 parent e6b4410 commit 883ae79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion __tests__/Unit/Components/Searchbar/searchbar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('test searchbar component', function () {

const searchBtn = screen.getByTestId('search_btn') as HTMLButtonElement;

fireEvent.change(input, { tatget: { value: '123' } });
fireEvent.change(input, { target: { value: '123' } });
fireEvent.click(searchBtn);

expect(splitNSearch).toBeCalledTimes(1);
Expand All @@ -46,6 +46,7 @@ describe('test searchbar component', function () {

const input = screen.getByTestId('searchbar_input') as HTMLInputElement;

fireEvent.change(input, { target: { value: '123' } });
fireEvent.keyDown(input, { key: 'Enter', code: 'Enter', charCode: 13 });

expect(splitNSearch).toBeCalledTimes(2);
Expand Down

0 comments on commit 883ae79

Please sign in to comment.