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-11.12.1.pre.alpha.charts1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.12.1.pre.alpha.passphrase1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.12.1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.12.0 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.11.0.pre.alpha.paginate2 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.11.0.pre.alpha.dialog2 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.11.0.pre.alpha.paginate1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.11.0.pre.alpha.renderer1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.11.0.pre.alpha.dialog1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.11.0 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.10.0.pre.alpha.pre.bold1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.10.0.pre.alpha.pagination1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.10.0 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.9.0 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.8.1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.8.0 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.7.0.pre.alpha.table1 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.7.0 app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.6.0.pre.alpha.fontawesome app/pb_kits/playbook/pb_file_upload/fileupload.test.js
playbook_ui-11.5.0.pre.alpha.fontawesome app/pb_kits/playbook/pb_file_upload/fileupload.test.js