Sha256: 3076beaabfa9000b52455243ca6aec9bb996efb4c8424f80f04d70a214fa4e0f

Contents?: true

Size: 1.02 KB

Versions: 1059

Compression:

Stored size: 1.02 KB

Contents

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

import Image from './_image'

const props = {
  alt: 'picture of misty forest',
  data: { testid: 'avatar' },
  size: null,
  url: 'https://unsplash.it/500/400/?image=634',
  transition: 'blur',
}

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

test('alt attribute', () => {
  const kit = renderKit(Image, props)
  expect(kit).toHaveAttribute('alt', props.alt)
})

test('default classname', () => {
  const kit = renderKit(Image, props)
  expect(kit).toHaveClass('pb_image_kit lazyload')
})

test('size = xs', () => {
  const kit = renderKit(Image, props, { size: 'xs' })
  expect(kit).toHaveClass('pb_image_kit_size_xs lazyload')
})

test('transition = blur', () => {
  const kit = renderKit(Image, props, { transition: 'blur' })
  expect(kit).toHaveClass('pb_image_kit lazyload blur')
})

test('rounded = true', () => {
  const kit = renderKit(Image, props, { rounded: true })
  expect(kit).toHaveClass('pb_image_kit lazyload rounded')
})

Version data entries

1,059 entries across 1,059 versions & 1 rubygems

Version Path
playbook_ui-14.11.0.pre.rc.17 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-14.11.0 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-14.11.0.pre.rc.16 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-14.10.0.pre.alpha.play16825301 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-14.11.0.pre.rc.15 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-14.11.0.pre.rc.14 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-14.11.0.pre.rc.13 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-14.11.0.pre.rc.12 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-14.10.0.pre.alpha.PLAY1774timelinelabelstepspacing5274 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-14.10.0.pre.alpha.play1465attempt25272 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-14.10.0.pre.alpha.play16825244 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-14.11.0.pre.rc.11 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-14.11.0.pre.rc.10 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5214 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5213 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5210 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5208 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5207 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-14.10.0.pre.alpha.play16825206 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-14.10.0.pre.alpha.play1662cssbargraph5204 app/pb_kits/playbook/pb_image/image.test.js