Skip to content

Commit

Permalink
test: search with debounce
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielSMonteiro committed Sep 19, 2024
1 parent 4c973a0 commit 439052f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/app/__tests__/forum.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,21 @@ describe("Forum", () => {
}));
});

it("deve realizar pesquisa com debounce", async () => {
const { getByPlaceholderText } = render(<Forum />);

// Alterar para o placeholder correto
const searchInput = getByPlaceholderText("Pesquise uma publicação");

fireEvent.changeText(searchInput, "");

// Aguarda o debounce
await waitFor(() => {
expect(getAllPublicacao).toHaveBeenCalledWith(
0,
{ titulo: "", isReported: false },
expect.any(Object)
);
});
});
});

0 comments on commit 439052f

Please sign in to comment.