Skip to content

Commit

Permalink
feat: set default notification timeout to 5 seconds (#771)
Browse files Browse the repository at this point in the history
* feat: set default notification timeout to 5 seconds

* chore: add changelog

* adjust test naming

---------

Co-authored-by: cristian sandru <[email protected]>
  • Loading branch information
maxiroellplenty and csandru-plenty authored Oct 31, 2024
1 parent e69f256 commit f91e43b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -83,8 +83,8 @@ 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));
Expand Down
2 changes: 1 addition & 1 deletion apps/web/composables/useNotification/useNotification.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions apps/web/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default defineVitestConfig({
coverage: {
reporter: ['text', 'html', 'json-summary', 'json'],
},
testTimeout: 6000,
environment: 'nuxt',
globals: true,
clearMocks: true,
Expand Down
1 change: 1 addition & 0 deletions docs/changelog/changelog_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
- Manufacturer visual improvments
- Changed manufacturer translation text.
- In cases where the basket is empty during the checkout process, the system will now redirect to `/cart` and display a notification.
- Increased default notification timeout from 3 to 5 seconds.

## v1.6.0 (2024-10-10) <a href="https://github.com/plentymarkets/plentyshop-pwa/compare/v1.5.0...v1.6.0" target="_blank" rel="noopener"><b>Overview of all changes</b></a>

Expand Down

0 comments on commit f91e43b

Please sign in to comment.