mirror of
https://github.com/stablyai/orca.git
synced 2026-11-02 01:57:57 +00:00
* 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
22 lines
651 B
TypeScript
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 })
|
|
})
|