diff --git a/test/resolvers/MutationResolverTests.test.ts b/test/resolvers/MutationResolverTests.test.ts index f7342fd..72f4c9f 100644 --- a/test/resolvers/MutationResolverTests.test.ts +++ b/test/resolvers/MutationResolverTests.test.ts @@ -17,7 +17,7 @@ describe("MutationResolvers", () => { scheduleNotification(input: $input) { success message - notification { + data { deviceId shuttleId stopId @@ -48,9 +48,9 @@ describe("MutationResolvers", () => { assert(response.body.kind === "single"); expect(response.body.singleResult.errors).toBeUndefined(); - const returnedData = response.body.singleResult.data; - expect(returnedData?.success).toBe(true); - expect(returnedData?.notification).toStrictEqual(notificationInput); + const notificationResponse = response.body.singleResult.data?.scheduleNotification as any; + expect(notificationResponse?.success).toBe(true); + expect(notificationResponse?.notification).toStrictEqual(notificationInput); }); it("fails if the shuttle ID doesn't exist", async () => { @@ -73,7 +73,8 @@ describe("MutationResolvers", () => { assert(response.body.kind === "single"); expect(response.body.singleResult.errors).toBeUndefined(); - expect(response.body.singleResult.data?.success).toBe(false); + const notificationResponse = response.body.singleResult.data?.scheduleNotification as any; + expect(notificationResponse.success).toBe(false); }); it("fails if the stop ID doesn't exist", async () => {