mirror of
https://github.com/langgenius/dify.git
synced 2025-07-31 21:36:23 +00:00

Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: crazywoola <427733928@qq.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Novice <novice12185727@gmail.com>
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)
|
|
})
|
|
})
|