Skip to content

Commit

Permalink
test lazy markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Fred Lefévère-Laoide authored and Fred Lefévère-Laoide committed Sep 19, 2024
1 parent b082024 commit 2a49862
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/taipy-gui/src/components/Taipy/Chat.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

import React from "react";
import { render } from "@testing-library/react";
import { render, waitFor } from "@testing-library/react";
import "@testing-library/jest-dom";
import userEvent from "@testing-library/user-event";

Expand Down Expand Up @@ -77,8 +77,8 @@ describe("Chat Component", () => {
});
it("renders markdown by default", async () => {
render(<Chat messages={messages} className="taipy-chat" defaultKey={valueKey} />);
const elt = document.querySelector(".taipy-chat .taipy-chat-received .MuiPaper-root p");
expect(elt).toBeInTheDocument()
const elt = document.querySelector(".taipy-chat .taipy-chat-received .MuiPaper-root");
await waitFor(() => expect(elt?.querySelector("p")).not.toBeNull());
});
it("can render pre", async () => {
render(<Chat messages={messages} className="taipy-chat" defaultKey={valueKey} mode="pre" />);
Expand Down

0 comments on commit 2a49862

Please sign in to comment.