@patternfly/react-core 5.2.0-prerelease.29 → 5.2.0-prerelease.30
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 +6 -0
- package/components/package.json +1 -1
- package/deprecated/package.json +1 -1
- package/dist/dynamic/components/AboutModal/package.json +1 -1
- package/dist/dynamic/components/Accordion/package.json +1 -1
- package/dist/dynamic/components/ActionList/package.json +1 -1
- package/dist/dynamic/components/Alert/package.json +1 -1
- package/dist/dynamic/components/Avatar/package.json +1 -1
- package/dist/dynamic/components/BackToTop/package.json +1 -1
- package/dist/dynamic/components/Backdrop/package.json +1 -1
- package/dist/dynamic/components/BackgroundImage/package.json +1 -1
- package/dist/dynamic/components/Badge/package.json +1 -1
- package/dist/dynamic/components/Banner/package.json +1 -1
- package/dist/dynamic/components/Brand/package.json +1 -1
- package/dist/dynamic/components/Breadcrumb/package.json +1 -1
- package/dist/dynamic/components/Button/package.json +1 -1
- package/dist/dynamic/components/CalendarMonth/package.json +1 -1
- package/dist/dynamic/components/Card/package.json +1 -1
- package/dist/dynamic/components/Checkbox/package.json +1 -1
- package/dist/dynamic/components/Chip/package.json +1 -1
- package/dist/dynamic/components/ClipboardCopy/package.json +1 -1
- package/dist/dynamic/components/CodeBlock/package.json +1 -1
- package/dist/dynamic/components/DataList/package.json +1 -1
- package/dist/dynamic/components/DatePicker/package.json +1 -1
- package/dist/dynamic/components/DescriptionList/package.json +1 -1
- package/dist/dynamic/components/Divider/package.json +1 -1
- package/dist/dynamic/components/DragDrop/package.json +1 -1
- package/dist/dynamic/components/Drawer/package.json +1 -1
- package/dist/dynamic/components/Dropdown/package.json +1 -1
- package/dist/dynamic/components/DualListSelector/package.json +1 -1
- package/dist/dynamic/components/EmptyState/package.json +1 -1
- package/dist/dynamic/components/ExpandableSection/package.json +1 -1
- package/dist/dynamic/components/FileUpload/package.json +1 -1
- package/dist/dynamic/components/Form/package.json +1 -1
- package/dist/dynamic/components/FormSelect/package.json +1 -1
- package/dist/dynamic/components/HelperText/package.json +1 -1
- package/dist/dynamic/components/Hint/package.json +1 -1
- package/dist/dynamic/components/Icon/package.json +1 -1
- package/dist/dynamic/components/InputGroup/package.json +1 -1
- package/dist/dynamic/components/JumpLinks/package.json +1 -1
- package/dist/dynamic/components/Label/package.json +1 -1
- package/dist/dynamic/components/List/package.json +1 -1
- package/dist/dynamic/components/LoginPage/package.json +1 -1
- package/dist/dynamic/components/Masthead/package.json +1 -1
- package/dist/dynamic/components/Menu/package.json +1 -1
- package/dist/dynamic/components/MenuToggle/package.json +1 -1
- package/dist/dynamic/components/Modal/package.json +1 -1
- package/dist/dynamic/components/MultipleFileUpload/package.json +1 -1
- package/dist/dynamic/components/Nav/package.json +1 -1
- package/dist/dynamic/components/NotificationBadge/package.json +1 -1
- package/dist/dynamic/components/NotificationDrawer/package.json +1 -1
- package/dist/dynamic/components/NumberInput/package.json +1 -1
- package/dist/dynamic/components/OverflowMenu/package.json +1 -1
- package/dist/dynamic/components/Page/package.json +1 -1
- package/dist/dynamic/components/Pagination/package.json +1 -1
- package/dist/dynamic/components/Panel/package.json +1 -1
- package/dist/dynamic/components/Popover/package.json +1 -1
- package/dist/dynamic/components/Progress/package.json +1 -1
- package/dist/dynamic/components/ProgressStepper/package.json +1 -1
- package/dist/dynamic/components/Radio/package.json +1 -1
- package/dist/dynamic/components/SearchInput/package.json +1 -1
- package/dist/dynamic/components/Select/package.json +1 -1
- package/dist/dynamic/components/Sidebar/package.json +1 -1
- package/dist/dynamic/components/SimpleList/package.json +1 -1
- package/dist/dynamic/components/Skeleton/package.json +1 -1
- package/dist/dynamic/components/SkipToContent/package.json +1 -1
- package/dist/dynamic/components/Slider/package.json +1 -1
- package/dist/dynamic/components/Spinner/package.json +1 -1
- package/dist/dynamic/components/Switch/package.json +1 -1
- package/dist/dynamic/components/Tabs/package.json +1 -1
- package/dist/dynamic/components/Text/package.json +1 -1
- package/dist/dynamic/components/TextArea/package.json +1 -1
- package/dist/dynamic/components/TextInput/package.json +1 -1
- package/dist/dynamic/components/TextInputGroup/package.json +1 -1
- package/dist/dynamic/components/Tile/package.json +1 -1
- package/dist/dynamic/components/TimePicker/package.json +1 -1
- package/dist/dynamic/components/Timestamp/package.json +1 -1
- package/dist/dynamic/components/Title/package.json +1 -1
- package/dist/dynamic/components/ToggleGroup/package.json +1 -1
- package/dist/dynamic/components/Toolbar/package.json +1 -1
- package/dist/dynamic/components/Tooltip/package.json +1 -1
- package/dist/dynamic/components/TreeView/package.json +1 -1
- package/dist/dynamic/components/Truncate/package.json +1 -1
- package/dist/dynamic/components/Wizard/hooks/package.json +1 -1
- package/dist/dynamic/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/ApplicationLauncher/package.json +1 -1
- package/dist/dynamic/deprecated/components/ContextSelector/package.json +1 -1
- package/dist/dynamic/deprecated/components/Dropdown/package.json +1 -1
- package/dist/dynamic/deprecated/components/OptionsMenu/package.json +1 -1
- package/dist/dynamic/deprecated/components/PageHeader/package.json +1 -1
- package/dist/dynamic/deprecated/components/Select/package.json +1 -1
- package/dist/dynamic/deprecated/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/package.json +1 -1
- package/dist/dynamic/helpers/FocusTrap/FocusTrap/package.json +1 -1
- package/dist/dynamic/helpers/GenerateId/GenerateId/package.json +1 -1
- package/dist/dynamic/helpers/KeyboardHandler/package.json +1 -1
- package/dist/dynamic/helpers/OUIA/ouia/package.json +1 -1
- package/dist/dynamic/helpers/Popper/Popper/package.json +1 -1
- package/dist/dynamic/helpers/constants/package.json +1 -1
- package/dist/dynamic/helpers/datetimeUtils/package.json +1 -1
- package/dist/dynamic/helpers/favorites/package.json +1 -1
- package/dist/dynamic/helpers/fileUtils/package.json +1 -1
- package/dist/dynamic/helpers/htmlConstants/package.json +1 -1
- package/dist/dynamic/helpers/package.json +1 -1
- package/dist/dynamic/helpers/resizeObserver/package.json +1 -1
- package/dist/dynamic/helpers/typeUtils/package.json +1 -1
- package/dist/dynamic/helpers/useInterval/package.json +1 -1
- package/dist/dynamic/helpers/useIsomorphicLayout/package.json +1 -1
- package/dist/dynamic/helpers/useUnmountEffect/package.json +1 -1
- package/dist/dynamic/helpers/util/package.json +1 -1
- package/dist/dynamic/layouts/Bullseye/package.json +1 -1
- package/dist/dynamic/layouts/Flex/package.json +1 -1
- package/dist/dynamic/layouts/Gallery/package.json +1 -1
- package/dist/dynamic/layouts/Grid/package.json +1 -1
- package/dist/dynamic/layouts/Level/package.json +1 -1
- package/dist/dynamic/layouts/Split/package.json +1 -1
- package/dist/dynamic/layouts/Stack/package.json +1 -1
- package/dist/dynamic/next/components/package.json +1 -1
- package/dist/esm/components/Chip/Chip.d.ts +1 -0
- package/dist/esm/components/Chip/Chip.d.ts.map +1 -1
- package/dist/esm/components/Chip/Chip.js +8 -0
- package/dist/esm/components/Chip/Chip.js.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts +5 -5
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyExpanded.d.ts +0 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyExpanded.d.ts.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopyExpanded.js.map +1 -1
- package/dist/esm/components/DataList/DataList.d.ts.map +1 -1
- package/dist/esm/components/DataList/DataList.js +2 -2
- package/dist/esm/components/DataList/DataList.js.map +1 -1
- package/dist/esm/components/DataList/DataListAction.js +3 -3
- package/dist/esm/components/DataList/DataListAction.js.map +1 -1
- package/dist/esm/components/DatePicker/DatePicker.js +1 -1
- package/dist/esm/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/js/components/Chip/Chip.d.ts +1 -0
- package/dist/js/components/Chip/Chip.d.ts.map +1 -1
- package/dist/js/components/Chip/Chip.js +8 -0
- package/dist/js/components/Chip/Chip.js.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts +5 -5
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyExpanded.d.ts +0 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyExpanded.d.ts.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopyExpanded.js.map +1 -1
- package/dist/js/components/DataList/DataList.d.ts.map +1 -1
- package/dist/js/components/DataList/DataList.js +2 -2
- package/dist/js/components/DataList/DataList.js.map +1 -1
- package/dist/js/components/DataList/DataListAction.js +3 -3
- package/dist/js/components/DataList/DataListAction.js.map +1 -1
- package/dist/js/components/DatePicker/DatePicker.js +1 -1
- package/dist/js/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/umd/react-core.min.js +1 -1
- package/helpers/package.json +1 -1
- package/layouts/package.json +1 -1
- package/next/package.json +1 -1
- package/package.json +2 -2
- package/src/components/Chip/Chip.tsx +11 -0
- package/src/components/ClipboardCopy/ClipboardCopy.tsx +5 -5
- package/src/components/ClipboardCopy/ClipboardCopyExpanded.tsx +0 -1
- package/src/components/DataList/DataList.tsx +2 -0
- package/src/components/DataList/DataListAction.tsx +1 -1
- package/src/components/DataList/__tests__/DataList.test.tsx +140 -304
- package/src/components/DataList/__tests__/DataListAction.test.tsx +75 -0
- package/src/components/DataList/__tests__/DataListCell.test.tsx +120 -0
- package/src/components/DataList/__tests__/DataListCheck.test.tsx +5 -0
- package/src/components/DataList/__tests__/DataListContent.test.tsx +73 -0
- package/src/components/DataList/__tests__/DataListItem.test.tsx +46 -0
- package/src/components/DataList/__tests__/DataListItemCells.test.tsx +25 -0
- package/src/components/DataList/__tests__/DataListItemRow.test.tsx +44 -0
- package/src/components/DataList/__tests__/DataListToggle.test.tsx +61 -0
- package/src/components/DataList/__tests__/__snapshots__/DataList.test.tsx.snap +2 -323
- package/src/components/DataList/__tests__/__snapshots__/DataListAction.test.tsx.snap +11 -0
- package/src/components/DataList/__tests__/__snapshots__/DataListCell.test.tsx.snap +11 -0
- package/src/components/DataList/__tests__/__snapshots__/DataListContent.test.tsx.snap +17 -0
- package/src/components/DataList/__tests__/__snapshots__/DataListItem.test.tsx.snap +11 -0
- package/src/components/DataList/__tests__/__snapshots__/DataListItemCells.test.tsx.snap +9 -0
- package/src/components/DataList/__tests__/__snapshots__/DataListItemRow.test.tsx.snap +9 -0
- package/src/components/DataList/__tests__/__snapshots__/DataListToggle.test.tsx.snap +45 -0
- package/src/components/DataList/examples/DataListCheckboxes.tsx +5 -5
- package/src/components/DataList/examples/DataListMixedExpandable.tsx +1 -1
- package/src/components/DatePicker/DatePicker.tsx +1 -1
- package/src/components/DatePicker/__tests__/__snapshots__/DatePicker.test.tsx.snap +2 -2
- package/src/components/DescriptionList/__tests__/DescriptionList.test.tsx +128 -102
- package/src/components/DescriptionList/__tests__/DescriptionListDescription.test.tsx +25 -0
- package/src/components/DescriptionList/__tests__/DescriptionListGroup.test.tsx +25 -0
- package/src/components/DescriptionList/__tests__/DescriptionListHelpTextButton.test.tsx +27 -0
- package/src/components/DescriptionList/__tests__/DescriptionListTerm.test.tsx +35 -0
- package/src/components/DescriptionList/__tests__/DescriptionListTermHelpText.test.tsx +25 -0
- package/src/components/DescriptionList/__tests__/__snapshots__/DescriptionList.test.tsx.snap +1 -157
- package/src/components/DescriptionList/__tests__/__snapshots__/DescriptionListDescription.test.tsx.snap +15 -0
- package/src/components/DescriptionList/__tests__/__snapshots__/DescriptionListGroup.test.tsx.snap +11 -0
- package/src/components/DescriptionList/__tests__/__snapshots__/DescriptionListHelpTextButton.test.tsx.snap +14 -0
- package/src/components/DescriptionList/__tests__/__snapshots__/DescriptionListTerm.test.tsx.snap +15 -0
- package/src/components/DescriptionList/__tests__/__snapshots__/DescriptionListTermHelpText.test.tsx.snap +11 -0
- package/src/components/HelperText/__tests__/HelperText.test.tsx +67 -57
- package/src/components/HelperText/__tests__/HelperTextItem.test.tsx +93 -0
- package/src/components/HelperText/__tests__/__snapshots__/HelperText.test.tsx.snap +2 -223
- package/src/components/HelperText/__tests__/__snapshots__/HelperTextItem.test.tsx.snap +15 -0
- package/src/demos/CustomMenus/CustomMenus.md +6 -0
- package/src/demos/CustomMenus/examples/InlineSearchFilterMenuDemo.tsx +102 -0
- package/src/demos/SearchInput/SearchInput.md +1 -1
|
@@ -1,130 +1,156 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
3
|
import { DescriptionList } from '../DescriptionList';
|
|
4
|
-
import { DescriptionListGroup } from '../DescriptionListGroup';
|
|
5
|
-
import { DescriptionListTerm } from '../DescriptionListTerm';
|
|
6
|
-
import { DescriptionListDescription } from '../DescriptionListDescription';
|
|
7
|
-
import { DescriptionListTermHelpText } from '../DescriptionListTermHelpText';
|
|
8
|
-
import { DescriptionListTermHelpTextButton } from '../DescriptionListTermHelpTextButton';
|
|
9
|
-
|
|
10
|
-
describe('Description List', () => {
|
|
11
|
-
test('default', () => {
|
|
12
|
-
const { asFragment } = render(<DescriptionList />);
|
|
13
|
-
expect(asFragment()).toMatchSnapshot();
|
|
14
|
-
});
|
|
15
4
|
|
|
16
|
-
|
|
17
|
-
const { asFragment } = render(
|
|
18
|
-
<DescriptionList columnModifier={{ default: '1Col', md: '1Col', lg: '1Col', xl: '1Col', '2xl': '1Col' }} />
|
|
19
|
-
);
|
|
20
|
-
expect(asFragment()).toMatchSnapshot();
|
|
21
|
-
});
|
|
5
|
+
import styles from '@patternfly/react-styles/css/components/DescriptionList/description-list';
|
|
22
6
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
expect(asFragment()).toMatchSnapshot();
|
|
28
|
-
});
|
|
7
|
+
test('Renders to match snapshot', () => {
|
|
8
|
+
const { asFragment } = render(<DescriptionList />);
|
|
9
|
+
expect(asFragment()).toMatchSnapshot();
|
|
10
|
+
});
|
|
29
11
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
expect(asFragment()).toMatchSnapshot();
|
|
35
|
-
});
|
|
12
|
+
test(`Renders default class ${styles.descriptionList}`, () => {
|
|
13
|
+
render(<DescriptionList aria-label="list" />);
|
|
14
|
+
expect(screen.getByLabelText('list')).toHaveClass(styles.descriptionList, { exact: true });
|
|
15
|
+
});
|
|
36
16
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
17
|
+
test('Renders custom className', () => {
|
|
18
|
+
render(<DescriptionList aria-label="list" className="custom" />);
|
|
19
|
+
expect(screen.getByLabelText('list')).toHaveClass('custom');
|
|
20
|
+
});
|
|
41
21
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
22
|
+
Object.values(['1Col', '2Col', '3Col']).forEach((_col) => {
|
|
23
|
+
const col = _col as '1Col' | '2Col' | '3Col';
|
|
24
|
+
test(`Renders ${col} on all breakpoints`, () => {
|
|
25
|
+
render(
|
|
26
|
+
<DescriptionList
|
|
27
|
+
aria-label="list"
|
|
28
|
+
columnModifier={{ default: col, sm: col, md: col, lg: col, xl: col, '2xl': col }}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
expect(screen.getByLabelText('list')).toHaveClass(
|
|
32
|
+
styles.modifiers[col],
|
|
33
|
+
styles.modifiers[`${col}OnSm`],
|
|
34
|
+
styles.modifiers[`${col}OnMd`],
|
|
35
|
+
styles.modifiers[`${col}OnLg`],
|
|
36
|
+
styles.modifiers[`${col}OnXl`],
|
|
37
|
+
styles.modifiers[`${col}On_2xl`]
|
|
38
|
+
);
|
|
45
39
|
});
|
|
40
|
+
});
|
|
46
41
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
test(`Renders ${styles.modifiers.horizontal} when isHorizontal = true`, () => {
|
|
43
|
+
render(<DescriptionList aria-label="list" isHorizontal />);
|
|
44
|
+
expect(screen.getByLabelText('list')).toHaveClass(styles.modifiers.horizontal);
|
|
45
|
+
});
|
|
51
46
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
test(`Renders ${styles.modifiers.compact} when isCompact = true`, () => {
|
|
48
|
+
render(<DescriptionList aria-label="list" isCompact />);
|
|
49
|
+
expect(screen.getByLabelText('list')).toHaveClass(styles.modifiers.compact);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test(`Renders ${styles.modifiers.horizontal} and ${styles.modifiers.fluid} when isFluid = true`, () => {
|
|
53
|
+
render(<DescriptionList aria-label="list" isFluid />);
|
|
54
|
+
expect(screen.getByLabelText('list')).toHaveClass(styles.modifiers.fluid, styles.modifiers.horizontal);
|
|
55
|
+
});
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
Object.values(['horizontal', 'vertical']).forEach((_align) => {
|
|
58
|
+
const align = _align as 'horizontal' | 'vertical';
|
|
59
|
+
test(`Renders ${align} on all breakpoints`, () => {
|
|
60
|
+
render(
|
|
59
61
|
<DescriptionList
|
|
60
|
-
|
|
62
|
+
aria-label="list"
|
|
61
63
|
orientation={{
|
|
62
|
-
sm:
|
|
63
|
-
md:
|
|
64
|
-
lg:
|
|
65
|
-
xl:
|
|
66
|
-
'2xl':
|
|
64
|
+
sm: align,
|
|
65
|
+
md: align,
|
|
66
|
+
lg: align,
|
|
67
|
+
xl: align,
|
|
68
|
+
'2xl': align
|
|
67
69
|
}}
|
|
68
70
|
/>
|
|
69
71
|
);
|
|
70
|
-
expect(
|
|
72
|
+
expect(screen.getByLabelText('list')).toHaveClass(
|
|
73
|
+
styles.modifiers[`${align}OnSm`],
|
|
74
|
+
styles.modifiers[`${align}OnMd`],
|
|
75
|
+
styles.modifiers[`${align}OnLg`],
|
|
76
|
+
styles.modifiers[`${align}OnXl`],
|
|
77
|
+
styles.modifiers[`${align}On_2xl`]
|
|
78
|
+
);
|
|
71
79
|
});
|
|
80
|
+
});
|
|
72
81
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
82
|
+
test(`Renders ${styles.modifiers.autoColumnWidths} when isAutoColumnWidths = true`, () => {
|
|
83
|
+
render(<DescriptionList aria-label="list" isAutoColumnWidths />);
|
|
84
|
+
expect(screen.getByLabelText('list')).toHaveClass(styles.modifiers.autoColumnWidths);
|
|
85
|
+
});
|
|
77
86
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
87
|
+
test(`Renders ${styles.modifiers.inlineGrid} when isInlineGrid = true`, () => {
|
|
88
|
+
render(<DescriptionList aria-label="list" isInlineGrid />);
|
|
89
|
+
expect(screen.getByLabelText('list')).toHaveClass(styles.modifiers.inlineGrid);
|
|
90
|
+
});
|
|
82
91
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
92
|
+
test(`Renders ${styles.modifiers.autoFit} when isAutoFit = true`, () => {
|
|
93
|
+
render(<DescriptionList aria-label="list" isAutoFit />);
|
|
94
|
+
expect(screen.getByLabelText('list')).toHaveClass(styles.modifiers.autoFit);
|
|
95
|
+
});
|
|
87
96
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
expect(asFragment()).toMatchSnapshot();
|
|
93
|
-
});
|
|
97
|
+
test(`Renders ${styles.modifiers.fillColumns} when isFillColumns = true`, () => {
|
|
98
|
+
render(<DescriptionList aria-label="list" isFillColumns />);
|
|
99
|
+
expect(screen.getByLabelText('list')).toHaveClass(styles.modifiers.fillColumns);
|
|
100
|
+
});
|
|
94
101
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
</DescriptionListTerm>
|
|
100
|
-
);
|
|
101
|
-
expect(asFragment()).toMatchSnapshot();
|
|
102
|
-
});
|
|
102
|
+
test(`Renders ${styles.modifiers.displayLg} when displaySize = lg`, () => {
|
|
103
|
+
render(<DescriptionList aria-label="list" displaySize="lg" />);
|
|
104
|
+
expect(screen.getByLabelText('list')).toHaveClass(styles.modifiers.displayLg);
|
|
105
|
+
});
|
|
103
106
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
</DescriptionListTermHelpText>
|
|
109
|
-
);
|
|
110
|
-
expect(asFragment()).toMatchSnapshot();
|
|
111
|
-
});
|
|
107
|
+
test(`Renders ${styles.modifiers.display_2xl} when displaySize = 2xl`, () => {
|
|
108
|
+
render(<DescriptionList aria-label="list" displaySize="2xl" />);
|
|
109
|
+
expect(screen.getByLabelText('list')).toHaveClass(styles.modifiers.display_2xl);
|
|
110
|
+
});
|
|
112
111
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
112
|
+
test(`Renders style when isHorizontal and horizontalTermWidthModifier is set`, () => {
|
|
113
|
+
render(
|
|
114
|
+
<DescriptionList
|
|
115
|
+
aria-label="list"
|
|
116
|
+
isHorizontal
|
|
117
|
+
horizontalTermWidthModifier={{
|
|
118
|
+
default: '12ch',
|
|
119
|
+
sm: '15ch',
|
|
120
|
+
md: '20ch',
|
|
121
|
+
lg: '28ch',
|
|
122
|
+
xl: '30ch',
|
|
123
|
+
'2xl': '35ch'
|
|
124
|
+
}}
|
|
125
|
+
/>
|
|
126
|
+
);
|
|
127
|
+
expect(screen.getByLabelText('list')).toHaveStyle({
|
|
128
|
+
'--pf-v5-c-description-list--m-horizontal__term--width': '12ch',
|
|
129
|
+
'--pf-v5-c-description-list--m-horizontal__term--width-on-sm': '15ch',
|
|
130
|
+
'--pf-v5-c-description-list--m-horizontal__term--width-on-md': '20ch',
|
|
131
|
+
'--pf-v5-c-description-list--m-horizontal__term--width-on-lg': '28ch',
|
|
132
|
+
'--pf-v5-c-description-list--m-horizontal__term--width-on-xl': '30ch',
|
|
133
|
+
'--pf-v5-c-description-list--m-horizontal__term--width-on-2xl': '35ch'
|
|
120
134
|
});
|
|
135
|
+
});
|
|
121
136
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
</DescriptionListDescription>
|
|
127
|
-
);
|
|
128
|
-
expect(asFragment()).toMatchSnapshot();
|
|
137
|
+
test(`Renders style when termWidth is set`, () => {
|
|
138
|
+
render(<DescriptionList aria-label="list" isHorizontal termWidth="30px" />);
|
|
139
|
+
expect(screen.getByLabelText('list')).toHaveStyle({
|
|
140
|
+
'--pf-v5-c-description-list__term--width': '30px'
|
|
129
141
|
});
|
|
130
142
|
});
|
|
143
|
+
|
|
144
|
+
test(`Renders style when isAutoFit and horizontalTermWidthModifier is set`, () => {
|
|
145
|
+
render(
|
|
146
|
+
<DescriptionList
|
|
147
|
+
aria-label="list"
|
|
148
|
+
isAutoFit
|
|
149
|
+
autoFitMinModifier={{ default: '50px', sm: '50px', md: '100px', lg: '150px', xl: '200px', '2xl': '300px' }}
|
|
150
|
+
/>
|
|
151
|
+
);
|
|
152
|
+
expect(screen.getByLabelText('list')).toHaveAttribute(
|
|
153
|
+
'style',
|
|
154
|
+
'--pf-v5-c-description-list--GridTemplateColumns--min: 50px; --pf-v5-c-description-list--GridTemplateColumns--min-on-sm: 50px; --pf-v5-c-description-list--GridTemplateColumns--min-on-md: 100px; --pf-v5-c-description-list--GridTemplateColumns--min-on-lg: 150px; --pf-v5-c-description-list--GridTemplateColumns--min-on-xl: 200px; --pf-v5-c-description-list--GridTemplateColumns--min-on-2xl: 300px;'
|
|
155
|
+
);
|
|
156
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { DescriptionListDescription } from '../DescriptionListDescription';
|
|
4
|
+
|
|
5
|
+
import styles from '@patternfly/react-styles/css/components/DescriptionList/description-list';
|
|
6
|
+
|
|
7
|
+
test('Renders to match snapshot', () => {
|
|
8
|
+
const { asFragment } = render(<DescriptionListDescription>test</DescriptionListDescription>);
|
|
9
|
+
expect(asFragment()).toMatchSnapshot();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test(`Renders default class ${styles.descriptionListDescription}`, () => {
|
|
13
|
+
render(<DescriptionListDescription>test</DescriptionListDescription>);
|
|
14
|
+
expect(screen.getByText('test').parentElement).toHaveClass(styles.descriptionListDescription, { exact: true });
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test('Renders custom className', () => {
|
|
18
|
+
render(<DescriptionListDescription className="custom">test</DescriptionListDescription>);
|
|
19
|
+
expect(screen.getByText('test').parentElement).toHaveClass('custom');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('Renders spread props', () => {
|
|
23
|
+
render(<DescriptionListDescription id="id">test</DescriptionListDescription>);
|
|
24
|
+
expect(screen.getByText('test').parentElement).toHaveAttribute('id', 'id');
|
|
25
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { DescriptionListGroup } from '../DescriptionListGroup';
|
|
4
|
+
|
|
5
|
+
import styles from '@patternfly/react-styles/css/components/DescriptionList/description-list';
|
|
6
|
+
|
|
7
|
+
test('Renders to match snapshot', () => {
|
|
8
|
+
const { asFragment } = render(<DescriptionListGroup>test</DescriptionListGroup>);
|
|
9
|
+
expect(asFragment()).toMatchSnapshot();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test(`Renders default class ${styles.descriptionListGroup}`, () => {
|
|
13
|
+
render(<DescriptionListGroup>test</DescriptionListGroup>);
|
|
14
|
+
expect(screen.getByText('test')).toHaveClass(styles.descriptionListGroup, { exact: true });
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test('Renders custom className', () => {
|
|
18
|
+
render(<DescriptionListGroup className="custom">test</DescriptionListGroup>);
|
|
19
|
+
expect(screen.getByText('test')).toHaveClass('custom');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('Renders spread props', () => {
|
|
23
|
+
render(<DescriptionListGroup id="id">test</DescriptionListGroup>);
|
|
24
|
+
expect(screen.getByText('test')).toHaveAttribute('id', 'id');
|
|
25
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { DescriptionListTermHelpTextButton } from '../DescriptionListTermHelpTextButton';
|
|
4
|
+
|
|
5
|
+
import styles from '@patternfly/react-styles/css/components/DescriptionList/description-list';
|
|
6
|
+
|
|
7
|
+
test('Renders to match snapshot', () => {
|
|
8
|
+
const { asFragment } = render(<DescriptionListTermHelpTextButton>test</DescriptionListTermHelpTextButton>);
|
|
9
|
+
expect(asFragment()).toMatchSnapshot();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test(`Renders default class ${styles.descriptionListText}`, () => {
|
|
13
|
+
render(<DescriptionListTermHelpTextButton>test</DescriptionListTermHelpTextButton>);
|
|
14
|
+
expect(screen.getByText('test')).toHaveClass(`${styles.descriptionListText} ${styles.modifiers.helpText}`, {
|
|
15
|
+
exact: true
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test('Renders custom className', () => {
|
|
20
|
+
render(<DescriptionListTermHelpTextButton className="custom">test</DescriptionListTermHelpTextButton>);
|
|
21
|
+
expect(screen.getByText('test')).toHaveClass('custom');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test('Renders spread props', () => {
|
|
25
|
+
render(<DescriptionListTermHelpTextButton id="id">test</DescriptionListTermHelpTextButton>);
|
|
26
|
+
expect(screen.getByText('test')).toHaveAttribute('id', 'id');
|
|
27
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { DescriptionListTerm } from '../DescriptionListTerm';
|
|
4
|
+
|
|
5
|
+
import styles from '@patternfly/react-styles/css/components/DescriptionList/description-list';
|
|
6
|
+
|
|
7
|
+
test('Renders to match snapshot', () => {
|
|
8
|
+
const { asFragment } = render(<DescriptionListTerm>test</DescriptionListTerm>);
|
|
9
|
+
expect(asFragment()).toMatchSnapshot();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test(`Renders default class ${styles.descriptionListTerm}`, () => {
|
|
13
|
+
render(<DescriptionListTerm>test</DescriptionListTerm>);
|
|
14
|
+
expect(screen.getByText('test').parentElement).toHaveClass(styles.descriptionListTerm, { exact: true });
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test(`Renders default class ${styles.descriptionListText}`, () => {
|
|
18
|
+
render(<DescriptionListTerm>test</DescriptionListTerm>);
|
|
19
|
+
expect(screen.getByText('test')).toHaveClass(styles.descriptionListText, { exact: true });
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('Renders custom className', () => {
|
|
23
|
+
render(<DescriptionListTerm className="custom">test</DescriptionListTerm>);
|
|
24
|
+
expect(screen.getByText('test').parentElement).toHaveClass('custom');
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test('Renders icon', () => {
|
|
28
|
+
render(<DescriptionListTerm icon={<div>icon</div>}>test</DescriptionListTerm>);
|
|
29
|
+
expect(screen.getByText('icon').parentElement).toHaveClass(styles.descriptionListTermIcon);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test('Renders spread props', () => {
|
|
33
|
+
render(<DescriptionListTerm id="id">test</DescriptionListTerm>);
|
|
34
|
+
expect(screen.getByText('test').parentElement).toHaveAttribute('id', 'id');
|
|
35
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { DescriptionListTermHelpText } from '../DescriptionListTermHelpText';
|
|
4
|
+
|
|
5
|
+
import styles from '@patternfly/react-styles/css/components/DescriptionList/description-list';
|
|
6
|
+
|
|
7
|
+
test('Renders to match snapshot', () => {
|
|
8
|
+
const { asFragment } = render(<DescriptionListTermHelpText>test</DescriptionListTermHelpText>);
|
|
9
|
+
expect(asFragment()).toMatchSnapshot();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test(`Renders default class ${styles.descriptionListTerm}`, () => {
|
|
13
|
+
render(<DescriptionListTermHelpText>test</DescriptionListTermHelpText>);
|
|
14
|
+
expect(screen.getByText('test')).toHaveClass(styles.descriptionListTerm, { exact: true });
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test('Renders custom className', () => {
|
|
18
|
+
render(<DescriptionListTermHelpText className="custom">test</DescriptionListTermHelpText>);
|
|
19
|
+
expect(screen.getByText('test')).toHaveClass('custom');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('Renders spread props', () => {
|
|
23
|
+
render(<DescriptionListTermHelpText id="id">test</DescriptionListTermHelpText>);
|
|
24
|
+
expect(screen.getByText('test')).toHaveAttribute('id', 'id');
|
|
25
|
+
});
|
package/src/components/DescriptionList/__tests__/__snapshots__/DescriptionList.test.tsx.snap
CHANGED
|
@@ -1,162 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
4
|
-
<DocumentFragment>
|
|
5
|
-
<dl
|
|
6
|
-
class="pf-v5-c-description-list pf-m-1-col pf-m-1-col-on-md pf-m-1-col-on-lg pf-m-1-col-on-xl pf-m-1-col-on-2xl"
|
|
7
|
-
/>
|
|
8
|
-
</DocumentFragment>
|
|
9
|
-
`;
|
|
10
|
-
|
|
11
|
-
exports[`Description List 2 col on all breakpoints 1`] = `
|
|
12
|
-
<DocumentFragment>
|
|
13
|
-
<dl
|
|
14
|
-
class="pf-v5-c-description-list pf-m-2-col pf-m-2-col-on-md pf-m-2-col-on-lg pf-m-2-col-on-xl pf-m-2-col-on-2xl"
|
|
15
|
-
/>
|
|
16
|
-
</DocumentFragment>
|
|
17
|
-
`;
|
|
18
|
-
|
|
19
|
-
exports[`Description List 3 col on all breakpoints 1`] = `
|
|
20
|
-
<DocumentFragment>
|
|
21
|
-
<dl
|
|
22
|
-
class="pf-v5-c-description-list pf-m-3-col pf-m-3-col-on-md pf-m-3-col-on-lg pf-m-3-col-on-xl pf-m-3-col-on-2xl"
|
|
23
|
-
/>
|
|
24
|
-
</DocumentFragment>
|
|
25
|
-
`;
|
|
26
|
-
|
|
27
|
-
exports[`Description List Auto Column Widths Description List 1`] = `
|
|
28
|
-
<DocumentFragment>
|
|
29
|
-
<dl
|
|
30
|
-
class="pf-v5-c-description-list pf-m-auto-column-widths"
|
|
31
|
-
/>
|
|
32
|
-
</DocumentFragment>
|
|
33
|
-
`;
|
|
34
|
-
|
|
35
|
-
exports[`Description List Auto fit Description List 1`] = `
|
|
36
|
-
<DocumentFragment>
|
|
37
|
-
<dl
|
|
38
|
-
class="pf-v5-c-description-list pf-m-auto-fit"
|
|
39
|
-
/>
|
|
40
|
-
</DocumentFragment>
|
|
41
|
-
`;
|
|
42
|
-
|
|
43
|
-
exports[`Description List Auto fit with responsive grid Description List 1`] = `
|
|
44
|
-
<DocumentFragment>
|
|
45
|
-
<dl
|
|
46
|
-
class="pf-v5-c-description-list pf-m-auto-fit"
|
|
47
|
-
style="--pf-v5-c-description-list--GridTemplateColumns--min-on-md: 100px; --pf-v5-c-description-list--GridTemplateColumns--min-on-lg: 150px; --pf-v5-c-description-list--GridTemplateColumns--min-on-xl: 200px; --pf-v5-c-description-list--GridTemplateColumns--min-on-2xl: 300px;"
|
|
48
|
-
/>
|
|
49
|
-
</DocumentFragment>
|
|
50
|
-
`;
|
|
51
|
-
|
|
52
|
-
exports[`Description List Compact Description List 1`] = `
|
|
53
|
-
<DocumentFragment>
|
|
54
|
-
<dl
|
|
55
|
-
class="pf-v5-c-description-list pf-m-compact"
|
|
56
|
-
/>
|
|
57
|
-
</DocumentFragment>
|
|
58
|
-
`;
|
|
59
|
-
|
|
60
|
-
exports[`Description List Compact Horizontal Description List 1`] = `
|
|
61
|
-
<DocumentFragment>
|
|
62
|
-
<dl
|
|
63
|
-
class="pf-v5-c-description-list pf-m-horizontal pf-m-compact"
|
|
64
|
-
/>
|
|
65
|
-
</DocumentFragment>
|
|
66
|
-
`;
|
|
67
|
-
|
|
68
|
-
exports[`Description List Description 1`] = `
|
|
69
|
-
<DocumentFragment>
|
|
70
|
-
<dd
|
|
71
|
-
aria-labelledby="description-1"
|
|
72
|
-
class="pf-v5-c-description-list__description custom-description-list-description"
|
|
73
|
-
>
|
|
74
|
-
<div
|
|
75
|
-
class="pf-v5-c-description-list__text"
|
|
76
|
-
>
|
|
77
|
-
test
|
|
78
|
-
</div>
|
|
79
|
-
</dd>
|
|
80
|
-
</DocumentFragment>
|
|
81
|
-
`;
|
|
82
|
-
|
|
83
|
-
exports[`Description List Fluid Horizontal Description List 1`] = `
|
|
84
|
-
<DocumentFragment>
|
|
85
|
-
<dl
|
|
86
|
-
class="pf-v5-c-description-list pf-m-horizontal pf-m-fluid"
|
|
87
|
-
/>
|
|
88
|
-
</DocumentFragment>
|
|
89
|
-
`;
|
|
90
|
-
|
|
91
|
-
exports[`Description List Group 1`] = `
|
|
92
|
-
<DocumentFragment>
|
|
93
|
-
<div
|
|
94
|
-
aria-labelledby="group-1"
|
|
95
|
-
class="pf-v5-c-description-list__group custom-description-list-group"
|
|
96
|
-
>
|
|
97
|
-
test
|
|
98
|
-
</div>
|
|
99
|
-
</DocumentFragment>
|
|
100
|
-
`;
|
|
101
|
-
|
|
102
|
-
exports[`Description List Horizontal Description List 1`] = `
|
|
103
|
-
<DocumentFragment>
|
|
104
|
-
<dl
|
|
105
|
-
class="pf-v5-c-description-list pf-m-horizontal"
|
|
106
|
-
/>
|
|
107
|
-
</DocumentFragment>
|
|
108
|
-
`;
|
|
109
|
-
|
|
110
|
-
exports[`Description List Inline Grid Description List 1`] = `
|
|
111
|
-
<DocumentFragment>
|
|
112
|
-
<dl
|
|
113
|
-
class="pf-v5-c-description-list pf-m-inline-grid"
|
|
114
|
-
/>
|
|
115
|
-
</DocumentFragment>
|
|
116
|
-
`;
|
|
117
|
-
|
|
118
|
-
exports[`Description List Term default 1`] = `
|
|
119
|
-
<DocumentFragment>
|
|
120
|
-
<dt
|
|
121
|
-
aria-labelledby="term-1"
|
|
122
|
-
class="pf-v5-c-description-list__term"
|
|
123
|
-
>
|
|
124
|
-
<span
|
|
125
|
-
class="pf-v5-c-description-list__text"
|
|
126
|
-
>
|
|
127
|
-
test
|
|
128
|
-
</span>
|
|
129
|
-
</dt>
|
|
130
|
-
</DocumentFragment>
|
|
131
|
-
`;
|
|
132
|
-
|
|
133
|
-
exports[`Description List Term helper text 1`] = `
|
|
134
|
-
<DocumentFragment>
|
|
135
|
-
<dt
|
|
136
|
-
aria-labelledby="term-1"
|
|
137
|
-
class="pf-v5-c-description-list__term"
|
|
138
|
-
>
|
|
139
|
-
<span
|
|
140
|
-
class="pf-v5-c-description-list__text pf-m-help-text"
|
|
141
|
-
role="button"
|
|
142
|
-
tabindex="0"
|
|
143
|
-
type="button"
|
|
144
|
-
>
|
|
145
|
-
test
|
|
146
|
-
</span>
|
|
147
|
-
</dt>
|
|
148
|
-
</DocumentFragment>
|
|
149
|
-
`;
|
|
150
|
-
|
|
151
|
-
exports[`Description List alignment breakpoints 1`] = `
|
|
152
|
-
<DocumentFragment>
|
|
153
|
-
<dl
|
|
154
|
-
class="pf-v5-c-description-list pf-m-horizontal pf-m-horizontal-on-sm pf-m-vertical-on-md pf-m-horizontal-on-lg pf-m-vertical-on-xl pf-m-horizontal-on-2xl"
|
|
155
|
-
/>
|
|
156
|
-
</DocumentFragment>
|
|
157
|
-
`;
|
|
158
|
-
|
|
159
|
-
exports[`Description List default 1`] = `
|
|
3
|
+
exports[`Renders to match snapshot 1`] = `
|
|
160
4
|
<DocumentFragment>
|
|
161
5
|
<dl
|
|
162
6
|
class="pf-v5-c-description-list"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Renders to match snapshot 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<dd
|
|
6
|
+
class="pf-v5-c-description-list__description"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
class="pf-v5-c-description-list__text"
|
|
10
|
+
>
|
|
11
|
+
test
|
|
12
|
+
</div>
|
|
13
|
+
</dd>
|
|
14
|
+
</DocumentFragment>
|
|
15
|
+
`;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Renders to match snapshot 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<span
|
|
6
|
+
class="pf-v5-c-description-list__text pf-m-help-text"
|
|
7
|
+
role="button"
|
|
8
|
+
tabindex="0"
|
|
9
|
+
type="button"
|
|
10
|
+
>
|
|
11
|
+
test
|
|
12
|
+
</span>
|
|
13
|
+
</DocumentFragment>
|
|
14
|
+
`;
|
package/src/components/DescriptionList/__tests__/__snapshots__/DescriptionListTerm.test.tsx.snap
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Renders to match snapshot 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<dt
|
|
6
|
+
class="pf-v5-c-description-list__term"
|
|
7
|
+
>
|
|
8
|
+
<span
|
|
9
|
+
class="pf-v5-c-description-list__text"
|
|
10
|
+
>
|
|
11
|
+
test
|
|
12
|
+
</span>
|
|
13
|
+
</dt>
|
|
14
|
+
</DocumentFragment>
|
|
15
|
+
`;
|