diff --git a/src/app/__tests__/forum.spec.tsx b/src/app/__tests__/forum.spec.tsx index e87292b0..a3c6f354 100644 --- a/src/app/__tests__/forum.spec.tsx +++ b/src/app/__tests__/forum.spec.tsx @@ -66,4 +66,21 @@ describe("Forum", () => { })); }); + it("deve realizar pesquisa com debounce", async () => { + const { getByPlaceholderText } = render(); + + // 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) + ); + }); + }); });