diff --git a/front/src/utils/notifications/notificationToggle.util.test.ts b/front/src/utils/notifications/notificationToggle.util.test.ts index d5a2e8fda..83c5fc2bd 100644 --- a/front/src/utils/notifications/notificationToggle.util.test.ts +++ b/front/src/utils/notifications/notificationToggle.util.test.ts @@ -36,10 +36,10 @@ describe("Notification Toggle Utils", () => { ); }); - it("should return false when key for type is undefined", async () => { + it("should return true when key for type is undefined (toogle default value)", async () => { await NotificationToggleUtils.isToggleOn(NotificationType.epds).then( (data) => { - expect(data).toEqual(false); + expect(data).toEqual(true); } ); }); diff --git a/front/src/utils/notifications/notificationToggle.util.ts b/front/src/utils/notifications/notificationToggle.util.ts index a9832569f..0a1b3e959 100644 --- a/front/src/utils/notifications/notificationToggle.util.ts +++ b/front/src/utils/notifications/notificationToggle.util.ts @@ -9,7 +9,7 @@ import { getObjectValue } from "../storage.util"; export const isToggleOn = async (type: NotificationType): Promise => { const key = getStorageKey(type); if (key) return (await getObjectValue(key)) as boolean; - return false; + return true; // 'On' par défaut }; export const getStorageKey = (