fix the resolver result

This commit is contained in:
2025-02-04 11:21:54 -08:00
parent 5687f7f600
commit 3a51d15e63

View File

@@ -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 () => {