You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add notification, push, deep-link, and mobile navigation test coverage #1728
Test each boundary independently and add a small route-level smoke suite. Real Apple Push Notification service delivery is unsuitable for deterministic CI, so the server transport and browser PushManager are injected or mocked. The highest-risk invariants are authentication ownership, idempotency, safe URL handling, and confirmation before mutations.
File: test/notificationService.test.ts (new file)
Why this file: Core persistence behavior should be validated against the real test database rather than mocked SQL.
Why this file: Delivery retries and subscription revocation must be verified without a real push provider.
import{beforeEach,expect,it,vi}from'vitest';vi.mock('web-push',()=>({default: {setVapidDetails: vi.fn(),sendNotification: vi.fn(),},}));it('revokes a subscription after a 410 response',async()=>{constwebPush=(awaitimport('web-push')).default;vi.mocked(webPush.sendNotification).mockRejectedValueOnce({statusCode: 410});// Seed one event, enabled preference, active subscription, and pending delivery// with test fixtures, then run a single batch.const{ dispatchWebPushBatch }=awaitimport('../packages/core/src/services/webPushDispatcher.js');awaitdispatchWebPushBatch(1);expect(webPush.sendNotification).toHaveBeenCalledTimes(1);// Assert the fixture subscription now has revoked_at and the delivery is failed.});
File: propr-ui/src/hooks/usePushNotifications.test.tsx (new file)
Why this file: Permission prompts and PushManager enrollment are browser-only state transitions that need deterministic mocks.
import{act,renderHook}from'@testing-library/react';import{expect,it,vi}from'vitest';import{usePushNotifications}from'./usePushNotifications';it('requests permission only when enable is invoked',async()=>{constrequestPermission=vi.fn().mockResolvedValue('granted');Object.defineProperty(window,'Notification',{value: {permission: 'default', requestPermission },configurable: true});const{ result }=renderHook(()=>usePushNotifications());expect(requestPermission).not.toHaveBeenCalled();awaitact(()=>result.current.enable());expect(requestPermission).toHaveBeenCalledTimes(1);});
File: propr-ui/src/pages/InboxPage.test.tsx (new file)
Why this file: The dedicated mobile workflow needs grouping and optimistic error-state coverage.
it('groups failed work separately and restores a failed optimistic dismissal',async()=>{mockGetNotifications.mockResolvedValue({notifications: [failedTask,completedTask],unreadCount: 2,nextCursor: null});mockDismissNotification.mockRejectedValueOnce(newError('Offline'));renderInbox();expect(awaitscreen.findByRole('heading',{name: 'Needs attention'})).toBeVisible();expect(screen.getByRole('heading',{name: 'Completed'})).toBeVisible();awaituser.click(screen.getAllByRole('button',{name: /dismiss/i})[0]);expect(awaitscreen.findByText(failedTask.title)).toBeVisible();expect(screen.getByText('Offline')).toBeVisible();});
File: propr-ui/src/components/TaskPlanner/PlanEditor.notificationIntent.test.tsx (new file)
Why this file: This guards the critical rule that URL navigation alone never starts agent execution.
it('shows confirmation without executing approve_execute automatically',async()=>{renderPlanEditorAt('/studio/draft-1?intent=approve_execute');expect(awaitscreen.findByRole('dialog',{name: /approveandcontinue/i})).toBeVisible();expect(mockHandleApproveAndExecute).not.toHaveBeenCalled();awaituser.click(screen.getByRole('button',{name: 'Confirm'}));expect(mockHandleApproveAndExecute).toHaveBeenCalledTimes(1);});
File: propr-ui/e2e/pwa-mobile.spec.ts (new file)
Why this file: A route-level browser smoke test catches manifest linkage, fixed-navigation overlap, and small-viewport overflow.
import{expect,test}from'@playwright/test';for(constviewportof[{width: 320,height: 700},{width: 390,height: 844}]){test(`mobile navigation and Inbox fit ${viewport.width}px`,async({ page })=>{awaitpage.setViewportSize(viewport);awaitauthenticateDemoSession(page);awaitpage.goto('/inbox');awaitexpect(page.getByRole('navigation',{name: 'Primary mobile navigation'})).toBeVisible();awaitexpect(page.getByText('Inbox',{exact: true}).last()).toBeVisible();constoverflow=awaitpage.evaluate(()=>document.documentElement.scrollWidth>document.documentElement.clientWidth);expect(overflow).toBe(false);});}test('document exposes install metadata',async({ page })=>{awaitpage.goto('/');awaitexpect(page.locator('link[rel=manifest]')).toHaveAttribute('href','/manifest.webmanifest');awaitexpect(page.locator('link[rel=apple-touch-icon]')).toHaveAttribute('href','/icons/apple-touch-icon.png');});
Activity
propr-dev commentedon Aug 2, 2026
Suggested Implementation:
Implementation Approach
Test each boundary independently and add a small route-level smoke suite. Real Apple Push Notification service delivery is unsuitable for deterministic CI, so the server transport and browser PushManager are injected or mocked. The highest-risk invariants are authentication ownership, idempotency, safe URL handling, and confirmation before mutations.
File:
test/notificationService.test.ts(new file)Why this file: Core persistence behavior should be validated against the real test database rather than mocked SQL.
File:
test/notificationProjector.test.ts(new file)Why this file: Lifecycle mapping is where product semantics are encoded; table-driven cases make omissions visible.
File:
test/webPushDispatcher.test.ts(new file)Why this file: Delivery retries and subscription revocation must be verified without a real push provider.
File:
propr-ui/src/hooks/usePushNotifications.test.tsx(new file)Why this file: Permission prompts and PushManager enrollment are browser-only state transitions that need deterministic mocks.
File:
propr-ui/src/pages/InboxPage.test.tsx(new file)Why this file: The dedicated mobile workflow needs grouping and optimistic error-state coverage.
File:
propr-ui/src/components/TaskPlanner/PlanEditor.notificationIntent.test.tsx(new file)Why this file: This guards the critical rule that URL navigation alone never starts agent execution.
File:
propr-ui/e2e/pwa-mobile.spec.ts(new file)Why this file: A route-level browser smoke test catches manifest linkage, fixed-navigation overlap, and small-viewport overflow.
propr-dev commentedon Aug 25, 2026
🤖 AI processing has started for this issue using codex agent with gpt-5.6-sol model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
codexgpt-5.6-sol1728/gpt-5.6-sol-add-notification-push-dee-20260825-0038-akp1716-epic-failed-to-3m8issue-1728-20260825-0038-gpt-5.6-sol-akp🔍 Track Task Execution
fix(ai): Resolve issue #1728 - Add notification, push, deep-link, and…
fix(ai): Resolve issue #1728 - Add notification, push, deep-link, and…
[Epic] PWA & Web push (#1731)