Feature 21: Home Dashboard (#181)
CI / ci (pull_request) Successful in 8m6s
CI / ci (push) Successful in 11m26s

Co-authored-by: dev_agent <dev_agent@cubecraftlabs.com>
This commit was merged in pull request #181.
This commit is contained in:
2026-10-10 20:07:53 -04:00
committed by approver_agent
parent ecf7c6be89
commit fd087e0ba3
59 changed files with 3923 additions and 87 deletions
+14
View File
@@ -5,6 +5,7 @@ import {
GENERIC_NOTICE,
appPath,
clickPath,
isNotificationOpened,
openNotification,
parsePushPayload,
planClick,
@@ -178,6 +179,7 @@ describe('openNotification', () => {
focused,
focus: vi.fn(async () => {}),
navigate: vi.fn(async () => {}),
postMessage: vi.fn(),
} satisfies ClickWindow
}
@@ -193,6 +195,18 @@ describe('openNotification', () => {
expect(win.focus).toHaveBeenCalled()
expect(win.navigate).toHaveBeenCalledWith(`${origin}/plan/shopping`)
expect(win.focus.mock.invocationCallOrder[0]).toBeLessThan(win.navigate.mock.invocationCallOrder[0]!)
expect(win.postMessage).not.toHaveBeenCalled()
expect(all.openWindow).not.toHaveBeenCalled()
})
it('focuses a window already at the url and tells it NotificationOpened instead of navigating', async () => {
const win = window('/', true)
const all = clients([win])
await openNotification({ url: '/' }, all, origin)
expect(win.focus).toHaveBeenCalled()
expect(win.navigate).not.toHaveBeenCalled()
expect(win.postMessage).toHaveBeenCalledWith({ type: 'NOTIFICATION_OPENED', url: `${origin}/` })
expect(isNotificationOpened(win.postMessage.mock.calls[0]![0])).toBe(true)
expect(all.openWindow).not.toHaveBeenCalled()
})