fciannella's picture
Added the healthcare example
2f49513
raw
history blame
469 Bytes
import { renderHook, act } from "@testing-library/react";
import useChatHistory from "../useChatHistory";
describe("useChatHistory", () => {
test("should add chat entries", () => {
const { result } = renderHook(() => useChatHistory());
act(() => {
result.current.add("Hello", "us");
});
expect(result.current.entries).toHaveLength(1);
expect(result.current.entries[0]).toEqual({
text: "Hello",
author: "us",
});
});
});