fix: fall back from invalid presence timezone
This commit is contained in:
@@ -89,3 +89,11 @@ test('local clock uses the profile timezone', () => {
|
||||
assert.deepEqual(localClock(new Date('2026-07-06T12:30:00Z'), 'Europe/Berlin'), { day: '2026-07-06', time: '14:30' });
|
||||
assert.equal(localClock(new Date(), 'Invalid/Timezone'), null);
|
||||
});
|
||||
|
||||
test('invalid profile timezone falls back to configured operational timezone', async () => {
|
||||
const { presence, messages, calls } = setup({ profile: { timezone: 'not-a-timezone' } });
|
||||
const outcome = await presence.tick(new Date('2026-07-06T12:00:00Z'));
|
||||
assert.equal(outcome.reason, 'sent');
|
||||
assert.equal(messages.length, 1);
|
||||
assert.match(calls[0].prompt, /timezone: UTC/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user