@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,174 +1,21 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`dropdown items a 1`] = `
|
|
4
|
-
<div>
|
|
5
|
-
<li
|
|
6
|
-
role="none"
|
|
7
|
-
>
|
|
8
|
-
<a
|
|
9
|
-
class=""
|
|
10
|
-
>
|
|
11
|
-
Something
|
|
12
|
-
</a>
|
|
13
|
-
</li>
|
|
14
|
-
</div>
|
|
15
|
-
`;
|
|
3
|
+
exports[`InternalDropdownItem dropdown items a 1`] = `"<a class=\\"\\">Something</a>"`;
|
|
16
4
|
|
|
17
|
-
exports[`dropdown items aria-disabled a 1`] = `
|
|
18
|
-
<div>
|
|
19
|
-
<li
|
|
20
|
-
role="none"
|
|
21
|
-
>
|
|
22
|
-
<a
|
|
23
|
-
aria-disabled="true"
|
|
24
|
-
class="pf-m-aria-disabled"
|
|
25
|
-
>
|
|
26
|
-
Something
|
|
27
|
-
</a>
|
|
28
|
-
</li>
|
|
29
|
-
</div>
|
|
30
|
-
`;
|
|
5
|
+
exports[`InternalDropdownItem dropdown items aria-disabled a 1`] = `"<a aria-disabled=\\"true\\" class=\\"pf-m-aria-disabled\\">Something</a>"`;
|
|
31
6
|
|
|
32
|
-
exports[`dropdown items aria-disabled button 1`] = `
|
|
33
|
-
<div>
|
|
34
|
-
<li
|
|
35
|
-
role="none"
|
|
36
|
-
>
|
|
37
|
-
<button
|
|
38
|
-
aria-disabled="true"
|
|
39
|
-
class="pf-m-aria-disabled"
|
|
40
|
-
type="button"
|
|
41
|
-
>
|
|
42
|
-
Something
|
|
43
|
-
</button>
|
|
44
|
-
</li>
|
|
45
|
-
</div>
|
|
46
|
-
`;
|
|
7
|
+
exports[`InternalDropdownItem dropdown items aria-disabled button 1`] = `"<button aria-disabled=\\"true\\" type=\\"button\\" class=\\"pf-m-aria-disabled\\">Something</button>"`;
|
|
47
8
|
|
|
48
|
-
exports[`dropdown items button 1`] = `
|
|
49
|
-
<div>
|
|
50
|
-
<li
|
|
51
|
-
role="none"
|
|
52
|
-
>
|
|
53
|
-
<button
|
|
54
|
-
class=""
|
|
55
|
-
type="button"
|
|
56
|
-
>
|
|
57
|
-
Something
|
|
58
|
-
</button>
|
|
59
|
-
</li>
|
|
60
|
-
</div>
|
|
61
|
-
`;
|
|
9
|
+
exports[`InternalDropdownItem dropdown items button 1`] = `"<button type=\\"button\\" class=\\"\\">Something</button>"`;
|
|
62
10
|
|
|
63
|
-
exports[`dropdown items description a 1`] = `
|
|
64
|
-
<div>
|
|
65
|
-
<li
|
|
66
|
-
role="none"
|
|
67
|
-
>
|
|
68
|
-
<a
|
|
69
|
-
class="pf-m-description"
|
|
70
|
-
>
|
|
71
|
-
<div
|
|
72
|
-
class="pf-c-dropdown__menu-item-main"
|
|
73
|
-
>
|
|
74
|
-
Something
|
|
75
|
-
</div>
|
|
76
|
-
<div
|
|
77
|
-
class="pf-c-dropdown__menu-item-description"
|
|
78
|
-
>
|
|
79
|
-
Something's link description
|
|
80
|
-
</div>
|
|
81
|
-
</a>
|
|
82
|
-
</li>
|
|
83
|
-
</div>
|
|
84
|
-
`;
|
|
11
|
+
exports[`InternalDropdownItem dropdown items description a 1`] = `"<div class=\\"pf-c-dropdown__menu-item-description\\">Something's link description</div>"`;
|
|
85
12
|
|
|
86
|
-
exports[`dropdown items description button 1`] = `
|
|
87
|
-
<div>
|
|
88
|
-
<li
|
|
89
|
-
role="none"
|
|
90
|
-
>
|
|
91
|
-
<button
|
|
92
|
-
class="pf-m-description"
|
|
93
|
-
type="button"
|
|
94
|
-
>
|
|
95
|
-
<div
|
|
96
|
-
class="pf-c-dropdown__menu-item-main"
|
|
97
|
-
>
|
|
98
|
-
Something
|
|
99
|
-
</div>
|
|
100
|
-
<div
|
|
101
|
-
class="pf-c-dropdown__menu-item-description"
|
|
102
|
-
>
|
|
103
|
-
Something's button description
|
|
104
|
-
</div>
|
|
105
|
-
</button>
|
|
106
|
-
</li>
|
|
107
|
-
</div>
|
|
108
|
-
`;
|
|
13
|
+
exports[`InternalDropdownItem dropdown items description button 1`] = `"<div class=\\"pf-c-dropdown__menu-item-description\\">Something's button description</div>"`;
|
|
109
14
|
|
|
110
|
-
exports[`dropdown items disabled a 1`] = `
|
|
111
|
-
<div>
|
|
112
|
-
<li
|
|
113
|
-
role="none"
|
|
114
|
-
>
|
|
115
|
-
<a
|
|
116
|
-
aria-disabled="true"
|
|
117
|
-
class=""
|
|
118
|
-
>
|
|
119
|
-
Something
|
|
120
|
-
</a>
|
|
121
|
-
</li>
|
|
122
|
-
</div>
|
|
123
|
-
`;
|
|
15
|
+
exports[`InternalDropdownItem dropdown items disabled a 1`] = `"<a aria-disabled=\\"true\\" class=\\"\\">Something</a>"`;
|
|
124
16
|
|
|
125
|
-
exports[`dropdown items disabled button 1`] = `
|
|
126
|
-
<div>
|
|
127
|
-
<li
|
|
128
|
-
role="none"
|
|
129
|
-
>
|
|
130
|
-
<button
|
|
131
|
-
aria-disabled="true"
|
|
132
|
-
class=""
|
|
133
|
-
type="button"
|
|
134
|
-
>
|
|
135
|
-
Something
|
|
136
|
-
</button>
|
|
137
|
-
</li>
|
|
138
|
-
</div>
|
|
139
|
-
`;
|
|
17
|
+
exports[`InternalDropdownItem dropdown items disabled button 1`] = `"<button aria-disabled=\\"true\\" type=\\"button\\" class=\\"\\">Something</button>"`;
|
|
140
18
|
|
|
141
|
-
exports[`dropdown items hover a 1`] = `
|
|
142
|
-
<div>
|
|
143
|
-
<li
|
|
144
|
-
role="none"
|
|
145
|
-
>
|
|
146
|
-
<a
|
|
147
|
-
class=""
|
|
148
|
-
>
|
|
149
|
-
Something
|
|
150
|
-
</a>
|
|
151
|
-
</li>
|
|
152
|
-
</div>
|
|
153
|
-
`;
|
|
19
|
+
exports[`InternalDropdownItem dropdown items hover a 1`] = `"<a class=\\"\\">Something</a>"`;
|
|
154
20
|
|
|
155
|
-
exports[`dropdown items hover button 1`] = `
|
|
156
|
-
<div>
|
|
157
|
-
<li
|
|
158
|
-
role="none"
|
|
159
|
-
>
|
|
160
|
-
<button
|
|
161
|
-
class=""
|
|
162
|
-
type="button"
|
|
163
|
-
>
|
|
164
|
-
Something
|
|
165
|
-
</button>
|
|
166
|
-
</li>
|
|
167
|
-
</div>
|
|
168
|
-
`;
|
|
169
|
-
|
|
170
|
-
exports[`dropdown items separator 1`] = `
|
|
171
|
-
<ContextConsumer>
|
|
172
|
-
<Component />
|
|
173
|
-
</ContextConsumer>
|
|
174
|
-
`;
|
|
21
|
+
exports[`InternalDropdownItem dropdown items hover button 1`] = `"<button type=\\"button\\" class=\\"\\">Something</button>"`;
|
|
@@ -1,21 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import * as
|
|
5
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render } from '@testing-library/react';
|
|
4
|
+
import * as ReactCoreUtils from '@patternfly/react-core/src/helpers/util';
|
|
5
|
+
|
|
6
6
|
import { NavList } from '../../NavList';
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import { NavContext } from '../../Nav';
|
|
8
|
+
|
|
9
|
+
describe('NavList', () => {
|
|
10
|
+
beforeAll(() => {
|
|
11
|
+
jest.spyOn(ReactCoreUtils, 'isElementInView').mockReturnValue(true);
|
|
12
|
+
});
|
|
9
13
|
|
|
10
|
-
it('
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
it('should match snapshot', () => {
|
|
15
|
+
const view = render(
|
|
16
|
+
<NavContext.Provider
|
|
17
|
+
value={{
|
|
18
|
+
onSelect: jest.fn(),
|
|
19
|
+
onToggle: jest.fn(),
|
|
20
|
+
updateIsScrollable: jest.fn(),
|
|
21
|
+
isHorizontal: false,
|
|
22
|
+
flyoutRef: undefined,
|
|
23
|
+
setFlyoutRef: jest.fn()
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
<NavList children={<>ReactNode</>} className="" ariaLeftScroll="Scroll left" ariaRightScroll="Scroll right" />
|
|
27
|
+
</NavContext.Provider>
|
|
28
|
+
);
|
|
29
|
+
expect(view.container).toMatchSnapshot();
|
|
30
|
+
});
|
|
21
31
|
});
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`NavList should match snapshot
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
|
|
3
|
+
exports[`NavList should match snapshot 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<ul
|
|
6
|
+
class="pf-c-nav__list"
|
|
7
|
+
>
|
|
8
|
+
ReactNode
|
|
9
|
+
</ul>
|
|
10
|
+
</div>
|
|
7
11
|
`;
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { shallow } from 'enzyme';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render } from '@testing-library/react';
|
|
4
|
+
|
|
6
5
|
import { OptionsMenuItem } from '../../OptionsMenuItem';
|
|
7
|
-
|
|
8
|
-
import {} from '../..';
|
|
6
|
+
import { DropdownArrowContext } from '../../../Dropdown';
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
describe('OptionsMenuItem', () => {
|
|
9
|
+
it('should match snapshot', () => {
|
|
10
|
+
const view = render(
|
|
11
|
+
<DropdownArrowContext.Provider value={{ sendRef: jest.fn(), keyHandler: undefined }}>
|
|
12
|
+
<OptionsMenuItem
|
|
13
|
+
children={<>ReactNode</>}
|
|
14
|
+
className={'string'}
|
|
15
|
+
isSelected={false}
|
|
16
|
+
isDisabled={true}
|
|
17
|
+
onSelect={() => null as any}
|
|
18
|
+
id={"''"}
|
|
19
|
+
/>{' '}
|
|
20
|
+
</DropdownArrowContext.Provider>
|
|
21
|
+
);
|
|
22
|
+
expect(view.container).toMatchSnapshot();
|
|
23
|
+
});
|
|
22
24
|
});
|
package/src/components/OptionsMenu/__tests__/Generated/__snapshots__/OptionsMenuItem.test.tsx.snap
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`OptionsMenuItem should match snapshot
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
exports[`OptionsMenuItem should match snapshot 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<li
|
|
6
|
+
id="''"
|
|
7
|
+
role="menuitem"
|
|
8
|
+
>
|
|
9
|
+
<button
|
|
10
|
+
aria-disabled="true"
|
|
11
|
+
class="string"
|
|
12
|
+
data-ouia-component-id="OUIA-Generated-DropdownItem-1"
|
|
13
|
+
data-ouia-component-type="PF4/DropdownItem"
|
|
14
|
+
data-ouia-safe="true"
|
|
15
|
+
tabindex="-1"
|
|
16
|
+
type="button"
|
|
17
|
+
>
|
|
18
|
+
ReactNode
|
|
19
|
+
</button>
|
|
20
|
+
</li>
|
|
21
|
+
|
|
22
|
+
</div>
|
|
14
23
|
`;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { shallow } from 'enzyme';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render } from '@testing-library/react';
|
|
4
|
+
|
|
6
5
|
import { OverflowMenuDropdownItem } from '../../OverflowMenuDropdownItem';
|
|
7
|
-
|
|
8
|
-
import {} from '../..';
|
|
6
|
+
import { DropdownArrowContext } from '../../../Dropdown';
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
describe('OverflowMenuDropdownItem', () => {
|
|
9
|
+
it('should match snapshot', () => {
|
|
10
|
+
const view = render(
|
|
11
|
+
<DropdownArrowContext.Provider value={{ sendRef: jest.fn(), keyHandler: undefined }}>
|
|
12
|
+
<OverflowMenuDropdownItem children={'any'} isShared={false} />
|
|
13
|
+
</DropdownArrowContext.Provider>
|
|
14
|
+
);
|
|
15
|
+
expect(view.container).toMatchSnapshot();
|
|
16
|
+
});
|
|
13
17
|
});
|
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`OverflowMenuDropdownItem should match snapshot
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
|
|
3
|
+
exports[`OverflowMenuDropdownItem should match snapshot 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<li
|
|
6
|
+
role="menuitem"
|
|
7
|
+
>
|
|
8
|
+
<button
|
|
9
|
+
aria-disabled="false"
|
|
10
|
+
class=""
|
|
11
|
+
data-ouia-component-id="OUIA-Generated-DropdownItem-1"
|
|
12
|
+
data-ouia-component-type="PF4/DropdownItem"
|
|
13
|
+
data-ouia-safe="true"
|
|
14
|
+
tabindex="-1"
|
|
15
|
+
type="button"
|
|
16
|
+
>
|
|
17
|
+
any
|
|
18
|
+
</button>
|
|
19
|
+
</li>
|
|
20
|
+
</div>
|
|
7
21
|
`;
|
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { shallow } from 'enzyme';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render } from '@testing-library/react';
|
|
4
|
+
|
|
6
5
|
import { SelectGroup } from '../../SelectGroup';
|
|
7
|
-
|
|
8
|
-
import {} from '../..';
|
|
6
|
+
import { SelectContext } from '../..';
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
describe('SelectGroup', () => {
|
|
9
|
+
it('should match snapshot', () => {
|
|
10
|
+
const view = render(
|
|
11
|
+
<SelectContext.Provider
|
|
12
|
+
value={{
|
|
13
|
+
onSelect: jest.fn(),
|
|
14
|
+
onClose: jest.fn(),
|
|
15
|
+
onFavorite: jest.fn(),
|
|
16
|
+
variant: 'default',
|
|
17
|
+
inputIdPrefix: 'something'
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
<SelectGroup children={[]} className="" label="" titleId="" />
|
|
21
|
+
</SelectContext.Provider>
|
|
22
|
+
);
|
|
23
|
+
expect(view.container).toMatchSnapshot();
|
|
24
|
+
});
|
|
13
25
|
});
|
|
@@ -1,29 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { shallow } from 'enzyme';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { render } from '@testing-library/react';
|
|
4
|
+
|
|
6
5
|
import { SelectMenu } from '../../SelectMenu';
|
|
7
|
-
|
|
8
|
-
import {} from '../..';
|
|
6
|
+
import { SelectContext } from '../..';
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
);
|
|
28
|
-
expect(view).toMatchSnapshot();
|
|
8
|
+
describe('SelectMenu', () => {
|
|
9
|
+
it('should match snapshot', () => {
|
|
10
|
+
const view = render(
|
|
11
|
+
<SelectContext.Provider
|
|
12
|
+
value={{
|
|
13
|
+
onSelect: jest.fn(),
|
|
14
|
+
onClose: jest.fn(),
|
|
15
|
+
onFavorite: jest.fn(),
|
|
16
|
+
variant: 'default',
|
|
17
|
+
inputIdPrefix: 'something'
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
<SelectMenu />
|
|
21
|
+
</SelectContext.Provider>
|
|
22
|
+
);
|
|
23
|
+
expect(view.container).toMatchSnapshot();
|
|
24
|
+
});
|
|
29
25
|
});
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`SelectGroup should match snapshot
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
|
|
3
|
+
exports[`SelectGroup should match snapshot 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="pf-c-select__menu-group"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
aria-hidden="true"
|
|
10
|
+
class="pf-c-select__menu-group-title"
|
|
11
|
+
id=""
|
|
12
|
+
/>
|
|
13
|
+
<ul
|
|
14
|
+
role="listbox"
|
|
15
|
+
/>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
7
18
|
`;
|
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`SelectMenu should match snapshot
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
isCustomContent={false}
|
|
11
|
-
isExpanded={false}
|
|
12
|
-
isGrouped={false}
|
|
13
|
-
isLastOptionBeforeFooter={[Function]}
|
|
14
|
-
keyHandler={[Function]}
|
|
15
|
-
maxHeight=""
|
|
16
|
-
noResultsFoundText="string"
|
|
17
|
-
openedOnEnter={false}
|
|
18
|
-
position="left"
|
|
19
|
-
selected=""
|
|
20
|
-
sendRef={[Function]}
|
|
21
|
-
/>
|
|
3
|
+
exports[`SelectMenu should match snapshot 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<ul
|
|
6
|
+
class="pf-c-select__menu"
|
|
7
|
+
role="listbox"
|
|
8
|
+
/>
|
|
9
|
+
</div>
|
|
22
10
|
`;
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
|
|
3
5
|
import { SelectGroup } from '../SelectGroup';
|
|
6
|
+
import { SelectProvider } from '../selectConstants';
|
|
4
7
|
|
|
5
|
-
describe('
|
|
8
|
+
describe('SelectGroup', () => {
|
|
6
9
|
test('renders with children successfully', () => {
|
|
7
|
-
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
render(
|
|
11
|
+
<SelectProvider
|
|
12
|
+
value={{ onSelect: () => {}, onFavorite: () => {}, onClose: () => {}, variant: 'single', inputIdPrefix: '' }}
|
|
13
|
+
>
|
|
14
|
+
<SelectGroup label="test" data-testid="test-id">
|
|
15
|
+
<div>child</div>
|
|
16
|
+
</SelectGroup>
|
|
17
|
+
</SelectProvider>
|
|
11
18
|
);
|
|
12
|
-
expect(
|
|
19
|
+
expect(screen.getByTestId('test-id').outerHTML).toMatchSnapshot();
|
|
13
20
|
});
|
|
14
21
|
});
|