mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 06:07:21 +01:00
do not show "Notification not found" error messages (#10931)
* start fixing #10391 * do not show snackbars for notifications not found * revert message changes * update tests * add new test * fix property
This commit is contained in:
@@ -5,7 +5,9 @@ import {
|
||||
BadRequest,
|
||||
InternalServerError,
|
||||
NotFound,
|
||||
NotificationNotFound,
|
||||
} from '../../../../website/server/libs/errors';
|
||||
import i18n from '../../../../website/common/script/i18n';
|
||||
|
||||
describe('Custom Errors', () => {
|
||||
describe('CustomError', () => {
|
||||
@@ -66,6 +68,23 @@ describe('Custom Errors', () => {
|
||||
|
||||
expect(notAuthorizedError.message).to.eql('Custom Error Message');
|
||||
});
|
||||
|
||||
describe('NotificationNotFound', () => {
|
||||
it('is an instance of NotFound', () => {
|
||||
const notificationNotFoundErr = new NotificationNotFound();
|
||||
expect(notificationNotFoundErr).to.be.an.instanceOf(NotFound);
|
||||
});
|
||||
|
||||
it('it returns an http code of 404', () => {
|
||||
const notificationNotFoundErr = new NotificationNotFound();
|
||||
expect(notificationNotFoundErr.httpCode).to.eql(404);
|
||||
});
|
||||
|
||||
it('returns a standard message', () => {
|
||||
const notificationNotFoundErr = new NotificationNotFound();
|
||||
expect(notificationNotFoundErr.message).to.eql(i18n.t('messageNotificationNotFound'));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('BadRequest', () => {
|
||||
|
||||
Reference in New Issue
Block a user