From 5b6771e857fa7c64febdcb8818037a2f77b2d0a6 Mon Sep 17 00:00:00 2001 From: iamanishx Date: Mon, 17 Feb 2025 11:37:02 +0000 Subject: [PATCH] ai fix --- test/routes/graphql/Mutation/deletecomment.test.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/routes/graphql/Mutation/deletecomment.test.ts b/test/routes/graphql/Mutation/deletecomment.test.ts index 4ab27cd1f6..c44ac249a5 100644 --- a/test/routes/graphql/Mutation/deletecomment.test.ts +++ b/test/routes/graphql/Mutation/deletecomment.test.ts @@ -296,11 +296,9 @@ describe("deleteCommentResolver", () => { await deleteCommentResolver({}, validArgs, ctx); expect(commentFindFirstSpy).toHaveBeenCalledTimes(1); - if (!commentFindFirstSpy.mock.calls[0]) { - throw new Error("Expected mock to have been called"); - } + expect(commentFindFirstSpy.mock.calls.length).toBeGreaterThan(0); const config = commentFindFirstSpy.mock - .calls[0][0] as CommentsFindFirstConfig; + .calls[0]?.[0] as CommentsFindFirstConfig; expect(config.columns).toEqual({ creatorId: true }); expect(typeof config.where).toBe("function");