@patternfly/react-core 4.200.0 → 4.201.0
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 +30 -0
- package/dist/esm/components/CalendarMonth/CalendarMonth.d.ts +1 -1
- package/dist/esm/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
- package/dist/esm/components/CalendarMonth/CalendarMonth.js +13 -8
- package/dist/esm/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.d.ts +1 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.d.ts.map +1 -1
- package/dist/js/components/CalendarMonth/CalendarMonth.js +13 -8
- package/dist/js/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/dist/umd/react-core.css +804 -804
- package/dist/umd/react-core.js +13 -8
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +5 -5
- package/src/components/CalendarMonth/CalendarMonth.tsx +15 -9
- package/src/components/ChipGroup/__tests__/ChipGroup.test.tsx +14 -9
- package/src/components/ClipboardCopy/__tests__/ClipboardCopyToggle.test.tsx +28 -19
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopyToggle.test.tsx.snap +1 -1
- package/src/components/ContextSelector/__tests__/ContextSelector.test.tsx +21 -14
- package/src/components/ContextSelector/__tests__/ContextSelectorToggle.test.tsx +49 -34
- package/src/components/ContextSelector/__tests__/__snapshots__/ContextSelector.test.tsx.snap +2 -169
- package/src/components/ContextSelector/__tests__/__snapshots__/ContextSelectorToggle.test.tsx.snap +5 -247
- package/src/components/DataList/__tests__/DataList.test.tsx +49 -40
- package/src/components/DataList/__tests__/__snapshots__/DataList.test.tsx.snap +1 -9
- package/src/components/Dropdown/__tests__/Dropdown.test.tsx +54 -42
- package/src/components/Dropdown/__tests__/DropdownToggle.test.tsx +179 -177
- package/src/components/Dropdown/__tests__/DropdownToggleCheckbox.test.tsx +51 -55
- package/src/components/Dropdown/__tests__/Generated/DropdownItem.test.tsx +28 -26
- package/src/components/Dropdown/__tests__/Generated/DropdownSeparator.test.tsx +14 -15
- package/src/components/Dropdown/__tests__/Generated/InternalDropdownItem.test.tsx +39 -36
- package/src/components/Dropdown/__tests__/Generated/__snapshots__/DropdownItem.test.tsx.snap +6 -4
- package/src/components/Dropdown/__tests__/Generated/__snapshots__/DropdownSeparator.test.tsx.snap +11 -4
- package/src/components/Dropdown/__tests__/Generated/__snapshots__/InternalDropdownItem.test.tsx.snap +7 -4
- package/src/components/Dropdown/__tests__/InternalDropdownItem.test.tsx +66 -69
- package/src/components/Dropdown/__tests__/__snapshots__/Dropdown.test.tsx.snap +15 -816
- package/src/components/Dropdown/__tests__/__snapshots__/DropdownToggle.test.tsx.snap +9 -454
- package/src/components/Dropdown/__tests__/__snapshots__/DropdownToggleCheckbox.test.tsx.snap +7 -141
- package/src/components/Dropdown/__tests__/__snapshots__/InternalDropdownItem.test.tsx.snap +10 -163
- package/src/components/Nav/__tests__/Generated/NavList.test.tsx +28 -18
- package/src/components/Nav/__tests__/Generated/__snapshots__/NavList.test.tsx.snap +8 -4
- package/src/components/OptionsMenu/__tests__/Generated/OptionsMenuItem.test.tsx +21 -19
- package/src/components/OptionsMenu/__tests__/Generated/__snapshots__/OptionsMenuItem.test.tsx.snap +20 -11
- package/src/components/OverflowMenu/__tests__/Generated/OverflowMenuDropdownItem.test.tsx +14 -10
- package/src/components/OverflowMenu/__tests__/Generated/__snapshots__/OverflowMenuDropdownItem.test.tsx.snap +18 -4
- package/src/components/Select/__tests__/Generated/SelectGroup.test.tsx +22 -10
- package/src/components/Select/__tests__/Generated/SelectMenu.test.tsx +22 -26
- package/src/components/Select/__tests__/Generated/__snapshots__/SelectGroup.test.tsx.snap +15 -4
- package/src/components/Select/__tests__/Generated/__snapshots__/SelectMenu.test.tsx.snap +7 -19
- package/src/components/Select/__tests__/SelectGroup.test.tsx +14 -7
- package/src/components/Select/__tests__/SelectOption.test.tsx +51 -30
- package/src/components/Select/__tests__/__snapshots__/SelectGroup.test.tsx.snap +1 -5
- package/src/components/Select/__tests__/__snapshots__/SelectOption.test.tsx.snap +10 -272
- package/src/components/Toolbar/__tests__/Generated/ToolbarToggleGroup.test.tsx +25 -11
- package/src/components/Toolbar/__tests__/Generated/__snapshots__/ToolbarToggleGroup.test.tsx.snap +26 -4
- package/src/components/Toolbar/__tests__/Toolbar.test.tsx +129 -0
- package/src/components/Toolbar/__tests__/ToolbarItem.test.tsx +19 -0
- package/src/components/Toolbar/__tests__/ToolbarToggleGroup.test.tsx +12 -135
- package/src/components/Toolbar/__tests__/__snapshots__/Toolbar.test.tsx.snap +7 -0
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarItem.test.tsx.snap +3 -0
- package/src/components/Tooltip/examples/Tooltip.md +9 -1
- package/src/components/Tooltip/examples/TooltipExamples.css +4 -4
- package/src/components/Select/__tests__/Generated/SelectOption.test.tsx +0 -29
- package/src/components/Select/__tests__/Generated/__snapshots__/SelectOption.test.tsx.snap +0 -7
- package/src/components/Toolbar/__tests__/__snapshots__/ToolbarToggleGroup.test.tsx.snap +0 -516
- package/src/components/Wizard/__tests__/Generated/Wizard.test.tsx +0 -43
- package/src/components/Wizard/__tests__/Generated/__snapshots__/Wizard.test.tsx.snap +0 -69
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import {
|
|
2
|
+
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
|
|
4
5
|
import { SelectOption, SelectOptionObject } from '../SelectOption';
|
|
5
6
|
import { SelectProvider } from '../selectConstants';
|
|
6
7
|
|
|
@@ -18,43 +19,48 @@ class User implements SelectOptionObject {
|
|
|
18
19
|
toString = (): string => `${this.title}: ${this.firstName} ${this.lastName}`;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
describe('
|
|
22
|
+
describe('SelectOption', () => {
|
|
22
23
|
test('renders with value parameter successfully', () => {
|
|
23
|
-
|
|
24
|
+
render(
|
|
24
25
|
<SelectProvider
|
|
25
26
|
value={{ onSelect: () => {}, onFavorite: () => {}, onClose: () => {}, variant: 'single', inputIdPrefix: '' }}
|
|
26
27
|
>
|
|
27
|
-
<SelectOption id="option-1" value="test" sendRef={jest.fn()} />
|
|
28
|
+
<SelectOption id="option-1" value="test" sendRef={jest.fn()} data-testid="test-id" />
|
|
28
29
|
</SelectProvider>
|
|
29
30
|
);
|
|
30
|
-
expect(
|
|
31
|
-
expect(view).toMatchSnapshot();
|
|
31
|
+
expect(screen.getByTestId('test-id').outerHTML).toMatchSnapshot();
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
test('renders with description successfully', () => {
|
|
35
|
-
|
|
35
|
+
render(
|
|
36
36
|
<SelectProvider
|
|
37
37
|
value={{ onSelect: () => {}, onFavorite: () => {}, onClose: () => {}, variant: 'single', inputIdPrefix: '' }}
|
|
38
38
|
>
|
|
39
|
-
<SelectOption
|
|
39
|
+
<SelectOption
|
|
40
|
+
id="option-1"
|
|
41
|
+
value="test"
|
|
42
|
+
description="This is a description"
|
|
43
|
+
sendRef={jest.fn()}
|
|
44
|
+
data-testid="test-id"
|
|
45
|
+
/>
|
|
40
46
|
</SelectProvider>
|
|
41
47
|
);
|
|
42
|
-
expect(
|
|
48
|
+
expect(screen.getByTestId('test-id').outerHTML).toMatchSnapshot();
|
|
43
49
|
});
|
|
44
50
|
|
|
45
51
|
test('renders with item count successfully', () => {
|
|
46
|
-
|
|
52
|
+
render(
|
|
47
53
|
<SelectProvider
|
|
48
54
|
value={{ onSelect: () => {}, onFavorite: () => {}, onClose: () => {}, variant: 'single', inputIdPrefix: '' }}
|
|
49
55
|
>
|
|
50
|
-
<SelectOption id="option-1" value="test" itemCount={3} sendRef={jest.fn()} />
|
|
56
|
+
<SelectOption id="option-1" value="test" itemCount={3} sendRef={jest.fn()} data-testid="test-id" />
|
|
51
57
|
</SelectProvider>
|
|
52
58
|
);
|
|
53
|
-
expect(
|
|
59
|
+
expect(screen.getByTestId('test-id').outerHTML).toMatchSnapshot();
|
|
54
60
|
});
|
|
55
61
|
|
|
56
62
|
test('renders with custom display successfully', () => {
|
|
57
|
-
|
|
63
|
+
render(
|
|
58
64
|
<SelectProvider
|
|
59
65
|
value={{ onSelect: () => {}, onFavorite: () => {}, onClose: () => {}, variant: 'single', inputIdPrefix: '' }}
|
|
60
66
|
>
|
|
@@ -63,22 +69,22 @@ describe('select options', () => {
|
|
|
63
69
|
</SelectOption>
|
|
64
70
|
</SelectProvider>
|
|
65
71
|
);
|
|
66
|
-
expect(
|
|
72
|
+
expect(screen.getByText('test display').outerHTML).toMatchSnapshot();
|
|
67
73
|
});
|
|
68
74
|
|
|
69
75
|
test('renders with custom user object successfully', () => {
|
|
70
|
-
|
|
76
|
+
render(
|
|
71
77
|
<SelectProvider
|
|
72
78
|
value={{ onSelect: () => {}, onFavorite: () => {}, onClose: () => {}, variant: 'single', inputIdPrefix: '' }}
|
|
73
79
|
>
|
|
74
|
-
<SelectOption id="option-1" value={new User('Mr.', 'Test', 'User')} sendRef={jest.fn()} />
|
|
80
|
+
<SelectOption id="option-1" value={new User('Mr.', 'Test', 'User')} sendRef={jest.fn()} data-testid="test-id" />
|
|
75
81
|
</SelectProvider>
|
|
76
82
|
);
|
|
77
|
-
expect(
|
|
83
|
+
expect(screen.getByTestId('test-id').outerHTML).toMatchSnapshot();
|
|
78
84
|
});
|
|
79
85
|
|
|
80
86
|
test('renders with custom display and custom user object successfully', () => {
|
|
81
|
-
|
|
87
|
+
render(
|
|
82
88
|
<SelectProvider
|
|
83
89
|
value={{ onSelect: () => {}, onFavorite: () => {}, onClose: () => {}, variant: 'single', inputIdPrefix: '' }}
|
|
84
90
|
>
|
|
@@ -87,11 +93,11 @@ describe('select options', () => {
|
|
|
87
93
|
</SelectOption>
|
|
88
94
|
</SelectProvider>
|
|
89
95
|
);
|
|
90
|
-
expect(
|
|
96
|
+
expect(screen.getByText('test display').outerHTML).toMatchSnapshot();
|
|
91
97
|
});
|
|
92
98
|
|
|
93
99
|
test('renders custom component', () => {
|
|
94
|
-
|
|
100
|
+
render(
|
|
95
101
|
<SelectProvider
|
|
96
102
|
value={{ onSelect: () => {}, onFavorite: () => {}, onClose: () => {}, variant: 'single', inputIdPrefix: '' }}
|
|
97
103
|
>
|
|
@@ -100,34 +106,47 @@ describe('select options', () => {
|
|
|
100
106
|
</SelectOption>
|
|
101
107
|
</SelectProvider>
|
|
102
108
|
);
|
|
103
|
-
expect(
|
|
109
|
+
expect(screen.getByText('test display').outerHTML).toMatchSnapshot();
|
|
104
110
|
});
|
|
105
111
|
|
|
106
112
|
describe('disabled', () => {
|
|
107
113
|
test('renders disabled successfully', () => {
|
|
108
|
-
|
|
114
|
+
render(
|
|
109
115
|
<SelectProvider
|
|
110
116
|
value={{ onSelect: () => {}, onFavorite: () => {}, onClose: () => {}, variant: 'single', inputIdPrefix: '' }}
|
|
111
117
|
>
|
|
112
|
-
<SelectOption id="option-1" isDisabled value="test" sendRef={jest.fn()} />
|
|
118
|
+
<SelectOption id="option-1" isDisabled value="test" sendRef={jest.fn()} data-testid="test-id" />
|
|
113
119
|
</SelectProvider>
|
|
114
120
|
);
|
|
115
|
-
|
|
116
|
-
expect(
|
|
121
|
+
|
|
122
|
+
expect(screen.getByText('test').className).toContain('pf-m-disabled');
|
|
123
|
+
expect(screen.getByTestId('test-id').outerHTML).toMatchSnapshot();
|
|
117
124
|
});
|
|
118
125
|
});
|
|
119
126
|
|
|
120
127
|
describe('is selected', () => {
|
|
121
128
|
test('renders selected successfully', () => {
|
|
122
|
-
|
|
123
|
-
|
|
129
|
+
render(
|
|
130
|
+
<SelectProvider
|
|
131
|
+
value={{ onSelect: () => {}, onFavorite: () => {}, onClose: () => {}, variant: 'single', inputIdPrefix: '' }}
|
|
132
|
+
>
|
|
133
|
+
<SelectOption id="option-1" isSelected value="test" sendRef={jest.fn()} data-testid="test-id" />
|
|
134
|
+
</SelectProvider>
|
|
135
|
+
);
|
|
136
|
+
expect(screen.getByTestId('test-id').outerHTML).toMatchSnapshot();
|
|
124
137
|
});
|
|
125
138
|
});
|
|
126
139
|
|
|
127
140
|
describe('checked', () => {
|
|
128
141
|
test('renders with checked successfully', () => {
|
|
129
|
-
|
|
130
|
-
|
|
142
|
+
render(
|
|
143
|
+
<SelectProvider
|
|
144
|
+
value={{ onSelect: () => {}, onFavorite: () => {}, onClose: () => {}, variant: 'single', inputIdPrefix: '' }}
|
|
145
|
+
>
|
|
146
|
+
<SelectOption id="option-1" isChecked value="test" sendRef={jest.fn()} data-testid="test-id" />
|
|
147
|
+
</SelectProvider>
|
|
148
|
+
);
|
|
149
|
+
expect(screen.getByTestId('test-id').outerHTML).toMatchSnapshot();
|
|
131
150
|
});
|
|
132
151
|
});
|
|
133
152
|
|
|
@@ -135,6 +154,7 @@ describe('select options', () => {
|
|
|
135
154
|
test('generates warning when id is undefined and isFavorites is set', () => {
|
|
136
155
|
const myMock = jest.fn() as any;
|
|
137
156
|
global.console = { error: myMock } as any;
|
|
157
|
+
|
|
138
158
|
render(
|
|
139
159
|
<SelectProvider
|
|
140
160
|
value={{ onSelect: () => {}, onFavorite: () => {}, onClose: () => {}, variant: 'single', inputIdPrefix: '' }}
|
|
@@ -142,6 +162,7 @@ describe('select options', () => {
|
|
|
142
162
|
<SelectOption isFavorite value="test" sendRef={jest.fn()} />
|
|
143
163
|
</SelectProvider>
|
|
144
164
|
);
|
|
165
|
+
|
|
145
166
|
expect(myMock).toBeCalled();
|
|
146
167
|
});
|
|
147
168
|
});
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
4
|
-
<ContextConsumer>
|
|
5
|
-
<Component />
|
|
6
|
-
</ContextConsumer>
|
|
7
|
-
`;
|
|
3
|
+
exports[`SelectGroup renders with children successfully 1`] = `"<div data-testid=\\"test-id\\" class=\\"pf-c-select__menu-group\\"><div class=\\"pf-c-select__menu-group-title\\" id=\\"\\" aria-hidden=\\"true\\">test</div><ul role=\\"listbox\\"><div>child</div></ul></div>"`;
|
|
@@ -1,283 +1,21 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
4
|
-
<ContextConsumer>
|
|
5
|
-
<Component />
|
|
6
|
-
</ContextConsumer>
|
|
7
|
-
`;
|
|
3
|
+
exports[`SelectOption checked renders with checked successfully 1`] = `"<button data-testid=\\"test-id\\" class=\\"pf-c-select__menu-item\\" role=\\"option\\" type=\\"button\\">test</button>"`;
|
|
8
4
|
|
|
9
|
-
exports[`
|
|
10
|
-
<SelectOption
|
|
11
|
-
className=""
|
|
12
|
-
component="button"
|
|
13
|
-
id="option-1"
|
|
14
|
-
index={0}
|
|
15
|
-
inputId=""
|
|
16
|
-
isChecked={false}
|
|
17
|
-
isDisabled={true}
|
|
18
|
-
isFavorite={null}
|
|
19
|
-
isLastOptionBeforeFooter={[Function]}
|
|
20
|
-
isLoad={false}
|
|
21
|
-
isLoading={false}
|
|
22
|
-
isNoResultsOption={false}
|
|
23
|
-
isPlaceholder={false}
|
|
24
|
-
isSelected={false}
|
|
25
|
-
keyHandler={[Function]}
|
|
26
|
-
onClick={[Function]}
|
|
27
|
-
sendRef={
|
|
28
|
-
[MockFunction] {
|
|
29
|
-
"calls": Array [
|
|
30
|
-
Array [
|
|
31
|
-
null,
|
|
32
|
-
null,
|
|
33
|
-
null,
|
|
34
|
-
0,
|
|
35
|
-
],
|
|
36
|
-
],
|
|
37
|
-
"results": Array [
|
|
38
|
-
Object {
|
|
39
|
-
"type": "return",
|
|
40
|
-
"value": undefined,
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
setViewMoreNextIndex={[Function]}
|
|
46
|
-
value="test"
|
|
47
|
-
>
|
|
48
|
-
<li
|
|
49
|
-
className="pf-c-select__menu-wrapper"
|
|
50
|
-
id="option-1"
|
|
51
|
-
role="presentation"
|
|
52
|
-
>
|
|
53
|
-
<button
|
|
54
|
-
aria-selected={null}
|
|
55
|
-
className="pf-c-select__menu-item pf-m-disabled"
|
|
56
|
-
onClick={[Function]}
|
|
57
|
-
onKeyDown={[Function]}
|
|
58
|
-
role="option"
|
|
59
|
-
type="button"
|
|
60
|
-
>
|
|
61
|
-
test
|
|
62
|
-
</button>
|
|
63
|
-
</li>
|
|
64
|
-
</SelectOption>
|
|
65
|
-
`;
|
|
5
|
+
exports[`SelectOption disabled renders disabled successfully 1`] = `"<button data-testid=\\"test-id\\" class=\\"pf-c-select__menu-item pf-m-disabled\\" role=\\"option\\" type=\\"button\\">test</button>"`;
|
|
66
6
|
|
|
67
|
-
exports[`
|
|
68
|
-
<ContextConsumer>
|
|
69
|
-
<Component />
|
|
70
|
-
</ContextConsumer>
|
|
71
|
-
`;
|
|
7
|
+
exports[`SelectOption is selected renders selected successfully 1`] = `"<button data-testid=\\"test-id\\" class=\\"pf-c-select__menu-item pf-m-selected\\" role=\\"option\\" aria-selected=\\"true\\" type=\\"button\\">test<span class=\\"pf-c-select__menu-item-icon\\"><svg style=\\"vertical-align: -0.125em;\\" fill=\\"currentColor\\" height=\\"1em\\" width=\\"1em\\" viewBox=\\"0 0 512 512\\" aria-hidden=\\"true\\" role=\\"img\\"><path d=\\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\\"></path></svg></span></button>"`;
|
|
72
8
|
|
|
73
|
-
exports[`
|
|
74
|
-
<div>
|
|
75
|
-
<li
|
|
76
|
-
class="pf-c-select__menu-wrapper"
|
|
77
|
-
id="option-1"
|
|
78
|
-
role="presentation"
|
|
79
|
-
>
|
|
80
|
-
<div
|
|
81
|
-
class="pf-c-select__menu-item"
|
|
82
|
-
role="option"
|
|
83
|
-
type="button"
|
|
84
|
-
>
|
|
85
|
-
<div>
|
|
86
|
-
test display
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
</li>
|
|
90
|
-
</div>
|
|
91
|
-
`;
|
|
9
|
+
exports[`SelectOption renders custom component 1`] = `"<div>test display</div>"`;
|
|
92
10
|
|
|
93
|
-
exports[`
|
|
94
|
-
<div>
|
|
95
|
-
<li
|
|
96
|
-
class="pf-c-select__menu-wrapper"
|
|
97
|
-
id="option-1"
|
|
98
|
-
role="presentation"
|
|
99
|
-
>
|
|
100
|
-
<button
|
|
101
|
-
class="pf-c-select__menu-item"
|
|
102
|
-
role="option"
|
|
103
|
-
type="button"
|
|
104
|
-
>
|
|
105
|
-
<div>
|
|
106
|
-
test display
|
|
107
|
-
</div>
|
|
108
|
-
</button>
|
|
109
|
-
</li>
|
|
110
|
-
</div>
|
|
111
|
-
`;
|
|
11
|
+
exports[`SelectOption renders with custom display and custom user object successfully 1`] = `"<div>test display</div>"`;
|
|
112
12
|
|
|
113
|
-
exports[`
|
|
114
|
-
<div>
|
|
115
|
-
<li
|
|
116
|
-
class="pf-c-select__menu-wrapper"
|
|
117
|
-
id="option-1"
|
|
118
|
-
role="presentation"
|
|
119
|
-
>
|
|
120
|
-
<button
|
|
121
|
-
class="pf-c-select__menu-item"
|
|
122
|
-
role="option"
|
|
123
|
-
type="button"
|
|
124
|
-
>
|
|
125
|
-
<div>
|
|
126
|
-
test display
|
|
127
|
-
</div>
|
|
128
|
-
</button>
|
|
129
|
-
</li>
|
|
130
|
-
</div>
|
|
131
|
-
`;
|
|
13
|
+
exports[`SelectOption renders with custom display successfully 1`] = `"<div>test display</div>"`;
|
|
132
14
|
|
|
133
|
-
exports[`
|
|
134
|
-
<div>
|
|
135
|
-
<li
|
|
136
|
-
class="pf-c-select__menu-wrapper"
|
|
137
|
-
id="option-1"
|
|
138
|
-
role="presentation"
|
|
139
|
-
>
|
|
140
|
-
<button
|
|
141
|
-
class="pf-c-select__menu-item"
|
|
142
|
-
role="option"
|
|
143
|
-
type="button"
|
|
144
|
-
>
|
|
145
|
-
Mr.: Test User
|
|
146
|
-
</button>
|
|
147
|
-
</li>
|
|
148
|
-
</div>
|
|
149
|
-
`;
|
|
15
|
+
exports[`SelectOption renders with custom user object successfully 1`] = `"<button data-testid=\\"test-id\\" class=\\"pf-c-select__menu-item\\" role=\\"option\\" type=\\"button\\">Mr.: Test User</button>"`;
|
|
150
16
|
|
|
151
|
-
exports[`
|
|
152
|
-
<div>
|
|
153
|
-
<li
|
|
154
|
-
class="pf-c-select__menu-wrapper"
|
|
155
|
-
id="option-1"
|
|
156
|
-
role="presentation"
|
|
157
|
-
>
|
|
158
|
-
<button
|
|
159
|
-
class="pf-c-select__menu-item pf-m-description"
|
|
160
|
-
role="option"
|
|
161
|
-
type="button"
|
|
162
|
-
>
|
|
163
|
-
<span
|
|
164
|
-
class="pf-c-select__menu-item-main"
|
|
165
|
-
>
|
|
166
|
-
test
|
|
167
|
-
</span>
|
|
168
|
-
<span
|
|
169
|
-
class="pf-c-select__menu-item-description"
|
|
170
|
-
>
|
|
171
|
-
This is a description
|
|
172
|
-
</span>
|
|
173
|
-
</button>
|
|
174
|
-
</li>
|
|
175
|
-
</div>
|
|
176
|
-
`;
|
|
17
|
+
exports[`SelectOption renders with description successfully 1`] = `"<button data-testid=\\"test-id\\" class=\\"pf-c-select__menu-item pf-m-description\\" role=\\"option\\" type=\\"button\\"><span class=\\"pf-c-select__menu-item-main\\">test</span><span class=\\"pf-c-select__menu-item-description\\">This is a description</span></button>"`;
|
|
177
18
|
|
|
178
|
-
exports[`
|
|
179
|
-
<div>
|
|
180
|
-
<li
|
|
181
|
-
class="pf-c-select__menu-wrapper"
|
|
182
|
-
id="option-1"
|
|
183
|
-
role="presentation"
|
|
184
|
-
>
|
|
185
|
-
<button
|
|
186
|
-
class="pf-c-select__menu-item"
|
|
187
|
-
role="option"
|
|
188
|
-
type="button"
|
|
189
|
-
>
|
|
190
|
-
<span
|
|
191
|
-
class="pf-c-select__menu-item-row"
|
|
192
|
-
>
|
|
193
|
-
<span
|
|
194
|
-
class="pf-c-select__menu-item-text"
|
|
195
|
-
>
|
|
196
|
-
test
|
|
197
|
-
</span>
|
|
198
|
-
<span
|
|
199
|
-
class="pf-c-select__menu-item-count"
|
|
200
|
-
>
|
|
201
|
-
3
|
|
202
|
-
</span>
|
|
203
|
-
</span>
|
|
204
|
-
</button>
|
|
205
|
-
</li>
|
|
206
|
-
</div>
|
|
207
|
-
`;
|
|
19
|
+
exports[`SelectOption renders with item count successfully 1`] = `"<button data-testid=\\"test-id\\" class=\\"pf-c-select__menu-item\\" role=\\"option\\" type=\\"button\\"><span class=\\"pf-c-select__menu-item-row\\"><span class=\\"pf-c-select__menu-item-text\\">test</span><span class=\\"pf-c-select__menu-item-count\\">3</span></span></button>"`;
|
|
208
20
|
|
|
209
|
-
exports[`
|
|
210
|
-
<SelectOption
|
|
211
|
-
className=""
|
|
212
|
-
component="button"
|
|
213
|
-
id="option-1"
|
|
214
|
-
index={0}
|
|
215
|
-
inputId=""
|
|
216
|
-
isChecked={false}
|
|
217
|
-
isDisabled={false}
|
|
218
|
-
isFavorite={null}
|
|
219
|
-
isLastOptionBeforeFooter={[Function]}
|
|
220
|
-
isLoad={false}
|
|
221
|
-
isLoading={false}
|
|
222
|
-
isNoResultsOption={false}
|
|
223
|
-
isPlaceholder={false}
|
|
224
|
-
isSelected={false}
|
|
225
|
-
keyHandler={[Function]}
|
|
226
|
-
onClick={[Function]}
|
|
227
|
-
sendRef={
|
|
228
|
-
[MockFunction] {
|
|
229
|
-
"calls": Array [
|
|
230
|
-
Array [
|
|
231
|
-
<button
|
|
232
|
-
class="pf-c-select__menu-item"
|
|
233
|
-
role="option"
|
|
234
|
-
type="button"
|
|
235
|
-
>
|
|
236
|
-
test
|
|
237
|
-
</button>,
|
|
238
|
-
null,
|
|
239
|
-
<li
|
|
240
|
-
class="pf-c-select__menu-wrapper"
|
|
241
|
-
id="option-1"
|
|
242
|
-
role="presentation"
|
|
243
|
-
>
|
|
244
|
-
<button
|
|
245
|
-
class="pf-c-select__menu-item"
|
|
246
|
-
role="option"
|
|
247
|
-
type="button"
|
|
248
|
-
>
|
|
249
|
-
test
|
|
250
|
-
</button>
|
|
251
|
-
</li>,
|
|
252
|
-
0,
|
|
253
|
-
],
|
|
254
|
-
],
|
|
255
|
-
"results": Array [
|
|
256
|
-
Object {
|
|
257
|
-
"type": "return",
|
|
258
|
-
"value": undefined,
|
|
259
|
-
},
|
|
260
|
-
],
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
setViewMoreNextIndex={[Function]}
|
|
264
|
-
value="test"
|
|
265
|
-
>
|
|
266
|
-
<li
|
|
267
|
-
className="pf-c-select__menu-wrapper"
|
|
268
|
-
id="option-1"
|
|
269
|
-
role="presentation"
|
|
270
|
-
>
|
|
271
|
-
<button
|
|
272
|
-
aria-selected={null}
|
|
273
|
-
className="pf-c-select__menu-item"
|
|
274
|
-
onClick={[Function]}
|
|
275
|
-
onKeyDown={[Function]}
|
|
276
|
-
role="option"
|
|
277
|
-
type="button"
|
|
278
|
-
>
|
|
279
|
-
test
|
|
280
|
-
</button>
|
|
281
|
-
</li>
|
|
282
|
-
</SelectOption>
|
|
283
|
-
`;
|
|
21
|
+
exports[`SelectOption renders with value parameter successfully 1`] = `"<button data-testid=\\"test-id\\" class=\\"pf-c-select__menu-item\\" role=\\"option\\" type=\\"button\\">test</button>"`;
|
|
@@ -1,13 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
* This test was generated
|
|
3
|
-
*/
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import { shallow } from 'enzyme';
|
|
6
|
-
import { ToolbarToggleGroup } from '../../ToolbarToggleGroup';
|
|
7
|
-
// any missing imports can usually be resolved by adding them here
|
|
8
|
-
import {} from '../..';
|
|
1
|
+
import React from 'react';
|
|
9
2
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
import { render } from '@testing-library/react';
|
|
4
|
+
|
|
5
|
+
import { ToolbarContentContext, ToolbarToggleGroup } from '../..';
|
|
6
|
+
import { PageContext } from '../../../Page/Page';
|
|
7
|
+
|
|
8
|
+
describe('ToolbarToggleGroup', () => {
|
|
9
|
+
it('should match snapshot', () => {
|
|
10
|
+
const view = render(
|
|
11
|
+
<PageContext.Provider
|
|
12
|
+
value={{ isManagedSidebar: false, onNavToggle: jest.fn(), isNavOpen: true, width: 1, getBreakpoint: jest.fn() }}
|
|
13
|
+
>
|
|
14
|
+
<ToolbarContentContext.Provider
|
|
15
|
+
value={{
|
|
16
|
+
expandableContentId: 'test',
|
|
17
|
+
expandableContentRef: { current: ((<></>) as unknown) as HTMLDivElement },
|
|
18
|
+
chipContainerRef: { current: ((<></>) as unknown) as HTMLDivElement }
|
|
19
|
+
}}
|
|
20
|
+
>
|
|
21
|
+
<ToolbarToggleGroup breakpoint="xl" toggleIcon={<div>ReactNode</div>} />
|
|
22
|
+
</ToolbarContentContext.Provider>
|
|
23
|
+
</PageContext.Provider>
|
|
24
|
+
);
|
|
25
|
+
expect(view.container).toMatchSnapshot();
|
|
26
|
+
});
|
|
13
27
|
});
|
package/src/components/Toolbar/__tests__/Generated/__snapshots__/ToolbarToggleGroup.test.tsx.snap
CHANGED
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`ToolbarToggleGroup should match snapshot
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
|
|
3
|
+
exports[`ToolbarToggleGroup should match snapshot 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="pf-c-toolbar__group pf-m-toggle-group pf-m-show-on-xl"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
class="pf-c-toolbar__toggle"
|
|
10
|
+
>
|
|
11
|
+
<button
|
|
12
|
+
aria-controls="test"
|
|
13
|
+
aria-disabled="false"
|
|
14
|
+
aria-haspopup="false"
|
|
15
|
+
aria-label="Show Filters"
|
|
16
|
+
class="pf-c-button pf-m-plain"
|
|
17
|
+
data-ouia-component-id="OUIA-Generated-Button-plain-1"
|
|
18
|
+
data-ouia-component-type="PF4/Button"
|
|
19
|
+
data-ouia-safe="true"
|
|
20
|
+
type="button"
|
|
21
|
+
>
|
|
22
|
+
<div>
|
|
23
|
+
ReactNode
|
|
24
|
+
</div>
|
|
25
|
+
</button>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
7
29
|
`;
|