Sha256: cebd6eecc78530b0d42afbad31ab747fba48fc34eb6baf077f4dc36a74b041ba

Contents?: true

Size: 1.61 KB

Versions: 909

Compression:

Stored size: 1.61 KB

Contents

import { ensureAccessible, renderKit } from '../utilities/test-utils'

import Background from './_background'

const props = {
  data: { testid: 'background' },
  backgroundColor: null,
}

it('Should be accessible', async () => {
  ensureAccessible(Background, props)
})

test('backgroundColor = success', () => {
  const kit = renderKit(Background, props, { backgroundColor: 'success' })
  expect(kit).toHaveClass('pb_background_kit pb_background_color_success')
})

test('backgroundColor = category_1', () => {
  const kit = renderKit(Background, props, { backgroundColor: 'category_1' })
  expect(kit).toHaveClass('pb_background_kit pb_background_color_category_1')
})

test('customColor prop styles background color with a hex value', () => {
  const kit = renderKit(Background, props, { customColor: '#1d99a8' })

  expect(kit).toHaveClass('pb_background_kit pb_background_custom_color')
  expect(kit).toHaveStyle(`background-color: #1d99a8;`)
})

test('backgroundRepeat = repeat', () => {
  const kit = renderKit(Background, props, { classname: "background-image", imageUrl: "https://images.unsplash.com/photo-1528459801416-a9e53bbf4e17?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1000&q=80", backgroundRepeat: 'repeat' })
  expect(kit).toHaveStyle('background-repeat: repeat')
})

test('backgroundSize = auto', () => {
  const kit = renderKit(Background, props, { classname: "background-image", imageUrl: "https://images.unsplash.com/photo-1528459801416-a9e53bbf4e17?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1000&q=80", backgroundSize: 'auto' })
  expect(kit).toHaveStyle('background-size: auto')
})

Version data entries

909 entries across 909 versions & 1 rubygems

Version Path
playbook_ui-14.8.0.pre.alpha.PLAY1658tanstackbump4657 app/pb_kits/playbook/pb_background/background.test.js
playbook_ui-14.8.0.pre.alpha.PLAY1649rolloutheightglobalprops4635 app/pb_kits/playbook/pb_background/background.test.js
playbook_ui-14.9.0.pre.rc.8 app/pb_kits/playbook/pb_background/background.test.js
playbook_ui-14.8.0.pre.alpha.PLAY1598floatinguiupgrade4617 app/pb_kits/playbook/pb_background/background.test.js
playbook_ui-14.9.0.pre.rc.7 app/pb_kits/playbook/pb_background/background.test.js
playbook_ui-14.9.0.pre.rc.6 app/pb_kits/playbook/pb_background/background.test.js
playbook_ui-14.9.0.pre.rc.5 app/pb_kits/playbook/pb_background/background.test.js
playbook_ui-14.8.0.pre.alpha.pbntr661createstickyleftprop4612 app/pb_kits/playbook/pb_background/background.test.js
playbook_ui-14.8.0.pre.alpha.play1648heightglobalprops4606 app/pb_kits/playbook/pb_background/background.test.js
playbook_ui-14.9.0.pre.rc.4 app/pb_kits/playbook/pb_background/background.test.js
playbook_ui-14.9.0.pre.rc.3 app/pb_kits/playbook/pb_background/background.test.js
playbook_ui-14.9.0.pre.rc.2 app/pb_kits/playbook/pb_background/background.test.js
playbook_ui-14.8.0.pre.alpha.revert3916revert3893PBNTR667railstypeaheadformintegration4567 app/pb_kits/playbook/pb_background/background.test.js
playbook_ui-14.8.0.pre.alpha.revert3916revert3893PBNTR667railstypeaheadformintegration4565 app/pb_kits/playbook/pb_background/background.test.js
playbook_ui-14.8.0.pre.alpha.PLAY1598floatinguiupgrade4563 app/pb_kits/playbook/pb_background/background.test.js
playbook_ui-14.8.0.pre.alpha.play1648heightglobalprops4559 app/pb_kits/playbook/pb_background/background.test.js
playbook_ui-14.9.0.pre.rc.1 app/pb_kits/playbook/pb_background/background.test.js
playbook_ui-14.8.0.pre.alpha.PLAY16254545 app/pb_kits/playbook/pb_background/background.test.js
playbook_ui-14.8.0.pre.alpha.PLAY1615movenegativetoleftofcurrencysign4543 app/pb_kits/playbook/pb_background/background.test.js
playbook_ui-14.8.0.pre.alpha.PLAY1615movenegativetoleftofcurrencysign4539 app/pb_kits/playbook/pb_background/background.test.js