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.31.0.pre.alpha.datepickerdisableddatefix931 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.31.0.pre.alpha.customiconsfa928 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.31.0 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.30.1.pre.alpha.play846responsivespacingglobalpropsneedsdefault924 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.30.1.pre.alpha.PLAY906multilevelselectedidsprop917 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.30.1.pre.alpha.PLAY906multilevelselectedidsprop916 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.30.1.pre.alpha.hovertesting914 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.30.1.pre.alpha.PLAY906multilevelselectedidsprop912 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.30.1.pre.alpha.PLAY802responsivetitlekit909 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.30.0.pre.alpha.PLAY906multilevelselectedidsprop902 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.30.1 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.30.0 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.29.0.pre.alpha.play716popoverkitcloseonclickissue893 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.29.0 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.28.0.pre.alpha.PLAY863multilevelv2877 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.28.0.pre.alpha.PLAY863multilevelv2876 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.28.0.pre.alpha.PLAY814removemomentjs871 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.28.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown869 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.28.0.pre.alpha.PLAY837MapCustomButton868 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.28.0.pre.alpha.20230613implementbakesupport865 app/pb_kits/playbook/pb_select/select.test.js