Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: set default notification timeout to 5 seconds #771

Merged
merged 4 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading