feat(release): prepare 1.1.0 candidate
This commit is contained in:
parent
5a34f66981
commit
5205dcdfa9
736 changed files with 115667 additions and 12203 deletions
36
apps/mobile-rn/__tests__/devices.test.ts
Normal file
36
apps/mobile-rn/__tests__/devices.test.ts
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import {
|
||||
DeviceServiceError,
|
||||
normalizeRegisteredDevice,
|
||||
} from '../src/features/devices/device-service'
|
||||
|
||||
describe('device response contract', () => {
|
||||
const row = {
|
||||
id: 'device-1',
|
||||
user_id: 'user-1',
|
||||
installation_id: '00000000-0000-4000-8000-000000000001',
|
||||
platform: 'android',
|
||||
device_name: 'Pixel 7',
|
||||
app_version: '1.0.0',
|
||||
os_version: 'Android 14',
|
||||
push_token: null,
|
||||
last_seen_at: '2026-08-21T00:00:00Z',
|
||||
revoked_at: null,
|
||||
created_at: '2026-08-20T00:00:00Z',
|
||||
updated_at: '2026-08-21T00:00:00Z',
|
||||
}
|
||||
|
||||
it('normalizes an owned registered device', () => {
|
||||
expect(normalizeRegisteredDevice(row)).toMatchObject({
|
||||
installationId: row.installation_id,
|
||||
deviceName: 'Pixel 7',
|
||||
revokedAt: null,
|
||||
})
|
||||
})
|
||||
|
||||
it('rejects missing timestamps and unsupported platforms', () => {
|
||||
expect(() => normalizeRegisteredDevice({ ...row, last_seen_at: 'bad' }))
|
||||
.toThrow(DeviceServiceError)
|
||||
expect(() => normalizeRegisteredDevice({ ...row, platform: 'unknown' }))
|
||||
.toThrow('invalid-response')
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue