You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314
  1. import { convertLocalSecondsToUTCDaySeconds, convertUTCDaySecondsToLocalSeconds } from './utils'
  2. describe('convertLocalSecondsToUTCDaySeconds', () => {
  3. it('should convert local seconds to UTC day seconds correctly', () => {
  4. const localTimezone = 'Asia/Shanghai'
  5. const utcSeconds = convertLocalSecondsToUTCDaySeconds(0, localTimezone)
  6. expect(utcSeconds).toBe((24 - 8) * 3600)
  7. })
  8. it('should convert local seconds to UTC day seconds for a specific time', () => {
  9. const localTimezone = 'Asia/Shanghai'
  10. expect(convertUTCDaySecondsToLocalSeconds(convertLocalSecondsToUTCDaySeconds(0, localTimezone), localTimezone)).toBe(0)
  11. })
  12. })