Skip to content

Commit 23622bf

Browse files
fix: test cae
1 parent 041835a commit 23622bf

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

src/visualBuilder/components/Collab/ThreadPopup/__test__/CommentResolvedText.test.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,9 @@ const mockComment = {
4343
describe("CommentResolvedText", () => {
4444
it("should render the sanitized comment with display names", () => {
4545
// Mock the return value of getMessageWithDisplayName
46+
const sanitizedHtml = "Hello <b>@John Doe</b>";
4647
(getMessageWithDisplayName as unknown as Mock).mockReturnValue(
47-
"Hello <b>@John Doe</b>"
48-
);
49-
50-
// Mock the return value of sanitizeData
51-
(sanitizeData as unknown as Mock).mockReturnValue(
52-
"Hello <b>@John Doe</b>"
48+
sanitizedHtml
5349
);
5450

5551
// Render the component with mock props
@@ -67,14 +63,11 @@ describe("CommentResolvedText", () => {
6763
"html"
6864
);
6965

70-
// Expect sanitizeData to have been called with the correct text
71-
expect(sanitizeData).toHaveBeenCalledWith("Hello <b>@John Doe</b>");
72-
7366
// Verify the component renders the sanitized HTML correctly
7467
const messageElement = screen.getByTestId(
7568
"collab-thread-comment--message"
7669
);
7770
expect(messageElement).toBeInTheDocument();
78-
expect(messageElement.innerHTML).toBe("Hello <b>@John Doe</b>");
71+
expect(messageElement.innerHTML).toBe(sanitizedHtml);
7972
});
8073
});

0 commit comments

Comments
 (0)