add second test if shuttle ID doesn't exist in repository

This commit is contained in:
2025-02-04 11:19:58 -08:00
parent 0b9759aff1
commit 5687f7f600

View File

@@ -41,6 +41,8 @@ describe("MutationResolvers", () => {
variables: { variables: {
input: notificationInput, input: notificationInput,
} }
}, {
contextValue: context,
}); });
assert(response.body.kind === "single"); assert(response.body.kind === "single");
@@ -52,7 +54,26 @@ describe("MutationResolvers", () => {
}); });
it("fails if the shuttle ID doesn't exist", async () => { 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 () => { it("fails if the stop ID doesn't exist", async () => {