Files
orca/src/shared/mobile-push-contract.test.ts
T
Jinwoo Hong 74cc9b5039 feat(desktop): native mobile push integration (2/3) (#19935)
* feat(desktop): integrate native mobile push delivery and lifecycle

* fix(desktop): preserve notification replay policy and review invariants

* fix(desktop): correct notification locale namespace and auto-ack tests
2026-09-10 20:16:56 -04:00

22 lines
651 B
TypeScript

import { expect, it } from 'vitest'
import { parseMobilePushRegistration } from './mobile-push-contract'
it('rejects malformed known preferences', () => {
expect(
parseMobilePushRegistration({
registrationId: 'r',
expiresAt: Date.now() + 60000,
filter: { onlyWhenDesktopAway: 'true' }
})
).toBeUndefined()
})
it('retains valid preferences while ignoring unknown fields', () => {
expect(
parseMobilePushRegistration({
registrationId: 'r',
expiresAt: 123,
filter: { onlyWhenDesktopAway: true, sound: false, unknown: true }
})?.filter
).toEqual({ onlyWhenDesktopAway: true, sound: false })
})