fix assertion for nested graphql response

This commit is contained in:
2025-02-04 11:33:48 -08:00
parent acc4d08716
commit 71698da173

View File

@@ -100,7 +100,7 @@ describe("MutationResolvers", () => {
describe("cancelNotification", () => { describe("cancelNotification", () => {
const query = ` const query = `
query CancelNotification($input: NotificationInput!) { mutation CancelNotification($input: NotificationInput!) {
cancelNotification(input: $input) { cancelNotification(input: $input) {
success success
message message
@@ -130,8 +130,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 cancelledNotification = response.body.singleResult.data?.cancelNotification as any; const notificationResponse = response.body.singleResult.data?.cancelNotification as any;
expect(cancelledNotification).toStrictEqual(notificationInput); expect(notificationResponse.success).toBe(true);
expect(notificationResponse.data).toStrictEqual(notificationInput);
expect(context.notificationService.isNotificationScheduled(notificationInput)).toBe(false); expect(context.notificationService.isNotificationScheduled(notificationInput)).toBe(false);
}); });