Files
Maurice 9bb5854dbb test(server): the suites left in tests/unit/services move next to the code they cover
src/services is gone, so the folder named a layer that no longer exists. The airtrail suites go to tests/unit/nest/integrations, the crypto, cookie, avatar, password policy, timezone and conflict helpers to tests/unit/nest/common, the kitinerary mapper to booking-import, the photo media suite to photos, the atlas bundle guard to tests/unit/nest and the two migration suites to tests/unit/db. Only the relative import paths change, and the format baseline follows the new paths.
2026-10-10 20:16:12 +02:00

18 lines
774 B
TypeScript

import { localParts, resolveTimeZone } from '../../../../src/nest/common/timezoneService';
import { describe, expect, it } from 'vitest';
describe('timezoneService', () => {
it('resolves valid coordinates and rejects missing or invalid values', () => {
expect(resolveTimeZone(35.6762, 139.6503)).toBe('Asia/Tokyo');
expect(resolveTimeZone(null, 139.6503)).toBeNull();
expect(resolveTimeZone(91, 139.6503)).toBeNull();
});
it('converts instants to local date and time', () => {
expect(localParts('2026-12-03T00:00:00Z', 'Asia/Tokyo')).toEqual({ date: '2026-12-03', time: '09:00' });
expect(localParts('invalid', 'Asia/Tokyo')).toEqual({ date: null, time: null });
expect(localParts(null, null)).toEqual({ date: null, time: null });
});
});