Skip to content

Commit

Permalink
fix: update BookList test to support new search approach
Browse files Browse the repository at this point in the history
  • Loading branch information
amalv committed Dec 22, 2023
1 parent e81dfa1 commit 8ce1e34
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/BookList/BookList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("BookList", () => {

expect(mockBooks).toHaveBeenCalledWith(
expect.objectContaining({
title: "", // Initial debouncedSearch value
search: "", // Initial debouncedSearch value
limit: 50,
})
);
Expand All @@ -29,7 +29,7 @@ describe("BookList", () => {
render(<BookList />);

// Simulate user input to the SearchInput component
fireEvent.change(screen.getByLabelText("Search by title"), {
fireEvent.change(screen.getByLabelText("Search by title or author"), {
target: { value: "New search value" },
});

Expand All @@ -39,7 +39,7 @@ describe("BookList", () => {
// Check that the Books component was called with the updated debouncedSearch value
expect(mockBooks).toHaveBeenCalledWith(
expect.objectContaining({
title: "New search value",
search: "New search value",
})
);
});
Expand Down

0 comments on commit 8ce1e34

Please sign in to comment.