mirror of
https://github.com/langgenius/dify.git
synced 2025-08-01 13:58:23 +00:00
15 lines
654 B
TypeScript
15 lines
654 B
TypeScript
![]() |
import { convertLocalSecondsToUTCDaySeconds, convertUTCDaySecondsToLocalSeconds } from './utils'
|
||
|
|
||
|
describe('convertLocalSecondsToUTCDaySeconds', () => {
|
||
|
it('should convert local seconds to UTC day seconds correctly', () => {
|
||
|
const localTimezone = 'Asia/Shanghai'
|
||
|
const utcSeconds = convertLocalSecondsToUTCDaySeconds(0, localTimezone)
|
||
|
expect(utcSeconds).toBe((24 - 8) * 3600)
|
||
|
})
|
||
|
|
||
|
it('should convert local seconds to UTC day seconds for a specific time', () => {
|
||
|
const localTimezone = 'Asia/Shanghai'
|
||
|
expect(convertUTCDaySecondsToLocalSeconds(convertLocalSecondsToUTCDaySeconds(0, localTimezone), localTimezone)).toBe(0)
|
||
|
})
|
||
|
})
|