@patternfly/react-core 4.224.8 → 4.224.11

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 (105) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/esm/components/ContextSelector/ContextSelector.d.ts +2 -0
  3. package/dist/esm/components/ContextSelector/ContextSelector.d.ts.map +1 -1
  4. package/dist/esm/components/ContextSelector/ContextSelector.js +8 -11
  5. package/dist/esm/components/ContextSelector/ContextSelector.js.map +1 -1
  6. package/dist/esm/components/ContextSelector/ContextSelectorMenuList.d.ts.map +1 -1
  7. package/dist/esm/components/ContextSelector/ContextSelectorMenuList.js +2 -1
  8. package/dist/esm/components/ContextSelector/ContextSelectorMenuList.js.map +1 -1
  9. package/dist/esm/components/DualListSelector/DualListSelector.d.ts.map +1 -1
  10. package/dist/esm/components/DualListSelector/DualListSelector.js +6 -6
  11. package/dist/esm/components/DualListSelector/DualListSelector.js.map +1 -1
  12. package/dist/esm/components/DualListSelector/DualListSelectorControlsWrapper.js +1 -1
  13. package/dist/esm/components/DualListSelector/DualListSelectorControlsWrapper.js.map +1 -1
  14. package/dist/esm/components/DualListSelector/DualListSelectorList.d.ts +1 -0
  15. package/dist/esm/components/DualListSelector/DualListSelectorList.d.ts.map +1 -1
  16. package/dist/esm/components/DualListSelector/DualListSelectorList.js +7 -1
  17. package/dist/esm/components/DualListSelector/DualListSelectorList.js.map +1 -1
  18. package/dist/esm/components/DualListSelector/DualListSelectorTree.d.ts +3 -2
  19. package/dist/esm/components/DualListSelector/DualListSelectorTree.d.ts.map +1 -1
  20. package/dist/esm/components/DualListSelector/DualListSelectorTree.js.map +1 -1
  21. package/dist/esm/components/SearchInput/SearchInput.d.ts +7 -0
  22. package/dist/esm/components/SearchInput/SearchInput.d.ts.map +1 -1
  23. package/dist/esm/components/SearchInput/SearchInput.js +9 -4
  24. package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
  25. package/dist/js/components/ContextSelector/ContextSelector.d.ts +2 -0
  26. package/dist/js/components/ContextSelector/ContextSelector.d.ts.map +1 -1
  27. package/dist/js/components/ContextSelector/ContextSelector.js +7 -10
  28. package/dist/js/components/ContextSelector/ContextSelector.js.map +1 -1
  29. package/dist/js/components/ContextSelector/ContextSelectorMenuList.d.ts.map +1 -1
  30. package/dist/js/components/ContextSelector/ContextSelectorMenuList.js +2 -1
  31. package/dist/js/components/ContextSelector/ContextSelectorMenuList.js.map +1 -1
  32. package/dist/js/components/DualListSelector/DualListSelector.d.ts.map +1 -1
  33. package/dist/js/components/DualListSelector/DualListSelector.js +5 -5
  34. package/dist/js/components/DualListSelector/DualListSelector.js.map +1 -1
  35. package/dist/js/components/DualListSelector/DualListSelectorControlsWrapper.js +1 -1
  36. package/dist/js/components/DualListSelector/DualListSelectorControlsWrapper.js.map +1 -1
  37. package/dist/js/components/DualListSelector/DualListSelectorList.d.ts +1 -0
  38. package/dist/js/components/DualListSelector/DualListSelectorList.d.ts.map +1 -1
  39. package/dist/js/components/DualListSelector/DualListSelectorList.js +7 -1
  40. package/dist/js/components/DualListSelector/DualListSelectorList.js.map +1 -1
  41. package/dist/js/components/DualListSelector/DualListSelectorTree.d.ts +3 -2
  42. package/dist/js/components/DualListSelector/DualListSelectorTree.d.ts.map +1 -1
  43. package/dist/js/components/DualListSelector/DualListSelectorTree.js.map +1 -1
  44. package/dist/js/components/SearchInput/SearchInput.d.ts +7 -0
  45. package/dist/js/components/SearchInput/SearchInput.d.ts.map +1 -1
  46. package/dist/js/components/SearchInput/SearchInput.js +9 -4
  47. package/dist/js/components/SearchInput/SearchInput.js.map +1 -1
  48. package/dist/styles/base-no-reset.css +10 -10
  49. package/dist/styles/base.css +10 -10
  50. package/dist/umd/react-core.css +797 -967
  51. package/dist/umd/react-core.js +709 -726
  52. package/dist/umd/react-core.min.css +39 -209
  53. package/dist/umd/react-core.min.js +4 -4
  54. package/package.json +7 -7
  55. package/src/components/Accordion/examples/AccordionBordered.tsx +21 -21
  56. package/src/components/Accordion/examples/AccordionDefinitionList.tsx +21 -21
  57. package/src/components/ActionList/__tests__/ActionList.test.tsx +46 -11
  58. package/src/components/ActionList/__tests__/ActionListGroup.test.tsx +34 -7
  59. package/src/components/ActionList/__tests__/ActionListItem.test.tsx +34 -7
  60. package/src/components/ActionList/__tests__/__snapshots__/ActionList.test.tsx.snap +1 -11
  61. package/src/components/ActionList/__tests__/__snapshots__/ActionListGroup.test.tsx.snap +1 -1
  62. package/src/components/ActionList/__tests__/__snapshots__/ActionListItem.test.tsx.snap +1 -1
  63. package/src/components/ActionList/examples/ActionListMultipleGroups.tsx +4 -4
  64. package/src/components/ActionList/examples/ActionListSingleGroup.tsx +4 -4
  65. package/src/components/ActionList/examples/ActionListWithCancelButton.tsx +5 -5
  66. package/src/components/ActionList/examples/ActionListWithIcons.tsx +2 -2
  67. package/src/components/Card/examples/CardSelectableA11yHighlight.tsx +4 -4
  68. package/src/components/CodeBlock/examples/CodeBlockBasic.tsx +1 -1
  69. package/src/components/CodeBlock/examples/CodeBlockExpandable.tsx +1 -1
  70. package/src/components/ContextSelector/ContextSelector.tsx +11 -10
  71. package/src/components/ContextSelector/ContextSelectorMenuList.tsx +2 -1
  72. package/src/components/ContextSelector/__tests__/ContextSelector.test.tsx +2 -2
  73. package/src/components/ContextSelector/__tests__/__snapshots__/ContextSelector.test.tsx.snap +11 -7
  74. package/src/components/ContextSelector/__tests__/__snapshots__/ContextSelectorMenuList.test.tsx.snap +10 -0
  75. package/src/components/DataList/examples/DataListCompact.tsx +4 -4
  76. package/src/components/DataList/examples/DataListControllingText.tsx +3 -3
  77. package/src/components/DataList/examples/DataListDraggable.tsx +14 -7
  78. package/src/components/DataList/examples/DataListExpandable.tsx +3 -3
  79. package/src/components/DataList/examples/DataListSmGridBreakpoint.tsx +3 -3
  80. package/src/components/DualListSelector/DualListSelector.tsx +93 -89
  81. package/src/components/DualListSelector/DualListSelectorControlsWrapper.tsx +1 -1
  82. package/src/components/DualListSelector/DualListSelectorList.tsx +10 -4
  83. package/src/components/DualListSelector/DualListSelectorTree.tsx +3 -2
  84. package/src/components/DualListSelector/__tests__/__snapshots__/DualListSelector.test.tsx.snap +6 -20
  85. package/src/components/DualListSelector/examples/DualListSelector.md +3 -1
  86. package/src/components/DualListSelector/examples/DualListSelectorComposable.tsx +1 -1
  87. package/src/components/DualListSelector/examples/DualListSelectorComposableDragDrop.tsx +1 -1
  88. package/src/components/DualListSelector/examples/DualListSelectorComposableTree.tsx +1 -1
  89. package/src/components/DualListSelector/examples/{DualListSelectorTree.tsx → DualListSelectorTreeExample.tsx} +1 -1
  90. package/src/components/FileUpload/examples/FileUploadCustomUpload.tsx +1 -1
  91. package/src/components/FileUpload/examples/FileUploadSimpleText.tsx +1 -1
  92. package/src/components/FileUpload/examples/FileUploadTextWithEdits.tsx +1 -1
  93. package/src/components/FileUpload/examples/FileUploadTextWithRestrictions.tsx +2 -2
  94. package/src/components/InputGroup/examples/InputGroupBasic.tsx +3 -3
  95. package/src/components/InputGroup/examples/InputGroupWithDropdown.tsx +1 -1
  96. package/src/components/InputGroup/examples/InputGroupWithPopover.tsx +12 -2
  97. package/src/components/InputGroup/examples/InputGroupWithSiblings.tsx +7 -2
  98. package/src/components/InputGroup/examples/InputGroupWithTextarea.tsx +1 -1
  99. package/src/components/LoginPage/examples/LoginPage.md +2 -325
  100. package/src/components/LoginPage/examples/LoginPageBasic.tsx +144 -0
  101. package/src/components/LoginPage/examples/LoginPageShowHidePassword.tsx +145 -0
  102. package/src/components/NotificationDrawer/examples/NotificationDrawer.md +69 -68
  103. package/src/components/SearchInput/SearchInput.tsx +32 -5
  104. package/src/components/SearchInput/__tests__/SearchInput.test.tsx +37 -0
  105. package/src/components/SearchInput/__tests__/__snapshots__/SearchInput.test.tsx.snap +193 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "4.224.8",
3
+ "version": "4.224.11",
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,16 +34,16 @@
34
34
  "generate": "node scripts/copyStyles.js"
35
35
  },
36
36
  "dependencies": {
37
- "@patternfly/react-icons": "^4.75.8",
38
- "@patternfly/react-styles": "^4.74.8",
39
- "@patternfly/react-tokens": "^4.76.8",
37
+ "@patternfly/react-icons": "^4.75.11",
38
+ "@patternfly/react-styles": "^4.74.11",
39
+ "@patternfly/react-tokens": "^4.76.11",
40
40
  "focus-trap": "6.9.2",
41
41
  "react-dropzone": "9.0.0",
42
42
  "tippy.js": "5.1.2",
43
43
  "tslib": "^2.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@patternfly/patternfly": "4.202.2",
46
+ "@patternfly/patternfly": "4.203.1",
47
47
  "@rollup/plugin-commonjs": "^21.0.0",
48
48
  "@rollup/plugin-node-resolve": "^13.0.0",
49
49
  "@rollup/plugin-replace": "^3.0.0",
@@ -54,11 +54,11 @@
54
54
  "rollup": "^2.58.0",
55
55
  "rollup-plugin-scss": "^3.0.0",
56
56
  "rollup-plugin-terser": "^7.0.0",
57
- "typescript": "^4.0.0"
57
+ "typescript": "^4.7.4"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "react": "^16.8.0 || ^17.0.0",
61
61
  "react-dom": "^16.8.0 || ^17.0.0"
62
62
  },
63
- "gitHead": "ca94c1683c2b516b9314f6e224065a3e77a31cff"
63
+ "gitHead": "030baae8a3dd4fe4a5bd0dda43804835cfc453bb"
64
64
  }
@@ -11,7 +11,7 @@ import {
11
11
  import ArrowRightIcon from '@patternfly/react-icons/dist/esm/icons/arrow-right-icon';
12
12
 
13
13
  export const AccordionBordered: React.FunctionComponent = () => {
14
- const [expanded, setExpanded] = React.useState('ex-toggle4');
14
+ const [expanded, setExpanded] = React.useState('bordered-toggle4');
15
15
  const [isDisplayLarge, setIsDisplayLarge] = React.useState(false);
16
16
 
17
17
  const displaySize = isDisplayLarge ? 'large' : 'default';
@@ -29,14 +29,14 @@ export const AccordionBordered: React.FunctionComponent = () => {
29
29
  <AccordionItem>
30
30
  <AccordionToggle
31
31
  onClick={() => {
32
- onToggle('ex-toggle1');
32
+ onToggle('bordered-toggle1');
33
33
  }}
34
- isExpanded={expanded === 'ex-toggle1'}
35
- id="ex-toggle1"
34
+ isExpanded={expanded === 'bordered-toggle1'}
35
+ id="bordered-toggle1"
36
36
  >
37
37
  Item one
38
38
  </AccordionToggle>
39
- <AccordionContent id="ex-expand1" isHidden={expanded !== 'ex-toggle1'}>
39
+ <AccordionContent id="bordered-expand1" isHidden={expanded !== 'bordered-toggle1'}>
40
40
  <p>
41
41
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
42
42
  dolore magna aliqua.
@@ -47,14 +47,14 @@ export const AccordionBordered: React.FunctionComponent = () => {
47
47
  <AccordionItem>
48
48
  <AccordionToggle
49
49
  onClick={() => {
50
- onToggle('ex-toggle2');
50
+ onToggle('bordered-toggle2');
51
51
  }}
52
- isExpanded={expanded === 'ex-toggle2'}
53
- id="ex-toggle2"
52
+ isExpanded={expanded === 'bordered-toggle2'}
53
+ id="bordered-toggle2"
54
54
  >
55
55
  Item two
56
56
  </AccordionToggle>
57
- <AccordionContent id="ex-expand2" isHidden={expanded !== 'ex-toggle2'}>
57
+ <AccordionContent id="bordered-expand2" isHidden={expanded !== 'bordered-toggle2'}>
58
58
  <p>
59
59
  Vivamus et tortor sed arcu congue vehicula eget et diam. Praesent nec dictum lorem. Aliquam id diam
60
60
  ultrices, faucibus erat id, maximus nunc.
@@ -65,14 +65,14 @@ export const AccordionBordered: React.FunctionComponent = () => {
65
65
  <AccordionItem>
66
66
  <AccordionToggle
67
67
  onClick={() => {
68
- onToggle('ex-toggle3');
68
+ onToggle('bordered-toggle3');
69
69
  }}
70
- isExpanded={expanded === 'ex-toggle3'}
71
- id="ex-toggle3"
70
+ isExpanded={expanded === 'bordered-toggle3'}
71
+ id="bordered-toggle3"
72
72
  >
73
73
  Item three
74
74
  </AccordionToggle>
75
- <AccordionContent id="ex-expand3" isHidden={expanded !== 'ex-toggle3'}>
75
+ <AccordionContent id="bordered-expand3" isHidden={expanded !== 'bordered-toggle3'}>
76
76
  <p>Morbi vitae urna quis nunc convallis hendrerit. Aliquam congue orci quis ultricies tempus.</p>
77
77
  </AccordionContent>
78
78
  </AccordionItem>
@@ -80,14 +80,14 @@ export const AccordionBordered: React.FunctionComponent = () => {
80
80
  <AccordionItem>
81
81
  <AccordionToggle
82
82
  onClick={() => {
83
- onToggle('ex-toggle4');
83
+ onToggle('bordered-toggle4');
84
84
  }}
85
- isExpanded={expanded === 'ex-toggle4'}
86
- id="ex-toggle4"
85
+ isExpanded={expanded === 'bordered-toggle4'}
86
+ id="bordered-toggle4"
87
87
  >
88
88
  Item four
89
89
  </AccordionToggle>
90
- <AccordionContent id="ex-expand4" isHidden={expanded !== 'ex-toggle4'} isCustomContent>
90
+ <AccordionContent id="bordered-expand4" isHidden={expanded !== 'bordered-toggle4'} isCustomContent>
91
91
  <AccordionExpandedContentBody>
92
92
  Donec vel posuere orci. Phasellus quis tortor a ex hendrerit efficitur. Aliquam lacinia ligula pharetra,
93
93
  sagittis ex ut, pellentesque diam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices
@@ -107,14 +107,14 @@ export const AccordionBordered: React.FunctionComponent = () => {
107
107
  <AccordionItem>
108
108
  <AccordionToggle
109
109
  onClick={() => {
110
- onToggle('ex-toggle5');
110
+ onToggle('bordered-toggle5');
111
111
  }}
112
- isExpanded={expanded === 'ex-toggle5'}
113
- id="ex-toggle5"
112
+ isExpanded={expanded === 'bordered-toggle5'}
113
+ id="bordered-toggle5"
114
114
  >
115
115
  Item five
116
116
  </AccordionToggle>
117
- <AccordionContent id="ex-expand5" isHidden={expanded !== 'ex-toggle5'}>
117
+ <AccordionContent id="bordered-expand5" isHidden={expanded !== 'bordered-toggle5'}>
118
118
  <p>Vivamus finibus dictum ex id ultrices. Mauris dictum neque a iaculis blandit.</p>
119
119
  </AccordionContent>
120
120
  </AccordionItem>
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { Accordion, AccordionItem, AccordionContent, AccordionToggle } from '@patternfly/react-core';
3
3
 
4
4
  export const AccordionDefinitionList: React.FunctionComponent = () => {
5
- const [expanded, setExpanded] = React.useState('ex-toggle2');
5
+ const [expanded, setExpanded] = React.useState('def-list-toggle2');
6
6
 
7
7
  const onToggle = (id: string) => {
8
8
  if (id === expanded) {
@@ -17,14 +17,14 @@ export const AccordionDefinitionList: React.FunctionComponent = () => {
17
17
  <AccordionItem>
18
18
  <AccordionToggle
19
19
  onClick={() => {
20
- onToggle('ex-toggle1');
20
+ onToggle('def-list-toggle1');
21
21
  }}
22
- isExpanded={expanded === 'ex-toggle1'}
23
- id="ex-toggle1"
22
+ isExpanded={expanded === 'def-list-toggle1'}
23
+ id="def-list-toggle1"
24
24
  >
25
25
  Item one
26
26
  </AccordionToggle>
27
- <AccordionContent id="ex-expand1" isHidden={expanded !== 'ex-toggle1'}>
27
+ <AccordionContent id="def-list-expand1" isHidden={expanded !== 'def-list-toggle1'}>
28
28
  <p>
29
29
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
30
30
  dolore magna aliqua.
@@ -35,14 +35,14 @@ export const AccordionDefinitionList: React.FunctionComponent = () => {
35
35
  <AccordionItem>
36
36
  <AccordionToggle
37
37
  onClick={() => {
38
- onToggle('ex-toggle2');
38
+ onToggle('def-list-toggle2');
39
39
  }}
40
- isExpanded={expanded === 'ex-toggle2'}
41
- id="ex-toggle2"
40
+ isExpanded={expanded === 'def-list-toggle2'}
41
+ id="def-list-toggle2"
42
42
  >
43
43
  Item two
44
44
  </AccordionToggle>
45
- <AccordionContent id="ex-expand2" isHidden={expanded !== 'ex-toggle2'}>
45
+ <AccordionContent id="def-list-expand2" isHidden={expanded !== 'def-list-toggle2'}>
46
46
  <p>
47
47
  Vivamus et tortor sed arcu congue vehicula eget et diam. Praesent nec dictum lorem. Aliquam id diam
48
48
  ultrices, faucibus erat id, maximus nunc.
@@ -53,14 +53,14 @@ export const AccordionDefinitionList: React.FunctionComponent = () => {
53
53
  <AccordionItem>
54
54
  <AccordionToggle
55
55
  onClick={() => {
56
- onToggle('ex-toggle3');
56
+ onToggle('def-list-toggle3');
57
57
  }}
58
- isExpanded={expanded === 'ex-toggle3'}
59
- id="ex-toggle3"
58
+ isExpanded={expanded === 'def-list-toggle3'}
59
+ id="def-list-toggle3"
60
60
  >
61
61
  Item three
62
62
  </AccordionToggle>
63
- <AccordionContent id="ex-expand3" isHidden={expanded !== 'ex-toggle3'}>
63
+ <AccordionContent id="def-list-expand3" isHidden={expanded !== 'def-list-toggle3'}>
64
64
  <p>Morbi vitae urna quis nunc convallis hendrerit. Aliquam congue orci quis ultricies tempus.</p>
65
65
  </AccordionContent>
66
66
  </AccordionItem>
@@ -68,14 +68,14 @@ export const AccordionDefinitionList: React.FunctionComponent = () => {
68
68
  <AccordionItem>
69
69
  <AccordionToggle
70
70
  onClick={() => {
71
- onToggle('ex-toggle4');
71
+ onToggle('def-list-toggle4');
72
72
  }}
73
- isExpanded={expanded === 'ex-toggle4'}
74
- id="ex-toggle4"
73
+ isExpanded={expanded === 'def-list-toggle4'}
74
+ id="def-list-toggle4"
75
75
  >
76
76
  Item four
77
77
  </AccordionToggle>
78
- <AccordionContent id="ex-expand4" isHidden={expanded !== 'ex-toggle4'}>
78
+ <AccordionContent id="def-list-expand4" isHidden={expanded !== 'def-list-toggle4'}>
79
79
  <p>
80
80
  Donec vel posuere orci. Phasellus quis tortor a ex hendrerit efficitur. Aliquam lacinia ligula pharetra,
81
81
  sagittis ex ut, pellentesque diam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere
@@ -91,14 +91,14 @@ export const AccordionDefinitionList: React.FunctionComponent = () => {
91
91
  <AccordionItem>
92
92
  <AccordionToggle
93
93
  onClick={() => {
94
- onToggle('ex-toggle5');
94
+ onToggle('def-list-toggle5');
95
95
  }}
96
- isExpanded={expanded === 'ex-toggle5'}
97
- id="ex-toggle5"
96
+ isExpanded={expanded === 'def-list-toggle5'}
97
+ id="def-list-toggle5"
98
98
  >
99
99
  Item five
100
100
  </AccordionToggle>
101
- <AccordionContent id="ex-expand5" isHidden={expanded !== 'ex-toggle5'}>
101
+ <AccordionContent id="def-list-expand5" isHidden={expanded !== 'def-list-toggle5'}>
102
102
  <p>Vivamus finibus dictum ex id ultrices. Mauris dictum neque a iaculis blandit.</p>
103
103
  </AccordionContent>
104
104
  </AccordionItem>
@@ -1,14 +1,49 @@
1
- import * as React from 'react';
2
- import { render } from '@testing-library/react';
1
+ import React from 'react';
2
+ import { render, screen } from '@testing-library/react';
3
3
  import { ActionList } from '../ActionList';
4
4
 
5
- describe('action list', () => {
6
- test('renders successfully', () => {
7
- const { asFragment } = render(<ActionList>test</ActionList>);
8
- expect(asFragment()).toMatchSnapshot();
9
- });
10
- test('isIconList flag adds modifier', () => {
11
- const { asFragment } = render(<ActionList isIconList>test</ActionList>);
12
- expect(asFragment()).toMatchSnapshot();
13
- });
5
+ test('Renders without children', () => {
6
+ render(<ActionList data-testid="action-list" />);
7
+ expect(screen.getByTestId('action-list')).toBeVisible();
8
+ });
9
+
10
+ test('Renders children', () => {
11
+ render(<ActionList>Test</ActionList>);
12
+
13
+ expect(screen.getByText('Test')).toBeVisible();
14
+ });
15
+
16
+ test('Renders with class pf-c-action-list', () => {
17
+ render(<ActionList>Test</ActionList>);
18
+
19
+ expect(screen.getByText('Test')).toHaveClass('pf-c-action-list');
20
+ });
21
+
22
+ test('Renders with custom class names provided via prop', () => {
23
+ render(<ActionList className="custom-class">Test</ActionList>);
24
+
25
+ expect(screen.getByText('Test')).toHaveClass('custom-class');
26
+ });
27
+
28
+ test('Does not render with class pf-m-icons by default', () => {
29
+ render(<ActionList>Test</ActionList>);
30
+
31
+ expect(screen.getByText('Test')).not.toHaveClass('pf-m-icons');
32
+ });
33
+
34
+ test('Renders with class pf-m-icons when isIconList is true', () => {
35
+ render(<ActionList isIconList={true}>Test</ActionList>);
36
+
37
+ expect(screen.getByText('Test')).toHaveClass('pf-m-icons');
38
+ });
39
+
40
+ test('Renders with inherited element props spread to the component', () => {
41
+ render(<ActionList aria-label="Test label">Test</ActionList>);
42
+
43
+ expect(screen.getByText('Test')).toHaveAccessibleName('Test label');
44
+ })
45
+
46
+ test('Matches the snapshot', () => {
47
+ const { asFragment } = render(<ActionList>test</ActionList>);
48
+ expect(asFragment()).toMatchSnapshot();
14
49
  });
@@ -1,10 +1,37 @@
1
- import * as React from 'react';
2
- import { render } from '@testing-library/react';
1
+ import React from 'react';
2
+ import { render, screen } from '@testing-library/react';
3
3
  import { ActionListGroup } from '../ActionListGroup';
4
4
 
5
- describe('action list group', () => {
6
- test('renders successfully', () => {
7
- const { asFragment } = render(<ActionListGroup>test</ActionListGroup>);
8
- expect(asFragment()).toMatchSnapshot();
9
- });
5
+ test('Renders without children', () => {
6
+ render(<ActionListGroup data-testid="action-list-group" />);
7
+ expect(screen.getByTestId('action-list-group')).toBeVisible();
8
+ });
9
+
10
+ test('Renders children', () => {
11
+ render(<ActionListGroup>Test</ActionListGroup>);
12
+
13
+ expect(screen.getByText('Test')).toBeVisible();
14
+ });
15
+
16
+ test('Renders with class pf-c-action-list__group', () => {
17
+ render(<ActionListGroup>Test</ActionListGroup>);
18
+
19
+ expect(screen.getByText('Test')).toHaveClass('pf-c-action-list__group');
20
+ });
21
+
22
+ test('Renders with custom class names provided via prop', () => {
23
+ render(<ActionListGroup className="custom-class">Test</ActionListGroup>);
24
+
25
+ expect(screen.getByText('Test')).toHaveClass('custom-class');
26
+ });
27
+
28
+ test('Renders with inherited element props spread to the component', () => {
29
+ render(<ActionListGroup aria-label="Test label">Test</ActionListGroup>);
30
+
31
+ expect(screen.getByText('Test')).toHaveAccessibleName('Test label');
32
+ })
33
+
34
+ test('Matches the snapshot', () => {
35
+ const { asFragment } = render(<ActionListGroup>test</ActionListGroup>);
36
+ expect(asFragment()).toMatchSnapshot();
10
37
  });
@@ -1,10 +1,37 @@
1
- import * as React from 'react';
2
- import { render } from '@testing-library/react';
1
+ import React from 'react';
2
+ import { render, screen } from '@testing-library/react';
3
3
  import { ActionListItem } from '../ActionListItem';
4
4
 
5
- describe('action list item', () => {
6
- test('renders successfully', () => {
7
- const { asFragment } = render(<ActionListItem>test</ActionListItem>);
8
- expect(asFragment()).toMatchSnapshot();
9
- });
5
+ test('Renders without children', () => {
6
+ render(<ActionListItem data-testid="action-list-item" />);
7
+ expect(screen.getByTestId('action-list-item')).toBeVisible();
8
+ });
9
+
10
+ test('Renders children', () => {
11
+ render(<ActionListItem>Test</ActionListItem>);
12
+
13
+ expect(screen.getByText('Test')).toBeVisible();
14
+ });
15
+
16
+ test('Renders with class pf-c-action-list__item', () => {
17
+ render(<ActionListItem>Test</ActionListItem>);
18
+
19
+ expect(screen.getByText('Test')).toHaveClass('pf-c-action-list__item');
20
+ });
21
+
22
+ test('Renders with custom class names provided via prop', () => {
23
+ render(<ActionListItem className="custom-class">Test</ActionListItem>);
24
+
25
+ expect(screen.getByText('Test')).toHaveClass('custom-class');
26
+ });
27
+
28
+ test('Renders with inherited element props spread to the component', () => {
29
+ render(<ActionListItem aria-label="Test label">Test</ActionListItem>);
30
+
31
+ expect(screen.getByText('Test')).toHaveAccessibleName('Test label');
32
+ })
33
+
34
+ test('Matches the snapshot', () => {
35
+ const { asFragment } = render(<ActionListItem>test</ActionListItem>);
36
+ expect(asFragment()).toMatchSnapshot();
10
37
  });
@@ -1,16 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`action list isIconList flag adds modifier 1`] = `
4
- <DocumentFragment>
5
- <div
6
- class="pf-c-action-list pf-m-icons"
7
- >
8
- test
9
- </div>
10
- </DocumentFragment>
11
- `;
12
-
13
- exports[`action list renders successfully 1`] = `
3
+ exports[`Matches the snapshot 1`] = `
14
4
  <DocumentFragment>
15
5
  <div
16
6
  class="pf-c-action-list"
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`action list group renders successfully 1`] = `
3
+ exports[`Matches the snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <div
6
6
  class="pf-c-action-list__group"
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`action list item renders successfully 1`] = `
3
+ exports[`Matches the snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <div
6
6
  class="pf-c-action-list__item"
@@ -5,24 +5,24 @@ export const ActionListMultipleGroups: React.FunctionComponent = () => (
5
5
  <ActionList>
6
6
  <ActionListGroup>
7
7
  <ActionListItem>
8
- <Button variant="primary" id="next-button">
8
+ <Button variant="primary" id="multi-group-next-button">
9
9
  Next
10
10
  </Button>
11
11
  </ActionListItem>
12
12
  <ActionListItem>
13
- <Button variant="secondary" id="back-button">
13
+ <Button variant="secondary" id="multi-group-back-button">
14
14
  Back
15
15
  </Button>
16
16
  </ActionListItem>
17
17
  </ActionListGroup>
18
18
  <ActionListGroup>
19
19
  <ActionListItem>
20
- <Button variant="primary" id="submit-button">
20
+ <Button variant="primary" id="multi-group-submit-button">
21
21
  Submit
22
22
  </Button>
23
23
  </ActionListItem>
24
24
  <ActionListItem>
25
- <Button variant="link" id="cancel-button">
25
+ <Button variant="link" id="multi-group-cancel-button">
26
26
  Cancel
27
27
  </Button>
28
28
  </ActionListItem>
@@ -47,12 +47,12 @@ export const ActionListSingleGroup: React.FunctionComponent = () => {
47
47
  <React.Fragment>
48
48
  <ActionList>
49
49
  <ActionListItem>
50
- <Button variant="primary" id="next-button">
50
+ <Button variant="primary" id="single-group-next-button">
51
51
  Next
52
52
  </Button>
53
53
  </ActionListItem>
54
54
  <ActionListItem>
55
- <Button variant="secondary" id="back-button">
55
+ <Button variant="secondary" id="single-group-back-button">
56
56
  Back
57
57
  </Button>
58
58
  </ActionListItem>
@@ -61,12 +61,12 @@ export const ActionListSingleGroup: React.FunctionComponent = () => {
61
61
  With kebab
62
62
  <ActionList>
63
63
  <ActionListItem>
64
- <Button variant="primary" id="next-button2">
64
+ <Button variant="primary" id="single-group-next-button2">
65
65
  Next
66
66
  </Button>
67
67
  </ActionListItem>
68
68
  <ActionListItem>
69
- <Button variant="secondary" id="back-button2">
69
+ <Button variant="secondary" id="single-group-back-button2">
70
70
  Back
71
71
  </Button>
72
72
  </ActionListItem>
@@ -6,12 +6,12 @@ export const ActionListWithCancelButton: React.FunctionComponent = () => (
6
6
  In modals, forms, data lists
7
7
  <ActionList>
8
8
  <ActionListItem>
9
- <Button variant="primary" id="save-button">
9
+ <Button variant="primary" id="with-cancel-save-button">
10
10
  Save
11
11
  </Button>
12
12
  </ActionListItem>
13
13
  <ActionListItem>
14
- <Button variant="link" id="cancel-button">
14
+ <Button variant="link" id="with-cancel-cancel-button">
15
15
  Cancel
16
16
  </Button>
17
17
  </ActionListItem>
@@ -21,19 +21,19 @@ export const ActionListWithCancelButton: React.FunctionComponent = () => (
21
21
  <ActionList>
22
22
  <ActionListGroup>
23
23
  <ActionListItem>
24
- <Button variant="primary" id="next-button">
24
+ <Button variant="primary" id="with-cancel-next-button">
25
25
  Next
26
26
  </Button>
27
27
  </ActionListItem>
28
28
  <ActionListItem>
29
- <Button variant="secondary" id="back-button">
29
+ <Button variant="secondary" id="with-cancel-back-button">
30
30
  Back
31
31
  </Button>
32
32
  </ActionListItem>
33
33
  </ActionListGroup>
34
34
  <ActionListGroup>
35
35
  <ActionListItem>
36
- <Button variant="link" id="cancel-button2">
36
+ <Button variant="link" id="with-cancel-cancel-button2">
37
37
  Cancel
38
38
  </Button>
39
39
  </ActionListItem>
@@ -6,12 +6,12 @@ import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
6
6
  export const ActionListWithIcons: React.FunctionComponent = () => (
7
7
  <ActionList isIconList>
8
8
  <ActionListItem>
9
- <Button variant="plain" id="times-button" aria-label="times icon button">
9
+ <Button variant="plain" id="with-icons-times-button" aria-label="times icon button">
10
10
  <TimesIcon />
11
11
  </Button>
12
12
  </ActionListItem>
13
13
  <ActionListItem>
14
- <Button variant="plain" id="check-button" aria-label="check icon button">
14
+ <Button variant="plain" id="with-icons-check-button" aria-label="check icon button">
15
15
  <CheckIcon />
16
16
  </Button>
17
17
  </ActionListItem>
@@ -28,13 +28,13 @@ export const CardSelectableA11yHighlight: React.FunctionComponent = () => {
28
28
  return (
29
29
  <React.Fragment>
30
30
  <Card
31
- id="selectable-first-card"
31
+ id="a11y-selectable-first-card"
32
32
  onKeyDown={onKeyDown}
33
33
  onClick={onClick}
34
34
  hasSelectableInput
35
35
  onSelectableInputChange={onChange}
36
36
  isSelectableRaised
37
- isSelected={selected === 'selectable-first-card'}
37
+ isSelected={selected === 'a11y-selectable-first-card'}
38
38
  >
39
39
  <CardTitle>Selectable card with proper accessibility considerations</CardTitle>
40
40
  <CardBody>
@@ -44,11 +44,11 @@ export const CardSelectableA11yHighlight: React.FunctionComponent = () => {
44
44
  </Card>
45
45
  <br />
46
46
  <Card
47
- id="selectable-second-card"
47
+ id="a11y-selectable-second-card"
48
48
  onKeyDown={onKeyDown}
49
49
  onClick={onClick}
50
50
  isSelectableRaised
51
- isSelected={selected === 'selectable-second-card'}
51
+ isSelected={selected === 'a11y-selectable-second-card'}
52
52
  >
53
53
  <CardTitle>Selectable card without proper accessibility considerations</CardTitle>
54
54
  <CardBody>
@@ -32,7 +32,7 @@ url: https://raw.githubusercontent.com/Azure-Samples/helm-charts/master/docs`;
32
32
  <React.Fragment>
33
33
  <CodeBlockAction>
34
34
  <ClipboardCopyButton
35
- id="copy-button"
35
+ id="basic-copy-button"
36
36
  textId="code-content"
37
37
  aria-label="Copy to clipboard"
38
38
  onClick={e => onClick(e, code)}
@@ -53,7 +53,7 @@ url: https://raw.githubusercontent.com/Azure-Samples/helm-charts/master/docs`;
53
53
  <React.Fragment>
54
54
  <CodeBlockAction>
55
55
  <ClipboardCopyButton
56
- id="copy-button"
56
+ id="expandable-copy-button"
57
57
  textId="code-content"
58
58
  aria-label="Copy to clipboard"
59
59
  onClick={e => onClick(e, copyBlock)}