Sha256: 074e8c48ba2ce2fa841d1fc2eacf3f933d57d982b5a5730c9e032e84e2ceb002

Contents?: true

Size: 864 Bytes

Versions: 19

Compression:

Stored size: 864 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('displays max file size text', () => {
  render(
    <FileUpload
        data={{ testid: testid }}
        maxSize={1e+6}
    />
  )

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

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
playbook_ui-11.19.0.pre.alpha.map1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.19.0.pre.alpha.pagpassthrough1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.19.0 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.18.0.pre.alpha.pagutility1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.19.0.pre.typeahead1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.18.0 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.17.0 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.15.0.pre.alpha.dependencies1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.16.0.pre.alpha.paginationrails1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.16.0 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.16.0.pre.alpha.reactupgrade1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.15.0.pre.alpha.table1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.16.0.pre.alpha.pagination.rails1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.15.0 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.14.0 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.13.0.pre.alpha.fontawesome1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.13.0 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.13.0.pre.alpha.fileupload1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.9.0.pre.alpha.fileupload1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js