From df09dc8ac4d264a7a90d3b942807f8ec130b26e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20R=C3=B6ll?= <30629157+maxiroellplenty@users.noreply.github.com> Date: Wed, 30 Oct 2024 17:38:01 +0100 Subject: [PATCH 1/3] feat: set default notification timeout to 5 seconds --- .../useNotification/__tests__/useNotification.spec.ts | 2 +- apps/web/composables/useNotification/useNotification.ts | 2 +- apps/web/vitest.config.ts | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/web/composables/useNotification/__tests__/useNotification.spec.ts b/apps/web/composables/useNotification/__tests__/useNotification.spec.ts index ac8ad71f8..78300ebcf 100644 --- a/apps/web/composables/useNotification/__tests__/useNotification.spec.ts +++ b/apps/web/composables/useNotification/__tests__/useNotification.spec.ts @@ -84,7 +84,7 @@ describe('useNotification', () => { expect(data.value.length).toBe(1); - await new Promise((resolve) => setTimeout(resolve, 2000)); + await new Promise((resolve) => setTimeout(resolve, 4000)); expect(data.value.length).toBe(1); await new Promise((resolve) => setTimeout(resolve, 1100)); diff --git a/apps/web/composables/useNotification/useNotification.ts b/apps/web/composables/useNotification/useNotification.ts index fc8504825..92f8d6121 100644 --- a/apps/web/composables/useNotification/useNotification.ts +++ b/apps/web/composables/useNotification/useNotification.ts @@ -1,7 +1,7 @@ import type { UseNotificationState, UseNotificationReturn, Notification } from './types'; const maxVisibleNotifications = 5; -const dismissTimeout = 3000; +const dismissTimeout = 5000; /** * @description Composable to display ui notifications diff --git a/apps/web/vitest.config.ts b/apps/web/vitest.config.ts index a25b1baa7..57e1afaa0 100644 --- a/apps/web/vitest.config.ts +++ b/apps/web/vitest.config.ts @@ -9,6 +9,7 @@ export default defineVitestConfig({ coverage: { reporter: ['text', 'html', 'json-summary', 'json'], }, + testTimeout: 6000, environment: 'nuxt', globals: true, clearMocks: true, From 4528c6384953d1284b29fb76b2c4784220b59222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20R=C3=B6ll?= <30629157+maxiroellplenty@users.noreply.github.com> Date: Wed, 30 Oct 2024 17:40:33 +0100 Subject: [PATCH 2/3] chore: add changelog --- docs/changelog/changelog_en.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog/changelog_en.md b/docs/changelog/changelog_en.md index 4a0c2af25..dcd6fcb10 100644 --- a/docs/changelog/changelog_en.md +++ b/docs/changelog/changelog_en.md @@ -36,6 +36,7 @@ - Started to unify the SDK/API error handling. Errors do now return keys that can be translated in the frontend. - Manufacturer visual improvments - Changed manufacturer translation text. +- Increased default notification timeout from 3 to 5 seconds. ## v1.6.0 (2024-10-10) Overview of all changes From ff5f0517b1175d2e17eb42fa5eeb648bf2df963c Mon Sep 17 00:00:00 2001 From: cristian sandru Date: Thu, 31 Oct 2024 09:50:25 +0200 Subject: [PATCH 3/3] adjust test naming --- .../useNotification/__tests__/useNotification.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/composables/useNotification/__tests__/useNotification.spec.ts b/apps/web/composables/useNotification/__tests__/useNotification.spec.ts index 78300ebcf..7f7907b6c 100644 --- a/apps/web/composables/useNotification/__tests__/useNotification.spec.ts +++ b/apps/web/composables/useNotification/__tests__/useNotification.spec.ts @@ -74,7 +74,7 @@ describe('useNotification', () => { expect(data.value.length).toBe(5); }); - it('should remove a notification after default timeout (3000ms)', async () => { + it('should remove a notification after default timeout (5000ms)', async () => { const { data, send } = useNotification(); send({ @@ -83,7 +83,7 @@ describe('useNotification', () => { }); expect(data.value.length).toBe(1); - + await new Promise((resolve) => setTimeout(resolve, 4000)); expect(data.value.length).toBe(1);