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.28.0 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.27.0.pre.alpha.expandednotworking853 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.27.0 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.1.pre.alpha.railsmultilevelimprovements842 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.1.pre.alpha.railsmultilevelimprovements837 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.1.pre.alpha.PLAY860PhoneNumInputOptions836 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.1.pre.alpha.railsmultilevelimprovements835 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.1.pre.alpha.play716popoverkitcloseonclickissue833 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.1.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown831 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.1 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.0.pre.alpha.multiselectfixes825 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown822 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.0.pre.alpha.multiselectfixes821 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown818 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown817 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown815 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown813 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.0.pre.alpha.alphafix812 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.0.pre.alpha.alphafix810 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.26.0.pre.alpha.railsmultilevelimprovements805 app/pb_kits/playbook/pb_select/select.test.js