Skip to content

Commit

Permalink
update(jest): use Singapore as example
Browse files Browse the repository at this point in the history
  • Loading branch information
drepram committed Feb 22, 2022
1 parent fa4930a commit d320143
Show file tree
Hide file tree
Showing 2 changed files with 7,529 additions and 5 deletions.
11 changes: 6 additions & 5 deletions utilities/Timezone.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@ describe('init', () => {
test('getTimezoneDropdowns', () => {
const result = Timezone.getTimezoneDropdowns()
const nonDaylightTimezone = result.find((obj) => {
return obj.alternativeName === 'Western Indonesia Time'
return obj.alternativeName === 'Singapore Time'
})

expect(result).toMatchSnapshot()
expect(result.length).not.toBeNull()
expect(result.length).toBeGreaterThan(0)
expect(nonDaylightTimezone.currentTimeFormat).toEqual(
'+07:00 Western Indonesia Time - Jakarta, Surabaya, Medan, Bandung',
'+08:00 Singapore Time - Singapore, Woodlands, Marine Parade',
) // Make sure that the nonDaylightTimezone exists.
})
test('getUtfOffsetInMins for an existing timezone', () => {
const result = Timezone.getUtfOffsetInMins('Asia/Jakarta')
const result = Timezone.getUtfOffsetInMins('Asia/Singapore')

expect(result).toBe(420)
expect(result).toBe(480)
})
test('getUtfOffsetInMins for a non existing timezone', () => {
const result = Timezone.getUtfOffsetInMins('Asia/Jayakarta')
const result = Timezone.getUtfOffsetInMins('Asia/Singapura')

expect(result).toBeNull()
})
Expand Down
Loading

0 comments on commit d320143

Please sign in to comment.