Skip to content

Commit

Permalink
patch(jest): Patch daylight timezone issue by testing a specific time…
Browse files Browse the repository at this point in the history
…zone that will not be affected by edaylight saving
  • Loading branch information
drepram committed Feb 17, 2022
1 parent f8c6a5d commit 53a0366
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7,524 deletions.
8 changes: 7 additions & 1 deletion utilities/Timezone.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ import * as Timezone from './Timezone'
describe('init', () => {
test('getTimezoneDropdowns', () => {
const result = Timezone.getTimezoneDropdowns()
const nonDaylightTimezone = result.find((obj) => {
return obj.alternativeName === 'Western Indonesia Time'
})

expect(result).toMatchSnapshot()
expect(result.length).toEqual(316) // As of 17 Feb 2022, there are 316 timezones on @vvo/tzdb.
expect(nonDaylightTimezone.currentTimeFormat).toEqual(
'+07:00 Western Indonesia Time - Jakarta, Surabaya, Medan, Bandung',
) // Make sure that the nonDaylightTimezone exists.
})
test('getUtfOffsetInMins for an existing timezone', () => {
const result = Timezone.getUtfOffsetInMins('Asia/Jakarta')
Expand Down
Loading

0 comments on commit 53a0366

Please sign in to comment.