mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-07 03:22:38 +00:00
fix test errors
This commit is contained in:
@@ -31,10 +31,11 @@ describe('Tests for admin api', ()=>{
|
|||||||
const inputNotification = {
|
const inputNotification = {
|
||||||
title : 'Test Notification',
|
title : 'Test Notification',
|
||||||
text : 'This is a test notification',
|
text : 'This is a test notification',
|
||||||
startAt : new Date(),
|
startAt : new Date().toISOString(),
|
||||||
stopAt : new Date(),
|
stopAt : new Date().toISOString(),
|
||||||
dismissKey : 'testKey'
|
dismissKey : 'testKey'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const savedNotification = {
|
const savedNotification = {
|
||||||
...inputNotification,
|
...inputNotification,
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ NotificationSchema.statics.deleteNotification = async function(dismissKey) {
|
|||||||
if(!deletedNotification) {
|
if(!deletedNotification) {
|
||||||
return { success: false, message: 'Notification not found' };
|
return { success: false, message: 'Notification not found' };
|
||||||
}
|
}
|
||||||
return { success: true, notification: deletedNotification };
|
return { success: true, message: 'Notification deleted successfully' }; // Update response here
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return { success: false, message: err.message || 'Error deleting notification' };
|
return { success: false, message: err.message || 'Error deleting notification' };
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user