Sha256: 2207905d6fdcd5dd2225970653fd0a2001a3645c2514efa91cc0149d67d3131d

Contents?: true

Size: 1005 Bytes

Versions: 56

Compression:

Stored size: 1005 Bytes

Contents

import { ensureAccessible, renderKit } from '../utilities/test-utils'
import { DateTimeStacked } from '../'

/* eslint-disable jsx-control-statements/jsx-jcs-no-undef */

const props = {
  data: { testid: 'datetimestacked' },
  datetime: new Date('Wed Mar 31 2021 12:00:00 GMT-0500'),
}

test('Kit renders date time', () => {
  const kit = renderKit(DateTimeStacked, props)
  expect(kit).toBeInTheDocument()
})

it('Should be accessible', async () => {
  ensureAccessible(DateTimeStacked, props)
})

test('renders time in default timezone', () => {
  const kit = renderKit(DateTimeStacked, props)
  expect(kit).toHaveTextContent(/Mar311:00pEDT/i)
})

test('renders time in timezone', () => {
  props.timeZone = 'Asia/Tokyo'
  const kit = renderKit(DateTimeStacked, props)
  expect(kit).toHaveTextContent(/Mar312:00aJST/i)
})

test('renders time in timezone', () => {
  props.timeZone = 'America/Denver'
  const kit = renderKit(DateTimeStacked, props)
  expect(kit).toHaveTextContent(/Mar3111:00aMDT/i)
})

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
playbook_ui-9.19.0.pre.alphafonts app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-9.18.0.flow.bin.alpha app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-9.18.0 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-9.17.0 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-9.17.0.pre.decouple.website2 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-9.16.0 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-9.15.0 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-9.15.0.pre.decouple.website1 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-9.14.1.alpha.radio.alignment app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-9.14.1.alpha.highcharts9 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-9.14.1 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-9.13.0 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-9.12.0 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-9.10.0.pre.date.time.stacked.1 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-9.4.0.pre.alpha2 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-9.4.0.pre.alpha1 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js