@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.
- package/CHANGELOG.md +8 -0
- package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatusItem.d.ts +4 -2
- package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatusItem.d.ts.map +1 -1
- package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatusItem.js +2 -2
- package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatusItem.js.map +1 -1
- package/dist/esm/components/Pagination/OptionsToggle.d.ts +10 -6
- package/dist/esm/components/Pagination/OptionsToggle.d.ts.map +1 -1
- package/dist/esm/components/Pagination/OptionsToggle.js +10 -4
- package/dist/esm/components/Pagination/OptionsToggle.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.d.ts +7 -3
- package/dist/esm/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js +5 -4
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts +12 -8
- package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
- package/dist/esm/components/Pagination/PaginationOptionsMenu.js +6 -5
- package/dist/esm/components/Pagination/PaginationOptionsMenu.js.map +1 -1
- package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatusItem.d.ts +4 -2
- package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatusItem.d.ts.map +1 -1
- package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatusItem.js +2 -2
- package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatusItem.js.map +1 -1
- package/dist/js/components/Pagination/OptionsToggle.d.ts +10 -6
- package/dist/js/components/Pagination/OptionsToggle.d.ts.map +1 -1
- package/dist/js/components/Pagination/OptionsToggle.js +10 -4
- package/dist/js/components/Pagination/OptionsToggle.js.map +1 -1
- package/dist/js/components/Pagination/Pagination.d.ts +7 -3
- package/dist/js/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/js/components/Pagination/Pagination.js +5 -4
- package/dist/js/components/Pagination/Pagination.js.map +1 -1
- package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts +12 -8
- package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
- package/dist/js/components/Pagination/PaginationOptionsMenu.js +6 -5
- package/dist/js/components/Pagination/PaginationOptionsMenu.js.map +1 -1
- package/dist/umd/react-core.css +69 -69
- package/dist/umd/react-core.js +23 -15
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +5 -5
- package/src/components/MultipleFileUpload/MultipleFileUploadStatusItem.tsx +6 -2
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUpload.test.tsx +8 -8
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadButton.test.tsx +7 -7
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadInfo.test.tsx +5 -5
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadMain.test.tsx +11 -11
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadStatus.test.tsx +11 -9
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadStatusItem.test.tsx +28 -13
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadTitle.test.tsx +11 -11
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadTitleIcon.test.tsx +5 -5
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadTitleText.test.tsx +5 -5
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadTitleTextSeparator.test.tsx +7 -5
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUpload.test.tsx.snap +42 -124
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadButton.test.tsx.snap +36 -86
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadInfo.test.tsx.snap +6 -8
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadMain.test.tsx.snap +85 -179
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadStatus.test.tsx.snap +188 -383
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadStatusItem.test.tsx.snap +596 -330
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadTitle.test.tsx.snap +32 -49
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadTitleIcon.test.tsx.snap +9 -11
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadTitleText.test.tsx.snap +6 -8
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadTitleTextSeparator.test.tsx.snap +6 -8
- package/src/components/Pagination/OptionsToggle.tsx +56 -46
- package/src/components/Pagination/Pagination.tsx +12 -5
- package/src/components/Pagination/PaginationOptionsMenu.tsx +20 -12
- package/src/components/Pagination/__tests__/Generated/__snapshots__/OptionsToggle.test.tsx.snap +1 -0
- package/src/components/Pagination/__tests__/Pagination.test.tsx +6 -4
- package/src/components/Pagination/__tests__/__snapshots__/Pagination.test.tsx.snap +223 -0
- package/src/components/Pagination/examples/Pagination.md +11 -1
- package/src/components/TimePicker/__tests__/TimePicker.test.tsx +1 -1
- package/src/components/Dropdown/__tests__/Generated/InternalDropdownItem.test.tsx +0 -42
- package/src/components/Dropdown/__tests__/Generated/__snapshots__/InternalDropdownItem.test.tsx.snap +0 -10
- package/src/components/Select/__tests__/Generated/SelectGroup.test.tsx +0 -25
- package/src/components/Select/__tests__/Generated/SelectMenu.test.tsx +0 -25
- package/src/components/Select/__tests__/Generated/__snapshots__/SelectGroup.test.tsx.snap +0 -18
- package/src/components/Select/__tests__/Generated/__snapshots__/SelectMenu.test.tsx.snap +0 -10
- package/src/components/Toolbar/__tests__/Generated/ToolbarToggleGroup.test.tsx +0 -27
- 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.
|
|
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.
|
|
38
|
-
"@patternfly/react-styles": "^4.53.
|
|
39
|
-
"@patternfly/react-tokens": "^4.55.
|
|
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": "
|
|
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
|
|
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
|
|
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 {
|
|
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
|
|
8
|
-
expect(
|
|
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
|
|
13
|
-
expect(
|
|
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
|
|
18
|
-
expect(
|
|
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 {
|
|
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
|
|
8
|
-
expect(
|
|
7
|
+
const { asFragment } = render(<MultipleFileUploadButton>Foo</MultipleFileUploadButton>);
|
|
8
|
+
expect(asFragment()).toMatchSnapshot();
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
test('renders custom class names', () => {
|
|
12
|
-
const
|
|
13
|
-
expect(
|
|
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
|
|
18
|
-
expect(
|
|
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 {
|
|
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
|
|
8
|
-
expect(
|
|
7
|
+
const { asFragment } = render(<MultipleFileUploadInfo>Foo</MultipleFileUploadInfo>);
|
|
8
|
+
expect(asFragment()).toMatchSnapshot();
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
test('renders custom class names', () => {
|
|
12
|
-
const
|
|
13
|
-
expect(
|
|
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 {
|
|
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
|
|
8
|
-
expect(
|
|
7
|
+
const { asFragment } = render(<MultipleFileUploadMain />);
|
|
8
|
+
expect(asFragment()).toMatchSnapshot();
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
test('renders custom class names', () => {
|
|
12
|
-
const
|
|
13
|
-
expect(
|
|
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
|
|
17
|
+
const { asFragment } = render(
|
|
18
18
|
<MultipleFileUploadMain titleIcon="icon" titleText="title text" titleTextSeparator="title test separator" />
|
|
19
19
|
);
|
|
20
|
-
expect(
|
|
20
|
+
expect(asFragment()).toMatchSnapshot();
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
test('renders without the button when expected', () => {
|
|
24
|
-
const
|
|
25
|
-
expect(
|
|
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
|
|
30
|
-
expect(
|
|
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 {
|
|
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
|
|
9
|
-
expect(
|
|
8
|
+
const { asFragment } = render(<MultipleFileUploadStatus>Foo</MultipleFileUploadStatus>);
|
|
9
|
+
expect(asFragment()).toMatchSnapshot();
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
test('renders custom class names', () => {
|
|
13
|
-
const
|
|
14
|
-
expect(
|
|
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
|
|
19
|
-
expect(
|
|
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
|
|
24
|
-
|
|
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
|
-
|
|
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
|
|
9
|
-
expect(
|
|
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
|
|
14
|
-
expect(
|
|
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
|
|
20
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
39
|
-
|
|
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
|
|
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
|
-
|
|
66
|
+
|
|
67
|
+
expect(asFragment()).toMatchSnapshot();
|
|
53
68
|
});
|
|
54
69
|
});
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
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
|
|
8
|
-
expect(
|
|
7
|
+
const { asFragment } = render(<MultipleFileUploadTitle />);
|
|
8
|
+
expect(asFragment()).toMatchSnapshot();
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
test('renders custom class names', () => {
|
|
12
|
-
const
|
|
13
|
-
expect(
|
|
12
|
+
const { asFragment } = render(<MultipleFileUploadTitle className="test" />);
|
|
13
|
+
expect(asFragment()).toMatchSnapshot();
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
test('renders with title icon', () => {
|
|
17
|
-
const
|
|
18
|
-
expect(
|
|
17
|
+
const { asFragment } = render(<MultipleFileUploadTitle icon="icon" />);
|
|
18
|
+
expect(asFragment()).toMatchSnapshot();
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
test('renders with title text', () => {
|
|
22
|
-
const
|
|
23
|
-
expect(
|
|
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
|
|
28
|
-
expect(
|
|
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 {
|
|
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
|
|
8
|
-
expect(
|
|
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
|
|
13
|
-
expect(
|
|
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 {
|
|
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
|
|
8
|
-
expect(
|
|
7
|
+
const { asFragment } = render(<MultipleFileUploadTitleText>Foo</MultipleFileUploadTitleText>);
|
|
8
|
+
expect(asFragment()).toMatchSnapshot();
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
test('renders custom class names', () => {
|
|
12
|
-
const
|
|
13
|
-
expect(
|
|
12
|
+
const { asFragment } = render(<MultipleFileUploadTitleText className="test">Foo</MultipleFileUploadTitleText>);
|
|
13
|
+
expect(asFragment()).toMatchSnapshot();
|
|
14
14
|
});
|
|
15
15
|
});
|
package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadTitleTextSeparator.test.tsx
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
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
|
|
8
|
-
expect(
|
|
7
|
+
const { asFragment } = render(<MultipleFileUploadTitleTextSeparator>Foo</MultipleFileUploadTitleTextSeparator>);
|
|
8
|
+
expect(asFragment()).toMatchSnapshot();
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
test('renders custom class names', () => {
|
|
12
|
-
const
|
|
13
|
-
|
|
12
|
+
const { asFragment } = render(
|
|
13
|
+
<MultipleFileUploadTitleTextSeparator className="test">Foo</MultipleFileUploadTitleTextSeparator>
|
|
14
|
+
);
|
|
15
|
+
expect(asFragment()).toMatchSnapshot();
|
|
14
16
|
});
|
|
15
17
|
});
|
package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUpload.test.tsx.snap
CHANGED
|
@@ -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
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
<
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
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
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
`;
|