@patternfly/react-core 4.203.0 → 4.204.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 +27 -0
- package/dist/esm/components/Form/Form.d.ts +3 -1
- package/dist/esm/components/Form/Form.d.ts.map +1 -1
- package/dist/esm/components/Form/Form.js +4 -2
- package/dist/esm/components/Form/Form.js.map +1 -1
- package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatusItem.d.ts +4 -2
- package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatusItem.d.ts.map +1 -1
- package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatusItem.js +2 -2
- package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatusItem.js.map +1 -1
- package/dist/esm/components/Pagination/OptionsToggle.d.ts +10 -6
- package/dist/esm/components/Pagination/OptionsToggle.d.ts.map +1 -1
- package/dist/esm/components/Pagination/OptionsToggle.js +10 -4
- package/dist/esm/components/Pagination/OptionsToggle.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.d.ts +7 -3
- package/dist/esm/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js +5 -4
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts +12 -8
- package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
- package/dist/esm/components/Pagination/PaginationOptionsMenu.js +6 -5
- package/dist/esm/components/Pagination/PaginationOptionsMenu.js.map +1 -1
- package/dist/esm/components/ProgressStepper/ProgressStep.d.ts +3 -5
- package/dist/esm/components/ProgressStepper/ProgressStep.d.ts.map +1 -1
- package/dist/esm/components/ProgressStepper/ProgressStep.js +6 -6
- package/dist/esm/components/ProgressStepper/ProgressStep.js.map +1 -1
- package/dist/esm/components/Switch/Switch.d.ts +7 -5
- package/dist/esm/components/Switch/Switch.d.ts.map +1 -1
- package/dist/esm/components/Switch/Switch.js +3 -1
- package/dist/esm/components/Switch/Switch.js.map +1 -1
- package/dist/js/components/Form/Form.d.ts +3 -1
- package/dist/js/components/Form/Form.d.ts.map +1 -1
- package/dist/js/components/Form/Form.js +4 -2
- package/dist/js/components/Form/Form.js.map +1 -1
- package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatusItem.d.ts +4 -2
- package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatusItem.d.ts.map +1 -1
- package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatusItem.js +2 -2
- package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatusItem.js.map +1 -1
- package/dist/js/components/Pagination/OptionsToggle.d.ts +10 -6
- package/dist/js/components/Pagination/OptionsToggle.d.ts.map +1 -1
- package/dist/js/components/Pagination/OptionsToggle.js +10 -4
- package/dist/js/components/Pagination/OptionsToggle.js.map +1 -1
- package/dist/js/components/Pagination/Pagination.d.ts +7 -3
- package/dist/js/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/js/components/Pagination/Pagination.js +5 -4
- package/dist/js/components/Pagination/Pagination.js.map +1 -1
- package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts +12 -8
- package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
- package/dist/js/components/Pagination/PaginationOptionsMenu.js +6 -5
- package/dist/js/components/Pagination/PaginationOptionsMenu.js.map +1 -1
- package/dist/js/components/ProgressStepper/ProgressStep.d.ts +3 -5
- package/dist/js/components/ProgressStepper/ProgressStep.d.ts.map +1 -1
- package/dist/js/components/ProgressStepper/ProgressStep.js +7 -6
- package/dist/js/components/ProgressStepper/ProgressStep.js.map +1 -1
- package/dist/js/components/Switch/Switch.d.ts +7 -5
- package/dist/js/components/Switch/Switch.d.ts.map +1 -1
- package/dist/js/components/Switch/Switch.js +3 -1
- package/dist/js/components/Switch/Switch.js.map +1 -1
- package/dist/umd/react-core.css +171 -83
- package/dist/umd/react-core.js +41 -24
- package/dist/umd/react-core.min.css +102 -14
- package/dist/umd/react-core.min.js +4 -4
- package/package.json +6 -6
- package/src/components/Form/Form.tsx +11 -2
- package/src/components/MultipleFileUpload/MultipleFileUploadStatusItem.tsx +6 -2
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUpload.test.tsx +8 -8
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadButton.test.tsx +7 -7
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadInfo.test.tsx +5 -5
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadMain.test.tsx +11 -11
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadStatus.test.tsx +11 -9
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadStatusItem.test.tsx +28 -13
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadTitle.test.tsx +11 -11
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadTitleIcon.test.tsx +5 -5
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadTitleText.test.tsx +5 -5
- package/src/components/MultipleFileUpload/__tests__/MultipleFileUploadTitleTextSeparator.test.tsx +7 -5
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUpload.test.tsx.snap +42 -124
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadButton.test.tsx.snap +36 -86
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadInfo.test.tsx.snap +6 -8
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadMain.test.tsx.snap +85 -179
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadStatus.test.tsx.snap +188 -383
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadStatusItem.test.tsx.snap +596 -330
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadTitle.test.tsx.snap +32 -49
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadTitleIcon.test.tsx.snap +9 -11
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadTitleText.test.tsx.snap +6 -8
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadTitleTextSeparator.test.tsx.snap +6 -8
- package/src/components/Pagination/OptionsToggle.tsx +56 -46
- package/src/components/Pagination/Pagination.tsx +12 -5
- package/src/components/Pagination/PaginationOptionsMenu.tsx +20 -12
- package/src/components/Pagination/__tests__/Generated/__snapshots__/OptionsToggle.test.tsx.snap +1 -0
- package/src/components/Pagination/__tests__/Pagination.test.tsx +6 -4
- package/src/components/Pagination/__tests__/__snapshots__/Pagination.test.tsx.snap +223 -0
- package/src/components/Pagination/examples/Pagination.md +11 -1
- package/src/components/ProgressStepper/ProgressStep.tsx +10 -15
- package/src/components/ProgressStepper/__tests__/ProgressStepper.test.tsx +1 -1
- package/src/components/ProgressStepper/examples/ProgressStepper.md +13 -20
- package/src/components/Switch/Switch.tsx +13 -5
- package/src/components/Switch/examples/Switch.md +64 -5
- package/src/components/TimePicker/__tests__/TimePicker.test.tsx +1 -1
- package/src/components/Toolbar/examples/Toolbar.md +7 -39
- package/src/components/Dropdown/__tests__/Generated/InternalDropdownItem.test.tsx +0 -42
- package/src/components/Dropdown/__tests__/Generated/__snapshots__/InternalDropdownItem.test.tsx.snap +0 -10
- package/src/components/Select/__tests__/Generated/SelectGroup.test.tsx +0 -25
- package/src/components/Select/__tests__/Generated/SelectMenu.test.tsx +0 -25
- package/src/components/Select/__tests__/Generated/__snapshots__/SelectGroup.test.tsx.snap +0 -18
- package/src/components/Select/__tests__/Generated/__snapshots__/SelectMenu.test.tsx.snap +0 -10
- package/src/components/Toolbar/__tests__/Generated/ToolbarToggleGroup.test.tsx +0 -27
- package/src/components/Toolbar/__tests__/Generated/__snapshots__/ToolbarToggleGroup.test.tsx.snap +0 -29
|
@@ -7,7 +7,9 @@ ouia: true
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## Examples
|
|
10
|
+
|
|
10
11
|
### Basic
|
|
12
|
+
|
|
11
13
|
```js
|
|
12
14
|
import React from 'react';
|
|
13
15
|
import { Switch } from '@patternfly/react-core';
|
|
@@ -39,6 +41,7 @@ class SimpleSwitch extends React.Component {
|
|
|
39
41
|
```
|
|
40
42
|
|
|
41
43
|
### Reversed Layout
|
|
44
|
+
|
|
42
45
|
```js
|
|
43
46
|
import React from 'react';
|
|
44
47
|
import { Switch } from '@patternfly/react-core';
|
|
@@ -71,6 +74,7 @@ class ReversedSwitch extends React.Component {
|
|
|
71
74
|
```
|
|
72
75
|
|
|
73
76
|
### Without label
|
|
77
|
+
|
|
74
78
|
```js
|
|
75
79
|
import React from 'react';
|
|
76
80
|
import { Switch } from '@patternfly/react-core';
|
|
@@ -95,13 +99,55 @@ class NoLabelSwitch extends React.Component {
|
|
|
95
99
|
}
|
|
96
100
|
```
|
|
97
101
|
|
|
102
|
+
### Checked with label
|
|
103
|
+
|
|
104
|
+
```js
|
|
105
|
+
import React from 'react';
|
|
106
|
+
import { Switch } from '@patternfly/react-core';
|
|
107
|
+
|
|
108
|
+
class CheckedWithLabelSwitch extends React.Component {
|
|
109
|
+
constructor(props) {
|
|
110
|
+
super(props);
|
|
111
|
+
this.state = {
|
|
112
|
+
isChecked: true
|
|
113
|
+
};
|
|
114
|
+
this.handleChange = isChecked => {
|
|
115
|
+
this.setState({ isChecked });
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
render() {
|
|
120
|
+
const { isChecked } = this.state;
|
|
121
|
+
return (
|
|
122
|
+
<Switch
|
|
123
|
+
label="Message when on"
|
|
124
|
+
labelOff="Message when off"
|
|
125
|
+
id="checked-with-label-switch-on"
|
|
126
|
+
aria-label="Message when on"
|
|
127
|
+
isChecked={isChecked}
|
|
128
|
+
hasCheckIcon
|
|
129
|
+
onChange={this.handleChange}
|
|
130
|
+
/>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
98
136
|
### Disabled
|
|
137
|
+
|
|
99
138
|
```js
|
|
100
139
|
import React from 'react';
|
|
101
140
|
import { Switch } from '@patternfly/react-core';
|
|
102
141
|
|
|
103
142
|
<React.Fragment>
|
|
104
|
-
<Switch
|
|
143
|
+
<Switch
|
|
144
|
+
id="disabled-switch-on"
|
|
145
|
+
aria-label="Message when on"
|
|
146
|
+
label="Message when on"
|
|
147
|
+
labelOff="Message when off"
|
|
148
|
+
isChecked
|
|
149
|
+
isDisabled
|
|
150
|
+
/>
|
|
105
151
|
<br />
|
|
106
152
|
<Switch
|
|
107
153
|
id="disabled-switch-off"
|
|
@@ -115,21 +161,34 @@ import { Switch } from '@patternfly/react-core';
|
|
|
115
161
|
<Switch id="disabled-no-label-switch-on" aria-label="Message when on" isChecked isDisabled />
|
|
116
162
|
<br />
|
|
117
163
|
<Switch id="disabled-no-label-switch-off" aria-label="Message when on" isChecked={false} isDisabled />
|
|
118
|
-
</React.Fragment
|
|
164
|
+
</React.Fragment>;
|
|
119
165
|
```
|
|
120
166
|
|
|
121
167
|
### Uncontrolled
|
|
168
|
+
|
|
122
169
|
```js
|
|
123
170
|
import React from 'react';
|
|
124
171
|
import { Switch } from '@patternfly/react-core';
|
|
125
172
|
|
|
126
173
|
<React.Fragment>
|
|
127
|
-
<Switch
|
|
174
|
+
<Switch
|
|
175
|
+
id="uncontrolled-switch-on"
|
|
176
|
+
aria-label="Message when on"
|
|
177
|
+
label="Message when on"
|
|
178
|
+
labelOff="Message when off"
|
|
179
|
+
isChecked
|
|
180
|
+
/>
|
|
128
181
|
<br />
|
|
129
|
-
<Switch
|
|
182
|
+
<Switch
|
|
183
|
+
id="uncontrolled-switch-off"
|
|
184
|
+
aria-label="Message when on"
|
|
185
|
+
label="Message when on"
|
|
186
|
+
labelOff="Message when off"
|
|
187
|
+
isChecked={false}
|
|
188
|
+
/>
|
|
130
189
|
<br />
|
|
131
190
|
<Switch id="uncontrolled-no-label-switch-on" aria-label="Message when on" isChecked />
|
|
132
191
|
<br />
|
|
133
192
|
<Switch id="uncontrolled-no-label-switch-off" aria-label="Message when on" isChecked={false} />
|
|
134
|
-
</React.Fragment
|
|
193
|
+
</React.Fragment>;
|
|
135
194
|
```
|
|
@@ -20,7 +20,7 @@ Toolbar items are individual components that can be placed inside of a toolbar.
|
|
|
20
20
|
```js
|
|
21
21
|
import React from 'react';
|
|
22
22
|
import { Toolbar, ToolbarItem, ToolbarContent } from '@patternfly/react-core';
|
|
23
|
-
import { Button,
|
|
23
|
+
import { Button, SearchInput } from '@patternfly/react-core';
|
|
24
24
|
|
|
25
25
|
class ToolbarItems extends React.Component {
|
|
26
26
|
constructor(props) {
|
|
@@ -133,7 +133,7 @@ class ToolbarSpacers extends React.Component {
|
|
|
133
133
|
|
|
134
134
|
```js
|
|
135
135
|
import React from 'react';
|
|
136
|
-
import { Toolbar, ToolbarItem,
|
|
136
|
+
import { Toolbar, ToolbarItem, ToolbarContent } from '@patternfly/react-core';
|
|
137
137
|
import { Button } from '@patternfly/react-core';
|
|
138
138
|
|
|
139
139
|
class ToolbarWidths extends React.Component {
|
|
@@ -237,16 +237,7 @@ class ToolbarSpacers extends React.Component {
|
|
|
237
237
|
|
|
238
238
|
```js
|
|
239
239
|
import React from 'react';
|
|
240
|
-
import {
|
|
241
|
-
Toolbar,
|
|
242
|
-
ToolbarItem,
|
|
243
|
-
ToolbarContent,
|
|
244
|
-
Button,
|
|
245
|
-
ButtonVariant,
|
|
246
|
-
InputGroup,
|
|
247
|
-
TextInput,
|
|
248
|
-
Checkbox
|
|
249
|
-
} from '@patternfly/react-core';
|
|
240
|
+
import { Toolbar, ToolbarItem, ToolbarContent, SearchInput, Checkbox } from '@patternfly/react-core';
|
|
250
241
|
import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
|
|
251
242
|
|
|
252
243
|
const ToolbarItems = () => {
|
|
@@ -261,12 +252,7 @@ const ToolbarItems = () => {
|
|
|
261
252
|
<Toolbar id="toolbar-spacers" inset={{ default: 'insetNone' }} isSticky={isSticky}>
|
|
262
253
|
<ToolbarContent>
|
|
263
254
|
<ToolbarItem>
|
|
264
|
-
<
|
|
265
|
-
<TextInput name="textInput1" id="textInput1" type="search" aria-label="search input example" />
|
|
266
|
-
<Button variant={ButtonVariant.control} aria-label="search button for search input">
|
|
267
|
-
<SearchIcon />
|
|
268
|
-
</Button>
|
|
269
|
-
</InputGroup>
|
|
255
|
+
<SearchInput aria-label="search input example" />
|
|
270
256
|
</ToolbarItem>
|
|
271
257
|
<ToolbarItem>
|
|
272
258
|
<Checkbox
|
|
@@ -500,15 +486,7 @@ A toggle group can be used when you want to collapse a set of items into an over
|
|
|
500
486
|
```js
|
|
501
487
|
import React from 'react';
|
|
502
488
|
import { Toolbar, ToolbarItem, ToolbarContent, ToolbarToggleGroup, ToolbarGroup } from '@patternfly/react-core';
|
|
503
|
-
import {
|
|
504
|
-
Button,
|
|
505
|
-
ButtonVariant,
|
|
506
|
-
InputGroup,
|
|
507
|
-
Select,
|
|
508
|
-
SelectOption,
|
|
509
|
-
SelectVariant,
|
|
510
|
-
SearchInput
|
|
511
|
-
} from '@patternfly/react-core';
|
|
489
|
+
import { Select, SelectOption, SelectVariant, SearchInput } from '@patternfly/react-core';
|
|
512
490
|
import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
|
|
513
491
|
|
|
514
492
|
class ToolbarComponentMangedToggleGroup extends React.Component {
|
|
@@ -659,18 +637,10 @@ If the consumer would prefer to manage the expanded state of the toggle group fo
|
|
|
659
637
|
```js
|
|
660
638
|
import React from 'react';
|
|
661
639
|
import { Toolbar, ToolbarItem, ToolbarContent, ToolbarToggleGroup, ToolbarGroup } from '@patternfly/react-core';
|
|
662
|
-
import {
|
|
663
|
-
Button,
|
|
664
|
-
ButtonVariant,
|
|
665
|
-
InputGroup,
|
|
666
|
-
Select,
|
|
667
|
-
SelectOption,
|
|
668
|
-
SelectVariant,
|
|
669
|
-
SearchInput
|
|
670
|
-
} from '@patternfly/react-core';
|
|
640
|
+
import { Select, SelectOption, SelectVariant, SearchInput } from '@patternfly/react-core';
|
|
671
641
|
import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
|
|
672
642
|
|
|
673
|
-
class
|
|
643
|
+
class ToolbarConsumerManagedToggleGroup extends React.Component {
|
|
674
644
|
constructor(props) {
|
|
675
645
|
super(props);
|
|
676
646
|
this.state = {
|
|
@@ -835,8 +805,6 @@ import {
|
|
|
835
805
|
} from '@patternfly/react-core';
|
|
836
806
|
import {
|
|
837
807
|
Button,
|
|
838
|
-
ButtonVariant,
|
|
839
|
-
InputGroup,
|
|
840
808
|
Select,
|
|
841
809
|
SelectOption,
|
|
842
810
|
SelectVariant,
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { render } from '@testing-library/react';
|
|
4
|
-
|
|
5
|
-
import { InternalDropdownItem } from '../../InternalDropdownItem';
|
|
6
|
-
import { DropdownContext } from '../../dropdownConstants';
|
|
7
|
-
|
|
8
|
-
describe('InternalDropdownItem', () => {
|
|
9
|
-
it('should match snapshot', () => {
|
|
10
|
-
const view = render(
|
|
11
|
-
<DropdownContext.Provider value={{}}>
|
|
12
|
-
{' '}
|
|
13
|
-
<InternalDropdownItem
|
|
14
|
-
children={<div>ReactNode</div>}
|
|
15
|
-
className={"''"}
|
|
16
|
-
listItemClassName={'string'}
|
|
17
|
-
component={'a'}
|
|
18
|
-
role={"'none'"}
|
|
19
|
-
isDisabled={false}
|
|
20
|
-
isPlainText={false}
|
|
21
|
-
isHovered={false}
|
|
22
|
-
href={'string'}
|
|
23
|
-
tooltip={<div>ReactNode</div>}
|
|
24
|
-
tooltipProps={undefined}
|
|
25
|
-
index={-1}
|
|
26
|
-
context={{
|
|
27
|
-
keyHandler: () => {},
|
|
28
|
-
sendRef: () => {}
|
|
29
|
-
}}
|
|
30
|
-
onClick={(event: React.MouseEvent<any> | React.KeyboardEvent | MouseEvent) => undefined as any}
|
|
31
|
-
id={'string'}
|
|
32
|
-
componentID={'string'}
|
|
33
|
-
additionalChild={<div>ReactNode</div>}
|
|
34
|
-
customChild={<div>ReactNode</div>}
|
|
35
|
-
enterTriggersArrowDown={false}
|
|
36
|
-
icon={<div>ReactNode</div>}
|
|
37
|
-
/>
|
|
38
|
-
</DropdownContext.Provider>
|
|
39
|
-
);
|
|
40
|
-
expect(view.container).toMatchSnapshot();
|
|
41
|
-
});
|
|
42
|
-
});
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { render } from '@testing-library/react';
|
|
4
|
-
|
|
5
|
-
import { SelectGroup } from '../../SelectGroup';
|
|
6
|
-
import { SelectContext } from '../..';
|
|
7
|
-
|
|
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
|
-
});
|
|
25
|
-
});
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { render } from '@testing-library/react';
|
|
4
|
-
|
|
5
|
-
import { SelectMenu } from '../../SelectMenu';
|
|
6
|
-
import { SelectContext } from '../..';
|
|
7
|
-
|
|
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
|
-
});
|
|
25
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
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>
|
|
18
|
-
`;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
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
|
-
});
|
|
27
|
-
});
|
package/src/components/Toolbar/__tests__/Generated/__snapshots__/ToolbarToggleGroup.test.tsx.snap
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
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>
|
|
29
|
-
`;
|