feat(release): add phase10 tests, smoke load script, release checklist, and onboarding simulator flow
This commit is contained in:
24
Backend/tests/device-token.test.ts
Normal file
24
Backend/tests/device-token.test.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { describe, expect, test } from 'bun:test';
|
||||
|
||||
import { createDeviceToken, verifyDeviceToken } from '../utils/device-token';
|
||||
|
||||
describe('device token', () => {
|
||||
test('roundtrips valid payload', () => {
|
||||
const token = createDeviceToken({
|
||||
userId: 'user-1',
|
||||
deviceId: 'device-1',
|
||||
role: 'client',
|
||||
}, 60);
|
||||
|
||||
const payload = verifyDeviceToken(token);
|
||||
|
||||
expect(payload).not.toBeNull();
|
||||
expect(payload?.userId).toBe('user-1');
|
||||
expect(payload?.deviceId).toBe('device-1');
|
||||
expect(payload?.role).toBe('client');
|
||||
});
|
||||
|
||||
test('rejects malformed tokens', () => {
|
||||
expect(verifyDeviceToken('bad-token')).toBeNull();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user