Sha256: 7393d6eee1deb849980eb06d9397c6e5d47c961f3fca0773b80e69fd02b3f42c

Contents?: true

Size: 1.18 KB

Versions: 695

Compression:

Stored size: 1.18 KB

Contents

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

import { Button, ButtonToolbar } from '../'

test('default test', () => {
  render(
    <ButtonToolbar
        data={{ testid: 'default-test' }}
    >
      <Button
          data={{ testid: 'child-button' }}
          text="Test"
      />
    </ButtonToolbar>
  )

  const kit   = screen.getByTestId('default-test')
  const child = screen.getByTestId('child-button')

  expect(kit).toHaveClass('pb_button_toolbar_kit_horizontal_primary')
  expect(kit).toContainElement(child)
  expect(child).toHaveClass('pb_button_kit_primary_inline_enabled')
})

test('variant and orientation props', () => {
  render(
    <ButtonToolbar
        data={{ testid: 'second-test' }}
        orientation="vertical"
        variant="secondary"
    >
      <Button
          data={{ testid: 'child-button' }}
          text="Create"
          variant="secondary"
      />
    </ButtonToolbar>
  )

  const kit   = screen.getByTestId('second-test')
  const child = screen.getByTestId('child-button')

  expect(kit).toHaveClass('pb_button_toolbar_kit_vertical_secondary')
  expect(child).toHaveClass('pb_button_kit_secondary_inline_enabled')
})

Version data entries

695 entries across 695 versions & 1 rubygems

Version Path
playbook_ui-13.34.1.pre.alpha.play1407statvaluekitinconsistencies3388 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.34.1.pre.alpha.PLAY14703378 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.34.1 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3370 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3369 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3368 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.34.0.pre.alpha.PBNTR358responsiveadvancedtablereact3366 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.34.0 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.33.1.pre.alpha.play1407statvaluekitinconsistencies3352 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.33.1.pre.alpha.PLAY14063320 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.33.1 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.33.0.pre.alpha.PBNTR405dropdownformfixesrails3311 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.33.0.pre.alpha.PLAY1454formpillicons3309 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.33.0 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.32.0.pre.alpha.PBNTR405dropdownformfixesrails3301 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.32.0.pre.alpha.PLAY1138iconkitaddcolorprop3268 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.32.0.pre.alpha.play1416movealiaslogic3266 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.32.0.pre.alpha.play1416movealiaslogic3239 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.32.0.pre.alpha.PLAY14103236 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.31.0.pre.alpha.play1416movealiaslogic3232 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js