diff --git a/test/resolvers/MutationResolverTests.test.ts b/test/resolvers/MutationResolverTests.test.ts index 9e8b887..f7342fd 100644 --- a/test/resolvers/MutationResolverTests.test.ts +++ b/test/resolvers/MutationResolverTests.test.ts @@ -41,6 +41,8 @@ describe("MutationResolvers", () => { variables: { input: notificationInput, } + }, { + contextValue: context, }); assert(response.body.kind === "single"); @@ -52,7 +54,26 @@ describe("MutationResolvers", () => { }); it("fails if the shuttle ID doesn't exist", async () => { + const system = await addMockSystemToRepository(context.repository); + const stop = await addMockStopToRepository(context.repository, system.id); + const notificationInput = { + deviceId: "1", + shuttleId: "1", + stopId: stop.id, + } + const response = await holder.testServer.executeOperation({ + query, + variables: { + input: notificationInput, + } + }, { + contextValue: context + }); + + assert(response.body.kind === "single"); + expect(response.body.singleResult.errors).toBeUndefined(); + expect(response.body.singleResult.data?.success).toBe(false); }); it("fails if the stop ID doesn't exist", async () => {