Sha256: 3c553de423c58b5b49824a61550f37fd3c9279d67df66ff10c1e76220edacd84

Contents?: true

Size: 892 Bytes

Versions: 77

Compression:

Stored size: 892 Bytes

Contents

import React from 'react'
import { render, screen } from '../utilities/test-utils'

import FileUpload from './_file_upload'

const testid = 'fileupload-test'

test('returns namespaced class name', () => {
  render(
    <FileUpload
        data={{ testid: testid }}
    />
  )

  const kit = screen.getByTestId(testid)
  expect(kit).toHaveClass('pb_file_upload_kit')
})

test('shows default drag text', () => {
  render(
    <FileUpload
        data={{ testid: testid }}
    />
  )

  const kit = screen.getByTestId(testid)
  expect(kit).toHaveTextContent('Choose a file or drag it here')
})

test('shows type-specific drag text', () => {
  render(
    <FileUpload
        accept={['image/svg+xml']}
        data={{ testid: testid }}
    />
  )

  const kit = screen.getByTestId(testid)
  expect(kit).toHaveTextContent('Choose a file or drag it here. The accepted file types are: svg+xml')
})

Version data entries

77 entries across 77 versions & 1 rubygems

Version Path
playbook_ui-10.26.0.pre.alpha3 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-10.25.1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-10.26.0.pre.alpha1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-10.25.0 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-10.25.0.pre.alpha3 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-10.25.0.pre.treeshaking1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-10.24.0 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-10.24.0.pre.alpha1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-10.23.0 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-10.23.0.pre.alpha2 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-10.23.0.pre.alpha1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-10.22.1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-10.22.0 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-10.21.1.pre.alpha1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-10.21.0.pre.alpha.lightbox.2 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-10.21.0 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-10.21.0.pre.alpha.lightbox app/pb_kits/playbook/pb_file_upload/fileupload.test.js