mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
fix the resolver result
This commit is contained in:
@@ -17,7 +17,7 @@ describe("MutationResolvers", () => {
|
|||||||
scheduleNotification(input: $input) {
|
scheduleNotification(input: $input) {
|
||||||
success
|
success
|
||||||
message
|
message
|
||||||
notification {
|
data {
|
||||||
deviceId
|
deviceId
|
||||||
shuttleId
|
shuttleId
|
||||||
stopId
|
stopId
|
||||||
@@ -48,9 +48,9 @@ describe("MutationResolvers", () => {
|
|||||||
assert(response.body.kind === "single");
|
assert(response.body.kind === "single");
|
||||||
expect(response.body.singleResult.errors).toBeUndefined();
|
expect(response.body.singleResult.errors).toBeUndefined();
|
||||||
|
|
||||||
const returnedData = response.body.singleResult.data;
|
const notificationResponse = response.body.singleResult.data?.scheduleNotification as any;
|
||||||
expect(returnedData?.success).toBe(true);
|
expect(notificationResponse?.success).toBe(true);
|
||||||
expect(returnedData?.notification).toStrictEqual(notificationInput);
|
expect(notificationResponse?.notification).toStrictEqual(notificationInput);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("fails if the shuttle ID doesn't exist", async () => {
|
it("fails if the shuttle ID doesn't exist", async () => {
|
||||||
@@ -73,7 +73,8 @@ describe("MutationResolvers", () => {
|
|||||||
|
|
||||||
assert(response.body.kind === "single");
|
assert(response.body.kind === "single");
|
||||||
expect(response.body.singleResult.errors).toBeUndefined();
|
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 () => {
|
it("fails if the stop ID doesn't exist", async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user