Sha256: 0cce9e09f7a9360d7502a206f22932f368590593dd45cdf4d2e1a71d2dfe909d

Contents?: true

Size: 1.01 KB

Versions: 11

Compression:

Stored size: 1.01 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_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

11 entries across 11 versions & 1 rubygems

Version Path
playbook_ui-10.23.0.pre.cachetest app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-10.21.0.pre.alpha.rg1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-10.21.0.pre.alpha.jg1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-10.21.0.pre.alpha.na1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-10.20.0 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-10.19.0 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-10.19.0.pre.lightbox app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-10.18.2 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-10.19.0.pre.popover.alpha1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-10.18.1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-10.18.0 app/pb_kits/playbook/pb_image/image.test.js