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-10.17.0 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-10.16.0 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-10.15.1 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-10.15.1.pre.alpha.rubocop.deps app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-10.15.0 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-10.14.1.pre.alpha2 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-10.14.1.pre.alpha1 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-10.14.0 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-10.13.1 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-10.13.0 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-10.13.0.pre.node.update app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-10.12.0 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-10.11.0 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-10.10.0 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-10.9.0 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-10.8.1.pre.alpha.flexdeps app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-10.9.0.pre.alpha1 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-10.8.0 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-10.7.1 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js
playbook_ui-10.7.0 app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js