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-11.20.0.pre.alpha.focus1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-11.20.0 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-11.19.0.pre.alpha.map1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-11.19.0.pre.alpha.pagpassthrough1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-11.19.0 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-11.18.0.pre.alpha.pagutility1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-11.19.0.pre.typeahead1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-11.18.0 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-11.17.0 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-11.15.0.pre.alpha.dependencies1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-11.16.0.pre.alpha.paginationrails1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-11.16.0 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-11.16.0.pre.alpha.reactupgrade1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-11.15.0.pre.alpha.table1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-11.16.0.pre.alpha.pagination.rails1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-11.15.0 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-11.14.0 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-11.13.0.pre.alpha.fontawesome1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-11.13.0 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-11.12.1.pre.alpha.charts1 app/pb_kits/playbook/pb_image/image.test.js