From f2289bd73379e51349de5b2ea291a9fadf818dae Mon Sep 17 00:00:00 2001 From: Jiayuan Date: Tue, 31 Mar 2026 17:04:29 +0800 Subject: [PATCH] fix(test): make createComment assertion resilient to trailing undefined args On CI (Node 22 / ubuntu), mockCreateComment receives extra undefined args. Check only the first two positional args instead of exact match. --- apps/web/app/(dashboard)/issues/[id]/page.test.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/web/app/(dashboard)/issues/[id]/page.test.tsx b/apps/web/app/(dashboard)/issues/[id]/page.test.tsx index 8e27d5e1..54acedfd 100644 --- a/apps/web/app/(dashboard)/issues/[id]/page.test.tsx +++ b/apps/web/app/(dashboard)/issues/[id]/page.test.tsx @@ -331,10 +331,10 @@ describe("IssueDetailPage", () => { await user.click(submitBtn); await waitFor(() => { - expect(mockCreateComment).toHaveBeenCalledWith( - "issue-1", - "New test comment", - ); + expect(mockCreateComment).toHaveBeenCalled(); + const [issueId, content] = mockCreateComment.mock.calls[0]!; + expect(issueId).toBe("issue-1"); + expect(content).toBe("New test comment"); }); await waitFor(() => {