mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
add second test if shuttle ID doesn't exist in repository
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user