fix(notification): address review suggestions
- ChronikFuerDichBox: move update() inside the failure branch so success path skips it, matching NotificationDropdown's pattern - NotificationDropdown test: add role=alert assertion for mark-all-read failure to match existing dismiss-failure coverage in ChronikFuerDichBox - +page.server.ts: use getErrorMessage(undefined) instead of null so the missing-notificationId 400 goes through the same i18n pipeline as other errors Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -234,6 +234,23 @@ describe('NotificationDropdown', () => {
|
||||
expect(optimisticMarkAllRead).toHaveBeenCalledOnce();
|
||||
});
|
||||
|
||||
it('shows a role=alert error banner when mark-all-read returns a failure', async () => {
|
||||
mockFormResult.type = 'failure';
|
||||
render(NotificationDropdown, {
|
||||
props: {
|
||||
notifications: [makeNotification()],
|
||||
optimisticMarkRead: () => {},
|
||||
optimisticMarkAllRead: () => {},
|
||||
onClose: () => {}
|
||||
}
|
||||
});
|
||||
|
||||
await page.getByRole('button', { name: /alle gelesen/i }).click();
|
||||
|
||||
const alert = document.querySelector('[role="alert"]');
|
||||
expect(alert).not.toBeNull();
|
||||
});
|
||||
|
||||
it('calls onClose when the view-all button is clicked', async () => {
|
||||
const onClose = vi.fn();
|
||||
render(NotificationDropdown, {
|
||||
|
||||
Reference in New Issue
Block a user