Files
orca/mobile/src/notifications/native-notification-data.test.ts
T
Jinwoo Hong 341b13cf67 Restore mobile push and fix cold-start dismissals (#20068)
* Restore mobile push for delivery validation

* fix(mobile): register push task before headless startup

* Add authenticated mobile push test and fix iOS release entitlements

* Mock push-test transport in notification consent tests

* Fix slept workspace test for structured remount result

* Fix mobile notification review findings

* Pad Android notification icon to prevent square cropping

* fix(mobile): present visible Android data pushes in foreground

* test: use deterministic clock for teardown deadline

* fix(mobile): present foreground pushes through Expo public APIs

* fix(mobile): check push eligibility before foreground scheduling

* fix(mobile): register push from shared host connection lifecycle
2026-09-12 01:03:57 -04:00

23 lines
871 B
TypeScript

import { expect, it } from 'vitest'
import { readNativeNotificationData } from './native-notification-data'
import { readOrcaPushPayload } from './push-payload'
it('reads actual Expo APNs payloads when content.data is null', () => {
const orca = {
hostFingerprint: 'qa-host',
notificationId: 'done',
notificationSeq: 4,
notificationEpoch: 'epoch'
}
const data = readNativeNotificationData({
content: { data: null },
trigger: { type: 'push', payload: { aps: {}, orca } }
})
expect(readOrcaPushPayload(data)).toMatchObject(orca)
})
it('keeps Android push and local notification data', () => {
const data = { hostId: 'host', notificationId: 'done' }
expect(readNativeNotificationData({ content: { data }, trigger: { type: 'push' } })).toBe(data)
expect(readNativeNotificationData({ content: { data }, trigger: null })).toBe(data)
})