@patternfly/react-core 4.203.0 → 4.203.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatusItem.d.ts +4 -2
  3. package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatusItem.d.ts.map +1 -1
  4. package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatusItem.js +2 -2
  5. package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatusItem.js.map +1 -1
  6. package/dist/esm/components/Pagination/OptionsToggle.d.ts +10 -6
  7. package/dist/esm/components/Pagination/OptionsToggle.d.ts.map +1 -1
  8. package/dist/esm/components/Pagination/OptionsToggle.js +10 -4
  9. package/dist/esm/components/Pagination/OptionsToggle.js.map +1 -1
  10. package/dist/esm/components/Pagination/Pagination.d.ts +7 -3
  11. package/dist/esm/components/Pagination/Pagination.d.ts.map +1 -1
  12. package/dist/esm/components/Pagination/Pagination.js +5 -4
  13. package/dist/esm/components/Pagination/Pagination.js.map +1 -1
  14. package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts +12 -8
  15. package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
  16. package/dist/esm/components/Pagination/PaginationOptionsMenu.js +6 -5
  17. package/dist/esm/components/Pagination/PaginationOptionsMenu.js.map +1 -1
  18. package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatusItem.d.ts +4 -2
  19. package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatusItem.d.ts.map +1 -1
  20. package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatusItem.js +2 -2
  21. package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatusItem.js.map +1 -1
  22. package/dist/js/components/Pagination/OptionsToggle.d.ts +10 -6
  23. package/dist/js/components/Pagination/OptionsToggle.d.ts.map +1 -1
  24. package/dist/js/components/Pagination/OptionsToggle.js +10 -4
  25. package/dist/js/components/Pagination/OptionsToggle.js.map +1 -1
  26. package/dist/js/components/Pagination/Pagination.d.ts +7 -3
  27. package/dist/js/components/Pagination/Pagination.d.ts.map +1 -1
  28. package/dist/js/components/Pagination/Pagination.js +5 -4
  29. package/dist/js/components/Pagination/Pagination.js.map +1 -1
  30. package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts +12 -8
  31. package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
  32. package/dist/js/components/Pagination/PaginationOptionsMenu.js +6 -5
  33. package/dist/js/components/Pagination/PaginationOptionsMenu.js.map +1 -1
  34. package/dist/umd/react-core.css +69 -69
  35. package/dist/umd/react-core.js +23 -15
  36. package/dist/umd/react-core.min.js +1 -1
  37. package/package.json +5 -5
  38. package/src/components/MultipleFileUpload/MultipleFileUploadStatusItem.tsx +6 -2
  39. package/src/components/MultipleFileUpload/__tests__/MultipleFileUpload.test.tsx +8 -8
  40. package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadButton.test.tsx +7 -7
  41. package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadInfo.test.tsx +5 -5
  42. package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadMain.test.tsx +11 -11
  43. package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadStatus.test.tsx +11 -9
  44. package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadStatusItem.test.tsx +28 -13
  45. package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadTitle.test.tsx +11 -11
  46. package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadTitleIcon.test.tsx +5 -5
  47. package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadTitleText.test.tsx +5 -5
  48. package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadTitleTextSeparator.test.tsx +7 -5
  49. package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUpload.test.tsx.snap +42 -124
  50. package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadButton.test.tsx.snap +36 -86
  51. package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadInfo.test.tsx.snap +6 -8
  52. package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadMain.test.tsx.snap +85 -179
  53. package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadStatus.test.tsx.snap +188 -383
  54. package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadStatusItem.test.tsx.snap +596 -330
  55. package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadTitle.test.tsx.snap +32 -49
  56. package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadTitleIcon.test.tsx.snap +9 -11
  57. package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadTitleText.test.tsx.snap +6 -8
  58. package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadTitleTextSeparator.test.tsx.snap +6 -8
  59. package/src/components/Pagination/OptionsToggle.tsx +56 -46
  60. package/src/components/Pagination/Pagination.tsx +12 -5
  61. package/src/components/Pagination/PaginationOptionsMenu.tsx +20 -12
  62. package/src/components/Pagination/__tests__/Generated/__snapshots__/OptionsToggle.test.tsx.snap +1 -0
  63. package/src/components/Pagination/__tests__/Pagination.test.tsx +6 -4
  64. package/src/components/Pagination/__tests__/__snapshots__/Pagination.test.tsx.snap +223 -0
  65. package/src/components/Pagination/examples/Pagination.md +11 -1
  66. package/src/components/TimePicker/__tests__/TimePicker.test.tsx +1 -1
  67. package/src/components/Dropdown/__tests__/Generated/InternalDropdownItem.test.tsx +0 -42
  68. package/src/components/Dropdown/__tests__/Generated/__snapshots__/InternalDropdownItem.test.tsx.snap +0 -10
  69. package/src/components/Select/__tests__/Generated/SelectGroup.test.tsx +0 -25
  70. package/src/components/Select/__tests__/Generated/SelectMenu.test.tsx +0 -25
  71. package/src/components/Select/__tests__/Generated/__snapshots__/SelectGroup.test.tsx.snap +0 -18
  72. package/src/components/Select/__tests__/Generated/__snapshots__/SelectMenu.test.tsx.snap +0 -10
  73. package/src/components/Toolbar/__tests__/Generated/ToolbarToggleGroup.test.tsx +0 -27
  74. package/src/components/Toolbar/__tests__/Generated/__snapshots__/ToolbarToggleGroup.test.tsx.snap +0 -29
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "4.203.0",
3
+ "version": "4.203.1",
4
4
  "description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
5
5
  "main": "dist/js/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -34,9 +34,9 @@
34
34
  "generate": "node scripts/copyStyles.js"
35
35
  },
36
36
  "dependencies": {
37
- "@patternfly/react-icons": "^4.54.0",
38
- "@patternfly/react-styles": "^4.53.0",
39
- "@patternfly/react-tokens": "^4.55.0",
37
+ "@patternfly/react-icons": "^4.54.1",
38
+ "@patternfly/react-styles": "^4.53.1",
39
+ "@patternfly/react-tokens": "^4.55.1",
40
40
  "focus-trap": "6.2.2",
41
41
  "react-dropzone": "9.0.0",
42
42
  "tippy.js": "5.1.2",
@@ -60,5 +60,5 @@
60
60
  "react": "^16.8.0 || ^17.0.0",
61
61
  "react-dom": "^16.8.0 || ^17.0.0"
62
62
  },
63
- "gitHead": "3a30fbb3c5935b2e9a0fbb6336b1b45cfca46a7a"
63
+ "gitHead": "2f16e9b81a8ab2c54d9ef945e50c1e4aa7510c49"
64
64
  }
@@ -41,10 +41,12 @@ export interface MultipleFileUploadStatusItemProps extends React.HTMLProps<HTMLL
41
41
 
42
42
  // Props passed through to the progress component
43
43
 
44
- /** Adds accessible text to the ProgressBar. Required when title not used and there is not any label associated with the progress bar */
44
+ /** Adds accessible text to the progress bar. Required when title not used and there is not any label associated with the progress bar */
45
45
  progressAriaLabel?: string;
46
- /** Associates the ProgressBar with it's label for accessibility purposes. Required when title not used */
46
+ /** Associates the progress bar with it's label for accessibility purposes. Required when title not used */
47
47
  progressAriaLabelledBy?: string;
48
+ /** Unique identifier for progress. Generated if not specified. */
49
+ progressId?: string;
48
50
  }
49
51
 
50
52
  export const MultipleFileUploadStatusItem: React.FunctionComponent<MultipleFileUploadStatusItemProps> = ({
@@ -63,6 +65,7 @@ export const MultipleFileUploadStatusItem: React.FunctionComponent<MultipleFileU
63
65
  progressVariant,
64
66
  progressAriaLabel,
65
67
  progressAriaLabelledBy,
68
+ progressId,
66
69
  buttonAriaLabel = 'Remove from list',
67
70
  ...props
68
71
  }: MultipleFileUploadStatusItemProps) => {
@@ -137,6 +140,7 @@ export const MultipleFileUploadStatusItem: React.FunctionComponent<MultipleFileU
137
140
  variant={progressVariant || loadResult}
138
141
  aria-label={progressAriaLabel}
139
142
  aria-labelledby={progressAriaLabelledBy}
143
+ id={progressId}
140
144
  />
141
145
  </div>
142
146
  <div className={styles.multipleFileUploadStatusItemClose}>
@@ -1,20 +1,20 @@
1
1
  import React from 'react';
2
- import { mount } from 'enzyme';
2
+ import { render } from '@testing-library/react';
3
3
  import { MultipleFileUpload } from '../MultipleFileUpload';
4
4
 
5
5
  describe('MultipleFileUpload', () => {
6
6
  test('renders with expected class names when not horizontal', () => {
7
- const view = mount(<MultipleFileUpload>Foo</MultipleFileUpload>);
8
- expect(view).toMatchSnapshot();
7
+ const { asFragment } = render(<MultipleFileUpload>Foo</MultipleFileUpload>);
8
+ expect(asFragment()).toMatchSnapshot();
9
9
  });
10
10
 
11
11
  test('renders with expected class names when horizontal', () => {
12
- const view = mount(<MultipleFileUpload isHorizontal>Foo</MultipleFileUpload>);
13
- expect(view).toMatchSnapshot();
12
+ const { asFragment } = render(<MultipleFileUpload isHorizontal>Foo</MultipleFileUpload>);
13
+ expect(asFragment()).toMatchSnapshot();
14
14
  });
15
15
 
16
16
  test('renders custom class names', () => {
17
- const view = mount(<MultipleFileUpload className='test'>Foo</MultipleFileUpload>);
18
- expect(view).toMatchSnapshot();
17
+ const { asFragment } = render(<MultipleFileUpload className="test">Foo</MultipleFileUpload>);
18
+ expect(asFragment()).toMatchSnapshot();
19
19
  });
20
- })
20
+ });
@@ -1,20 +1,20 @@
1
1
  import React from 'react';
2
- import { mount } from 'enzyme';
2
+ import { render } from '@testing-library/react';
3
3
  import { MultipleFileUploadButton } from '../MultipleFileUploadButton';
4
4
 
5
5
  describe('MultipleFileUploadButton', () => {
6
6
  test('renders with expected class names', () => {
7
- const view = mount(<MultipleFileUploadButton>Foo</MultipleFileUploadButton>);
8
- expect(view).toMatchSnapshot();
7
+ const { asFragment } = render(<MultipleFileUploadButton>Foo</MultipleFileUploadButton>);
8
+ expect(asFragment()).toMatchSnapshot();
9
9
  });
10
10
 
11
11
  test('renders custom class names', () => {
12
- const view = mount(<MultipleFileUploadButton className="test">Foo</MultipleFileUploadButton>);
13
- expect(view).toMatchSnapshot();
12
+ const { asFragment } = render(<MultipleFileUploadButton className="test">Foo</MultipleFileUploadButton>);
13
+ expect(asFragment()).toMatchSnapshot();
14
14
  });
15
15
 
16
16
  test('renders with aria-label applied to the button', () => {
17
- const view = mount(<MultipleFileUploadButton aria-label="test">Foo</MultipleFileUploadButton>);
18
- expect(view).toMatchSnapshot();
17
+ const { asFragment } = render(<MultipleFileUploadButton aria-label="test">Foo</MultipleFileUploadButton>);
18
+ expect(asFragment()).toMatchSnapshot();
19
19
  });
20
20
  });
@@ -1,15 +1,15 @@
1
1
  import React from 'react';
2
- import { mount } from 'enzyme';
2
+ import { render } from '@testing-library/react';
3
3
  import { MultipleFileUploadInfo } from '../MultipleFileUploadInfo';
4
4
 
5
5
  describe('MultipleFileUploadInfo', () => {
6
6
  test('renders with expected class names', () => {
7
- const view = mount(<MultipleFileUploadInfo>Foo</MultipleFileUploadInfo>);
8
- expect(view).toMatchSnapshot();
7
+ const { asFragment } = render(<MultipleFileUploadInfo>Foo</MultipleFileUploadInfo>);
8
+ expect(asFragment()).toMatchSnapshot();
9
9
  });
10
10
 
11
11
  test('renders custom class names', () => {
12
- const view = mount(<MultipleFileUploadInfo className="test">Foo</MultipleFileUploadInfo>);
13
- expect(view).toMatchSnapshot();
12
+ const { asFragment } = render(<MultipleFileUploadInfo className="test">Foo</MultipleFileUploadInfo>);
13
+ expect(asFragment()).toMatchSnapshot();
14
14
  });
15
15
  });
@@ -1,32 +1,32 @@
1
1
  import React from 'react';
2
- import { mount } from 'enzyme';
2
+ import { render } from '@testing-library/react';
3
3
  import { MultipleFileUploadMain } from '../MultipleFileUploadMain';
4
4
 
5
5
  describe('MultipleFileUploadMain', () => {
6
6
  test('renders with expected class names', () => {
7
- const view = mount(<MultipleFileUploadMain />);
8
- expect(view).toMatchSnapshot();
7
+ const { asFragment } = render(<MultipleFileUploadMain />);
8
+ expect(asFragment()).toMatchSnapshot();
9
9
  });
10
10
 
11
11
  test('renders custom class names', () => {
12
- const view = mount(<MultipleFileUploadMain className="test" />);
13
- expect(view).toMatchSnapshot();
12
+ const { asFragment } = render(<MultipleFileUploadMain className="test" />);
13
+ expect(asFragment()).toMatchSnapshot();
14
14
  });
15
15
 
16
16
  test('passes props to the title as expected', () => {
17
- const view = mount(
17
+ const { asFragment } = render(
18
18
  <MultipleFileUploadMain titleIcon="icon" titleText="title text" titleTextSeparator="title test separator" />
19
19
  );
20
- expect(view).toMatchSnapshot();
20
+ expect(asFragment()).toMatchSnapshot();
21
21
  });
22
22
 
23
23
  test('renders without the button when expected', () => {
24
- const view = mount(<MultipleFileUploadMain isUploadButtonHidden />);
25
- expect(view).toMatchSnapshot();
24
+ const { asFragment } = render(<MultipleFileUploadMain isUploadButtonHidden />);
25
+ expect(asFragment()).toMatchSnapshot();
26
26
  });
27
27
 
28
28
  test('passes props to the info component as expected', () => {
29
- const view = mount(<MultipleFileUploadMain infoText="info text" />);
30
- expect(view).toMatchSnapshot();
29
+ const { asFragment } = render(<MultipleFileUploadMain infoText="info text" />);
30
+ expect(asFragment()).toMatchSnapshot();
31
31
  });
32
32
  });
@@ -1,26 +1,28 @@
1
1
  import React from 'react';
2
- import { mount } from 'enzyme';
2
+ import { render, screen } from '@testing-library/react';
3
3
  import { MultipleFileUploadStatus } from '../MultipleFileUploadStatus';
4
4
  import InProgressIcon from '@patternfly/react-icons/dist/esm/icons/in-progress-icon';
5
5
 
6
6
  describe('MultipleFileUploadStatus', () => {
7
7
  test('renders with expected class names', () => {
8
- const view = mount(<MultipleFileUploadStatus>Foo</MultipleFileUploadStatus>);
9
- expect(view).toMatchSnapshot();
8
+ const { asFragment } = render(<MultipleFileUploadStatus>Foo</MultipleFileUploadStatus>);
9
+ expect(asFragment()).toMatchSnapshot();
10
10
  });
11
11
 
12
12
  test('renders custom class names', () => {
13
- const view = mount(<MultipleFileUploadStatus className="test">Foo</MultipleFileUploadStatus>);
14
- expect(view).toMatchSnapshot();
13
+ const { asFragment } = render(<MultipleFileUploadStatus className="test">Foo</MultipleFileUploadStatus>);
14
+ expect(asFragment()).toMatchSnapshot();
15
15
  });
16
16
 
17
17
  test('renders status toggle text', () => {
18
- const view = mount(<MultipleFileUploadStatus statusToggleText='test'>Foo</MultipleFileUploadStatus>);
19
- expect(view).toMatchSnapshot();
18
+ const { asFragment } = render(<MultipleFileUploadStatus statusToggleText="test">Foo</MultipleFileUploadStatus>);
19
+ expect(asFragment()).toMatchSnapshot();
20
20
  });
21
21
 
22
22
  test('renders status toggle icon', () => {
23
- const view = mount(<MultipleFileUploadStatus statusToggleIcon={<InProgressIcon />}>Foo</MultipleFileUploadStatus>);
24
- expect(view).toMatchSnapshot();
23
+ const { asFragment } = render(
24
+ <MultipleFileUploadStatus statusToggleIcon={<InProgressIcon />}>Foo</MultipleFileUploadStatus>
25
+ );
26
+ expect(asFragment()).toMatchSnapshot();
25
27
  });
26
28
  });
@@ -1,54 +1,69 @@
1
1
  import React from 'react';
2
- import { shallow } from 'enzyme';
2
+
3
+ import { render, screen } from '@testing-library/react';
4
+
3
5
  import { MultipleFileUploadStatusItem } from '../MultipleFileUploadStatusItem';
4
6
  import FileImageIcon from '@patternfly/react-icons/dist/esm/icons/file-image-icon';
5
7
 
6
8
  describe('MultipleFileUploadStatusItem', () => {
7
9
  test('renders with expected class names', () => {
8
- const view = shallow(<MultipleFileUploadStatusItem />);
9
- expect(view).toMatchSnapshot();
10
+ const { asFragment } = render(<MultipleFileUploadStatusItem progressId="test-progress-id" />);
11
+ expect(asFragment()).toMatchSnapshot();
10
12
  });
11
13
 
12
14
  test('renders custom class names', () => {
13
- const view = shallow(<MultipleFileUploadStatusItem className="test" />);
14
- expect(view).toMatchSnapshot();
15
+ const { asFragment } = render(<MultipleFileUploadStatusItem className="test" progressId="test-progress-id" />);
16
+ expect(asFragment()).toMatchSnapshot();
15
17
  });
16
18
 
17
19
  test('renders expected values from a passed file object', () => {
18
20
  const testFile = new File(['foo'], 'testFile.txt');
19
- const view = shallow(<MultipleFileUploadStatusItem file={testFile} />);
20
- expect(view).toMatchSnapshot();
21
+ const { asFragment } = render(<MultipleFileUploadStatusItem file={testFile} progressId="test-progress-id" />);
22
+
23
+ expect(asFragment()).toMatchSnapshot();
21
24
  });
22
25
 
23
26
  test('renders custom file name/size/icon when passed', () => {
24
27
  const testFile = new File(['foo'], 'testFile.txt');
25
- const view = shallow(
28
+ const { asFragment } = render(
26
29
  <MultipleFileUploadStatusItem
27
30
  file={testFile}
28
31
  fileIcon={<FileImageIcon />}
29
32
  fileName="testCustomFileName.txt"
30
33
  fileSize={42}
34
+ progressId="test-progress-id"
31
35
  />
32
36
  );
33
- expect(view).toMatchSnapshot();
37
+
38
+ expect(asFragment()).toMatchSnapshot();
34
39
  });
35
40
 
36
41
  test('renders custom progress value/variant when passed', () => {
37
42
  const testFile = new File(['foo'], 'testFile.txt');
38
- const view = shallow(<MultipleFileUploadStatusItem file={testFile} progressValue={42} progressVariant="warning" />);
39
- expect(view).toMatchSnapshot();
43
+ const { asFragment } = render(
44
+ <MultipleFileUploadStatusItem
45
+ file={testFile}
46
+ progressValue={42}
47
+ progressVariant="warning"
48
+ progressId="test-progress-id"
49
+ />
50
+ );
51
+
52
+ expect(asFragment()).toMatchSnapshot();
40
53
  });
41
54
 
42
55
  test('renders custom aria labels', () => {
43
56
  const testFile = new File(['foo'], 'testFile.txt');
44
- const view = shallow(
57
+ const { asFragment } = render(
45
58
  <MultipleFileUploadStatusItem
46
59
  file={testFile}
47
60
  buttonAriaLabel="buttonAriaLabel"
48
61
  progressAriaLabel="progressAriaLabel"
49
62
  progressAriaLabelledBy="progressAriaLabelledBy"
63
+ progressId="test-progress-id"
50
64
  />
51
65
  );
52
- expect(view).toMatchSnapshot();
66
+
67
+ expect(asFragment()).toMatchSnapshot();
53
68
  });
54
69
  });
@@ -1,30 +1,30 @@
1
1
  import React from 'react';
2
- import { mount } from 'enzyme';
2
+ import { render, screen } from '@testing-library/react';
3
3
  import { MultipleFileUploadTitle } from '../MultipleFileUploadTitle';
4
4
 
5
5
  describe('MultipleFileUploadTitle', () => {
6
6
  test('renders with expected class names', () => {
7
- const view = mount(<MultipleFileUploadTitle />);
8
- expect(view).toMatchSnapshot();
7
+ const { asFragment } = render(<MultipleFileUploadTitle />);
8
+ expect(asFragment()).toMatchSnapshot();
9
9
  });
10
10
 
11
11
  test('renders custom class names', () => {
12
- const view = mount(<MultipleFileUploadTitle className="test" />);
13
- expect(view).toMatchSnapshot();
12
+ const { asFragment } = render(<MultipleFileUploadTitle className="test" />);
13
+ expect(asFragment()).toMatchSnapshot();
14
14
  });
15
15
 
16
16
  test('renders with title icon', () => {
17
- const view = mount(<MultipleFileUploadTitle icon="icon" />);
18
- expect(view).toMatchSnapshot();
17
+ const { asFragment } = render(<MultipleFileUploadTitle icon="icon" />);
18
+ expect(asFragment()).toMatchSnapshot();
19
19
  });
20
20
 
21
21
  test('renders with title text', () => {
22
- const view = mount(<MultipleFileUploadTitle text="text" />);
23
- expect(view).toMatchSnapshot();
22
+ const { asFragment } = render(<MultipleFileUploadTitle text="text" />);
23
+ expect(asFragment()).toMatchSnapshot();
24
24
  });
25
25
 
26
26
  test('renders with title text separator', () => {
27
- const view = mount(<MultipleFileUploadTitle text="text" textSeparator="text separator" />);
28
- expect(view).toMatchSnapshot();
27
+ const { asFragment } = render(<MultipleFileUploadTitle text="text" textSeparator="text separator" />);
28
+ expect(asFragment()).toMatchSnapshot();
29
29
  });
30
30
  });
@@ -1,15 +1,15 @@
1
1
  import React from 'react';
2
- import { mount } from 'enzyme';
2
+ import { render, screen } from '@testing-library/react';
3
3
  import { MultipleFileUploadTitleIcon } from '../MultipleFileUploadTitleIcon';
4
4
 
5
5
  describe('MultipleFileUploadTitleIcon', () => {
6
6
  test('renders with expected class names', () => {
7
- const view = mount(<MultipleFileUploadTitleIcon>Foo</MultipleFileUploadTitleIcon>);
8
- expect(view).toMatchSnapshot();
7
+ const { asFragment } = render(<MultipleFileUploadTitleIcon data-testid="test-id" />);
8
+ expect(asFragment()).toMatchSnapshot();
9
9
  });
10
10
 
11
11
  test('renders custom class names', () => {
12
- const view = mount(<MultipleFileUploadTitleIcon className="test" />);
13
- expect(view).toMatchSnapshot();
12
+ const { asFragment } = render(<MultipleFileUploadTitleIcon className="test" data-testid="test-id" />);
13
+ expect(asFragment()).toMatchSnapshot();
14
14
  });
15
15
  });
@@ -1,15 +1,15 @@
1
1
  import React from 'react';
2
- import { mount } from 'enzyme';
2
+ import { render, screen } from '@testing-library/react';
3
3
  import { MultipleFileUploadTitleText } from '../MultipleFileUploadTitleText';
4
4
 
5
5
  describe('MultipleFileUploadTitleText', () => {
6
6
  test('renders with expected class names', () => {
7
- const view = mount(<MultipleFileUploadTitleText>Foo</MultipleFileUploadTitleText>);
8
- expect(view).toMatchSnapshot();
7
+ const { asFragment } = render(<MultipleFileUploadTitleText>Foo</MultipleFileUploadTitleText>);
8
+ expect(asFragment()).toMatchSnapshot();
9
9
  });
10
10
 
11
11
  test('renders custom class names', () => {
12
- const view = mount(<MultipleFileUploadTitleText className="test">Foo</MultipleFileUploadTitleText>);
13
- expect(view).toMatchSnapshot();
12
+ const { asFragment } = render(<MultipleFileUploadTitleText className="test">Foo</MultipleFileUploadTitleText>);
13
+ expect(asFragment()).toMatchSnapshot();
14
14
  });
15
15
  });
@@ -1,15 +1,17 @@
1
1
  import React from 'react';
2
- import { mount } from 'enzyme';
2
+ import { render, screen } from '@testing-library/react';
3
3
  import { MultipleFileUploadTitleTextSeparator } from '../MultipleFileUploadTitleTextSeparator';
4
4
 
5
5
  describe('MultipleFileUploadTitleTextSeparator', () => {
6
6
  test('renders with expected class names', () => {
7
- const view = mount(<MultipleFileUploadTitleTextSeparator>Foo</MultipleFileUploadTitleTextSeparator>);
8
- expect(view).toMatchSnapshot();
7
+ const { asFragment } = render(<MultipleFileUploadTitleTextSeparator>Foo</MultipleFileUploadTitleTextSeparator>);
8
+ expect(asFragment()).toMatchSnapshot();
9
9
  });
10
10
 
11
11
  test('renders custom class names', () => {
12
- const view = mount(<MultipleFileUploadTitleTextSeparator className="test">Foo</MultipleFileUploadTitleTextSeparator>);
13
- expect(view).toMatchSnapshot();
12
+ const { asFragment } = render(
13
+ <MultipleFileUploadTitleTextSeparator className="test">Foo</MultipleFileUploadTitleTextSeparator>
14
+ );
15
+ expect(asFragment()).toMatchSnapshot();
14
16
  });
15
17
  });
@@ -1,137 +1,55 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`MultipleFileUpload renders custom class names 1`] = `
4
- <MultipleFileUpload
5
- className="test"
6
- >
7
- <t
8
- disabled={false}
9
- getDataTransferItems={[Function]}
10
- maxSize={Infinity}
11
- minSize={0}
12
- multiple={true}
13
- onDropAccepted={[Function]}
14
- onDropRejected={[Function]}
15
- preventDropOnDocument={true}
4
+ <DocumentFragment>
5
+ <div
6
+ class="pf-c-multiple-file-upload test"
7
+ tabindex="0"
16
8
  >
17
- <div
18
- className="pf-c-multiple-file-upload test"
19
- onBlur={[Function]}
20
- onClick={[Function]}
21
- onDragEnter={[Function]}
22
- onDragLeave={[Function]}
23
- onDragOver={[Function]}
24
- onDragStart={[Function]}
25
- onDrop={[Function]}
26
- onFocus={[Function]}
27
- onKeyDown={[Function]}
28
- tabIndex={0}
29
- >
30
- <input
31
- autoComplete="off"
32
- multiple={true}
33
- onChange={[Function]}
34
- onClick={[Function]}
35
- style={
36
- Object {
37
- "display": "none",
38
- }
39
- }
40
- tabIndex={-1}
41
- type="file"
42
- />
43
- Foo
44
- </div>
45
- </t>
46
- </MultipleFileUpload>
9
+ <input
10
+ autocomplete="off"
11
+ multiple=""
12
+ style="display: none;"
13
+ tabindex="-1"
14
+ type="file"
15
+ />
16
+ Foo
17
+ </div>
18
+ </DocumentFragment>
47
19
  `;
48
20
 
49
21
  exports[`MultipleFileUpload renders with expected class names when horizontal 1`] = `
50
- <MultipleFileUpload
51
- isHorizontal={true}
52
- >
53
- <t
54
- disabled={false}
55
- getDataTransferItems={[Function]}
56
- maxSize={Infinity}
57
- minSize={0}
58
- multiple={true}
59
- onDropAccepted={[Function]}
60
- onDropRejected={[Function]}
61
- preventDropOnDocument={true}
22
+ <DocumentFragment>
23
+ <div
24
+ class="pf-c-multiple-file-upload pf-m-horizontal"
25
+ tabindex="0"
62
26
  >
63
- <div
64
- className="pf-c-multiple-file-upload pf-m-horizontal"
65
- onBlur={[Function]}
66
- onClick={[Function]}
67
- onDragEnter={[Function]}
68
- onDragLeave={[Function]}
69
- onDragOver={[Function]}
70
- onDragStart={[Function]}
71
- onDrop={[Function]}
72
- onFocus={[Function]}
73
- onKeyDown={[Function]}
74
- tabIndex={0}
75
- >
76
- <input
77
- autoComplete="off"
78
- multiple={true}
79
- onChange={[Function]}
80
- onClick={[Function]}
81
- style={
82
- Object {
83
- "display": "none",
84
- }
85
- }
86
- tabIndex={-1}
87
- type="file"
88
- />
89
- Foo
90
- </div>
91
- </t>
92
- </MultipleFileUpload>
27
+ <input
28
+ autocomplete="off"
29
+ multiple=""
30
+ style="display: none;"
31
+ tabindex="-1"
32
+ type="file"
33
+ />
34
+ Foo
35
+ </div>
36
+ </DocumentFragment>
93
37
  `;
94
38
 
95
39
  exports[`MultipleFileUpload renders with expected class names when not horizontal 1`] = `
96
- <MultipleFileUpload>
97
- <t
98
- disabled={false}
99
- getDataTransferItems={[Function]}
100
- maxSize={Infinity}
101
- minSize={0}
102
- multiple={true}
103
- onDropAccepted={[Function]}
104
- onDropRejected={[Function]}
105
- preventDropOnDocument={true}
40
+ <DocumentFragment>
41
+ <div
42
+ class="pf-c-multiple-file-upload"
43
+ tabindex="0"
106
44
  >
107
- <div
108
- className="pf-c-multiple-file-upload"
109
- onBlur={[Function]}
110
- onClick={[Function]}
111
- onDragEnter={[Function]}
112
- onDragLeave={[Function]}
113
- onDragOver={[Function]}
114
- onDragStart={[Function]}
115
- onDrop={[Function]}
116
- onFocus={[Function]}
117
- onKeyDown={[Function]}
118
- tabIndex={0}
119
- >
120
- <input
121
- autoComplete="off"
122
- multiple={true}
123
- onChange={[Function]}
124
- onClick={[Function]}
125
- style={
126
- Object {
127
- "display": "none",
128
- }
129
- }
130
- tabIndex={-1}
131
- type="file"
132
- />
133
- Foo
134
- </div>
135
- </t>
136
- </MultipleFileUpload>
45
+ <input
46
+ autocomplete="off"
47
+ multiple=""
48
+ style="display: none;"
49
+ tabindex="-1"
50
+ type="file"
51
+ />
52
+ Foo
53
+ </div>
54
+ </DocumentFragment>
137
55
  `;