fix(mobile): list desktop and web devices instead of failing the screen

normalizeRegisteredDevice accepted only android/ios, so one desktop row made
the whole Devices screen fail. Accept the server platform list and show the
platform on each card.
This commit is contained in:
Yun Chan 2026-09-27 14:04:49 +09:00
parent 0a4f5aee64
commit 53fcdf6305
3 changed files with 20 additions and 3 deletions

View file

@ -27,6 +27,12 @@ describe('device response contract', () => {
})
})
it('accepts desktop and web devices registered to the same account', () => {
for (const platform of ['windows', 'macos', 'web', 'ios'] as const) {
expect(normalizeRegisteredDevice({ ...row, platform }).platform).toBe(platform)
}
})
it('rejects missing timestamps and unsupported platforms', () => {
expect(() => normalizeRegisteredDevice({ ...row, last_seen_at: 'bad' }))
.toThrow(DeviceServiceError)