Skip to content

Commit 6ecae54

Browse files
committed
fix: add assert statement to verify the function call signature and fix test name
1 parent abba7cc commit 6ecae54

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/unit/handlers/onboardingExtension.test.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe("onboardingExtensionCommand", () => {
4646
expect(jsonResponse).toStrictEqual(mockJsonResponse);
4747
});
4848

49-
it("should call fetch", async () => {
49+
it("should call createOnboardingExtension", async () => {
5050
jest.spyOn(utils, "createOnboardingExtension");
5151
transformedArgsForOnboardingExtension.devObj.value = true;
5252
await onboardingExtensionCommand(
@@ -55,5 +55,17 @@ describe("onboardingExtensionCommand", () => {
5555
ctx
5656
);
5757
expect(utils.createOnboardingExtension).toHaveBeenCalledTimes(1);
58+
expect(utils.createOnboardingExtension).toHaveBeenCalledWith(
59+
{
60+
channelId: transformedArgsForOnboardingExtension.channelId,
61+
userId: transformedArgsForOnboardingExtension.userIdObj?.value,
62+
numberOfDays: Number(
63+
transformedArgsForOnboardingExtension.numberOfDaysObj.value
64+
),
65+
reason: transformedArgsForOnboardingExtension.reasonObj.value,
66+
discordId: discordId,
67+
},
68+
guildEnv
69+
);
5870
});
5971
});

0 commit comments

Comments
 (0)