Sha256: 7a72c0482532179a7a3e70f03e36947e5da95659540e851a9481996628a8952d

Contents?: true

Size: 885 Bytes

Versions: 124

Compression:

Stored size: 885 Bytes

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',
}

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 blur_up')
})

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

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

Version data entries

124 entries across 124 versions & 1 rubygems

Version Path
playbook_ui-9.3.0.alpha.inline1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-9.3.0.pre.alpha.password.strength.1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-9.3.0 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-9.2.2.pre.alpha.margin app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-9.2.2 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-9.2.1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-9.2.0 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-9.1.0 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-9.0.0 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-8.3.0.alpha.select.pre.margin app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-8.3.0 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-8.2.1.pre.alpha5 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-8.2.1.pre.alpha4 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-8.2.1.alpha.iconacc app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-8.2.1.pre.alpha3 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-8.2.1.pre.alpha2 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-8.3.0.deps2 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-8.3.0.pre.alpha1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-8.2.1.pre.alpha1 app/pb_kits/playbook/pb_image/image.test.js
playbook_ui-8.2.1 app/pb_kits/playbook/pb_image/image.test.js