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.24.0.pre.alpha.PBNTR261NewKitDropdown2681 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.24.0.pre.alpha.PLAY1181circleiconkitfixsizingerrorglobalspacingprops2675 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.24.0.pre.alpha.PLAY998backgroundkitremoveemptyinlinline2666 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.23.0.pre.alpha.PLAY1284investigation2657 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.24.0 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.22.0.pre.alpha.pbntr254barchartnegativenumber2640 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.22.0.pre.alpha.PLAY1297updatetextstyles2636 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.22.0.pre.alpha.playbookgemspecrailsversion2608 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.23.0 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.21.0.pre.alpha.PLAY12582531 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.21.0.pre.alpha.PLAY12582516 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.21.0.pre.alpha.PLAY12582515 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.21.0.pre.alpha.PLAY12582514 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.22.0 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.21.0.pre.alpha.PBNTR243globalpositioningpropinset2504 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.21.0.pre.alpha.PLAY12652489 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.21.0.pre.alpha.PLAY12582474 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.21.0.pre.alpha.PBNTR224letuserresetrowexpansion2466 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.21.0.pre.alpha.PLAY120322465 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js
playbook_ui-13.21.0.pre.alpha.pbntr220improveexpansionspeed2451 app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js