Sha256: 911c8323c930f9017e8e62b424cb70c4e8555be472b6c9162228f7e9a4aadc6e

Contents?: true

Size: 881 Bytes

Versions: 460

Compression:

Stored size: 881 Bytes

Contents

import React from 'react'
import { render, screen } from '../utilities/test-utils'

import Select from './_select'

const testId = 'select1',
  kitClass = 'pb_select'

const options = [
  {
    value: '1',
    text: 'Burgers',
  },
  {
    value: '2',
    text: 'Pizza',
  },
  {
    value: '3',
    text: 'Tacos',
  },
]

test('returns namespaced class name', () => {
  render(
    <Select
        data={{ testid: testId }}
        label="Favorite Food"
        name="food"
        options={options}
    />
  )

  const kit = screen.getByTestId(testId)
  expect(kit).toHaveClass(kitClass)
})

test('returns dark class name', () => {
  render(
    <Select
        dark
        data={{ testid: testId }}
        label="Favorite Food"
        name="food"
        options={options}
    />
  )

  const kit = screen.getByTestId(testId)
  expect(kit).toHaveClass(`${kitClass} dark`)
})

Version data entries

460 entries across 460 versions & 1 rubygems

Version Path
playbook_ui-12.38.0.pre.alpha.PLAY932removemomentqp1088 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.38.0.pre.alpha.PLAY966collapsiblenav41086 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.38.0.pre.alpha.audiencesalpha1083 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.38.0.pre.alpha.PLAY966collapsiblenav41082 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.38.0.pre.alpha.PLAYaddingdatapropselectkit1080 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.37.0.pre.alpha.PLAY951collapsiblenav31078 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.38.0.pre.alpha.playbook123801077 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.37.0.pre.alpha.PLAY951collapsiblenav31074 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.37.0.pre.alpha.PLAY951collapsiblenav31073 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.37.0.pre.alpha.PLAYaddingdatapropselectkit1071 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.38.0 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.37.0.pre.alpha.svgiconmethods1064 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.37.0.pre.alpha.PLAY951collapsiblenav31062 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.37.0 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.36.0.pre.alpha.svgiconmethods1059 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.36.0.pre.alpha.PLAY936momentjs1058 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.36.0.pre.alpha.PLAY936momentjs1050 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.36.0.pre.alpha.PLAY936momentjs1047 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.36.0.pre.alpha.svgiconmethods1043 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.36.0.pre.alpha.PLAY942collapsiblenav21035 app/pb_kits/playbook/pb_select/select.test.js