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.36.0 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.35.0.pre.alpha.iconpocwebfonts1023 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.35.0 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.34.0.pre.alpha.fixdialogcloseevents1004 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.34.0.pre.alpha.fixdialogcloseevents1003 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.34.0.pre.alpha.play716popoverkitcloseonclickissue998 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.34.0 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.33.1.pre.alpha.PLAY933navkitcollapsible994 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.33.1 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.33.0.pre.alpha.PLAY905reactionbuttons982 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.33.0.pre.alpha.PLAY905reactionbuttons979 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.33.0.pre.alpha.revert2650closedialogonoutsideclick977 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.33.0 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.32.0 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.31.0.pre.alpha.hoverrails951 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.31.0.pre.alpha.hoverrails948 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.31.0.pre.alpha.multilevelnopillsdesigns944 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.31.0.pre.alpha.multilevelnopillsdesigns941 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.31.0.pre.alpha.PLAY814removemomentjs935 app/pb_kits/playbook/pb_select/select.test.js
playbook_ui-12.31.0.pre.alpha.PLAY814removemomentjs933 app/pb_kits/playbook/pb_select/select.test.js