From 5eb14569159b94e137806c53c4c60439dcbc2332 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Thu, 3 Oct 2024 09:15:08 +0200 Subject: [PATCH] fix tests 2 --- server/admin.api.spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/admin.api.spec.js b/server/admin.api.spec.js index b76e10777..672bd530d 100644 --- a/server/admin.api.spec.js +++ b/server/admin.api.spec.js @@ -41,8 +41,8 @@ describe('Tests for admin api', ()=>{ ...inputNotification, _id : expect.any(String), // Don't care what _id is, just that it added one createdAt : expect.any(String), // Don't care what date is, just that it added it - startAt : inputNotification.startAt.toJSON(), // Convert to json to match the format coming from mongo - stopAt : inputNotification.stopAt.toJSON() + startAt : inputNotification.startAt, // Convert to json to match the format coming from mongo + stopAt : inputNotification.stopAt, }; //Change 'save' function to just return itself instead of actually interacting with the database @@ -75,7 +75,7 @@ describe('Tests for admin api', ()=>{ .set('Authorization', `Basic ${Buffer.from('admin:password3').toString('base64')}`); expect(response.status).toBe(200); - expect(response.body).toEqual({ message: 'Notification deleted successfully' }); + expect(response.body).toEqual({ success: true, message: 'Notification deleted successfully' }); });