import { isoDateTime } from './index' describe('timeOnly - isoDateTime', () => { const daylightSavingDateTime = '2021-02-28T09:41:30Z' // UTC, Sunday const standardDateTime = '2021-07-31T09:41:30Z' // UTC, Saturday it.each([ ['America/Phoenix', 'en-US', '2021-02-28T09:41:30Z'], ['America/Chicago', 'en-US', '2021-02-28T09:41:30Z'], ['America/New_York', 'en-US', '2021-02-28T09:41:30Z'], ['America/Montevideo', 'es-UY', '2021-02-28T09:41:30Z'], ['America/Sao_Paulo', 'pt-BR', '2021-02-28T09:41:30Z'], ['UTC', 'en-US', '2021-02-28T09:41:30Z'], ['UTC', 'en-GB', '2021-02-28T09:41:30Z'], ['Europe/London', 'en-GB', '2021-02-28T09:41:30Z'], ['Europe/Paris', 'fr-FR', '2021-02-28T09:41:30Z'], ['Asia/Tbilisi', 'ka-GE', '2021-02-28T09:41:30Z'], ['Asia/Kolkata', 'hi-IN', '2021-02-28T09:41:30Z'], ])( 'daylightSavingDateTime - returns correct month number (TZ: %s, Locale: %s)', (timezone, locale, localisedResult) => expect(isoDateTime(daylightSavingDateTime, { timezone, locale })).toEqual( localisedResult ) ) it.each([ ['America/Phoenix', 'en-US', '2021-07-31T09:41:30Z'], ['America/Chicago', 'en-US', '2021-07-31T09:41:30Z'], ['America/New_York', 'en-US', '2021-07-31T09:41:30Z'], ['America/Montevideo', 'es-UY', '2021-07-31T09:41:30Z'], ['America/Sao_Paulo', 'pt-BR', '2021-07-31T09:41:30Z'], ['UTC', 'en-US', '2021-07-31T09:41:30Z'], ['UTC', 'en-GB', '2021-07-31T09:41:30Z'], ['Europe/London', 'en-GB', '2021-07-31T09:41:30Z'], ['Europe/Paris', 'fr-FR', '2021-07-31T09:41:30Z'], ['Asia/Tbilisi', 'ka-GE', '2021-07-31T09:41:30Z'], ['Asia/Kolkata', 'hi-IN', '2021-07-31T09:41:30Z'], ])( 'standardDateTime - returns correct month number (TZ: %s, Locale: %s)', (timezone, locale, localisedResult) => expect(isoDateTime(standardDateTime, { timezone, locale })).toEqual( localisedResult ) ) })