mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-05-01 08:48:28 -05:00
feat: merge duplicate notifications (#2056)
Use the `ignoreDuplicates` prop from vue3-notification to ignore duplicate notifications, show a count (×N) instead when notifications are merged. Superseeds and closes https://github.com/go-vikunja/vikunja/pull/971 --------- Co-authored-by: Dominik Pschenitschni <6173598+dpschen@users.noreply.github.com>
This commit is contained in:
30
frontend/tests/e2e/misc/notifications.spec.ts
Normal file
30
frontend/tests/e2e/misc/notifications.spec.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import {test, expect} from '../../support/fixtures'
|
||||
|
||||
test.describe('Duplicate Notifications', () => {
|
||||
test('Merges duplicate notifications and shows count', async ({authenticatedPage: page}) => {
|
||||
await page.goto('/')
|
||||
await page.waitForLoadState('networkidle')
|
||||
|
||||
// Trigger the same notification twice via the Vue app using $notify directly
|
||||
await page.evaluate(() => {
|
||||
const app = document.getElementById('app')
|
||||
const vueApp = (app as any).__vue_app__
|
||||
vueApp.config.globalProperties.$notify({
|
||||
type: 'success',
|
||||
title: 'Test',
|
||||
text: 'Duplicate Test',
|
||||
})
|
||||
vueApp.config.globalProperties.$notify({
|
||||
type: 'success',
|
||||
title: 'Test',
|
||||
text: 'Duplicate Test',
|
||||
})
|
||||
})
|
||||
|
||||
// Should only show one notification with a count of ×2
|
||||
const notification = page.locator('.global-notification .vue-notification.success')
|
||||
await expect(notification).toHaveCount(1)
|
||||
await expect(notification.locator('.notification-content')).toContainText('Duplicate Test')
|
||||
await expect(notification.locator('.notification-content')).toContainText('×2')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user