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.26.0.pre.alpha.multiselectfixes798 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.0.pre.alpha.multiselectfixes797 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.0.pre.alpha.multiselectfixes796 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.0.pre.alpha.multiselectfixes795 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown794 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.25.0.pre.alpha.play824786 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.0 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.25.0.pre.alpha.railsmultilevelimprovements785 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.25.0.pre.alpha.railsmultilevelimprovements780 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.25.0.pre.alpha.PLAY818multilevelrebuild779 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.25.0.pre.alpha.railsmultilevelimprovements776 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.25.0.pre.alpha.PLAY818multilevelrebuild774 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.25.0.pre.alpha.PLAY818multilevelrebuild773 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.25.0.pre.alpha.PLAY818multilevelrebuild770 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.25.0.pre.alpha.play822bolddefaultfortitle3764 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.25.0.pre.alpha.PLAY733DetailKit761 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.25.0.pre.alpha.railsmultilevelimprovements758 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.25.0 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.24.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown756 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.24.0.pre.alpha.play824753 app/pb_kits/playbook/pb_select/select.test.js