@patternfly/react-core 4.267.10 → 4.267.12
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 +16 -0
- package/components/FileUpload/FileUpload.d.ts +1 -1
- package/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/components/ProgressStepper/ProgressStep.d.ts +8 -0
- package/components/ProgressStepper/ProgressStep.d.ts.map +1 -1
- package/components/ProgressStepper/ProgressStep.js +9 -0
- package/components/ProgressStepper/ProgressStep.js.map +1 -1
- package/dist/esm/components/FileUpload/FileUpload.d.ts +1 -1
- package/dist/esm/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/esm/components/ProgressStepper/ProgressStep.d.ts +8 -0
- package/dist/esm/components/ProgressStepper/ProgressStep.d.ts.map +1 -1
- package/dist/esm/components/ProgressStepper/ProgressStep.js +9 -0
- package/dist/esm/components/ProgressStepper/ProgressStep.js.map +1 -1
- package/dist/js/components/FileUpload/FileUpload.d.ts +1 -1
- package/dist/js/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/js/components/ProgressStepper/ProgressStep.d.ts +8 -0
- package/dist/js/components/ProgressStepper/ProgressStep.d.ts.map +1 -1
- package/dist/js/components/ProgressStepper/ProgressStep.js +10 -1
- package/dist/js/components/ProgressStepper/ProgressStep.js.map +1 -1
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +2 -2
- package/src/components/FileUpload/FileUpload.tsx +1 -1
- package/src/components/ProgressStepper/ProgressStep.tsx +9 -0
- package/src/components/ProgressStepper/__tests__/ProgressStep.test.tsx +178 -0
- package/src/components/ProgressStepper/__tests__/ProgressStepper.test.tsx +40 -126
- package/src/components/ProgressStepper/__tests__/__snapshots__/ProgressStep.test.tsx.snap +26 -0
- package/src/components/ProgressStepper/__tests__/__snapshots__/ProgressStepper.test.tsx.snap +2 -722
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.267.
|
|
3
|
+
"version": "4.267.12",
|
|
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",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"react": "^16.8 || ^17 || ^18",
|
|
72
72
|
"react-dom": "^16.8 || ^17 || ^18"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "a8d0266963a7cb1b09500077cb5131401e4abca5"
|
|
75
75
|
}
|
|
@@ -81,7 +81,7 @@ export interface FileUploadProps
|
|
|
81
81
|
// Props available in FileUpload but not FileUploadField:
|
|
82
82
|
|
|
83
83
|
/** Optional extra props to customize react-dropzone. */
|
|
84
|
-
dropzoneProps?: DropzoneProps
|
|
84
|
+
dropzoneProps?: Partial<DropzoneProps>;
|
|
85
85
|
/** Clear button was clicked. */
|
|
86
86
|
onClearClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
87
87
|
/** On data changed - if type='text' or type='dataURL' and file was loaded it will call this method */
|
|
@@ -6,6 +6,15 @@ import ResourcesFullIcon from '@patternfly/react-icons/dist/esm/icons/resources-
|
|
|
6
6
|
import ExclamationTriangleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-triangle-icon';
|
|
7
7
|
import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon';
|
|
8
8
|
|
|
9
|
+
export enum ProgressStepVariant {
|
|
10
|
+
default = 'default',
|
|
11
|
+
pending = 'pending',
|
|
12
|
+
success = 'success',
|
|
13
|
+
info = 'info',
|
|
14
|
+
danger = 'danger',
|
|
15
|
+
warning = 'warning'
|
|
16
|
+
}
|
|
17
|
+
|
|
9
18
|
export interface ProgressStepProps
|
|
10
19
|
extends React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement> {
|
|
11
20
|
/** Content rendered inside the progress step. */
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { ProgressStep, ProgressStepVariant } from '../ProgressStep';
|
|
4
|
+
import { capitalize } from '../../../helpers';
|
|
5
|
+
|
|
6
|
+
jest.mock('@patternfly/react-icons/dist/esm/icons/check-circle-icon', () => () => 'Success icon mock');
|
|
7
|
+
jest.mock('@patternfly/react-icons/dist/esm/icons/resources-full-icon', () => () => 'Info icon mock');
|
|
8
|
+
jest.mock('@patternfly/react-icons/dist/esm/icons/exclamation-triangle-icon', () => () => 'Warning icon mock');
|
|
9
|
+
jest.mock('@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon', () => () => 'Danger icon mock');
|
|
10
|
+
|
|
11
|
+
test('Renders without children', () => {
|
|
12
|
+
render(
|
|
13
|
+
<div data-testid="progress-step">
|
|
14
|
+
<ProgressStep />
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
expect(screen.getByTestId('progress-step').firstChild).toBeVisible();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
test('Renders children', () => {
|
|
22
|
+
render(<ProgressStep>Test</ProgressStep>);
|
|
23
|
+
expect(screen.getByText('Test')).toBeVisible();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('Renders with class pf-c-progress-stepper__step on the containing li element', () => {
|
|
27
|
+
render(<ProgressStep>Test</ProgressStep>);
|
|
28
|
+
expect(screen.getByRole('listitem')).toHaveClass('pf-c-progress-stepper__step');
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test('Renders with custom class name on the containing li element when className prop is provided', () => {
|
|
32
|
+
render(<ProgressStep className="custom-class">Test</ProgressStep>);
|
|
33
|
+
expect(screen.getByRole('listitem')).toHaveClass('custom-class');
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
['default', undefined].forEach(variant => {
|
|
37
|
+
test(`Renders with no additional classes when variant=${variant} on containing li element`, () => {
|
|
38
|
+
render(<ProgressStep variant={`${variant as ProgressStepVariant}`}>Test</ProgressStep>);
|
|
39
|
+
expect(screen.getByRole('listitem')).toHaveClass('pf-c-progress-stepper__step', { exact: true });
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
['success', 'info', 'warning', 'danger'].forEach(variant => {
|
|
44
|
+
test(`Does not render with class pf-m-${variant} by default on containing li element`, () => {
|
|
45
|
+
render(<ProgressStep>Test</ProgressStep>);
|
|
46
|
+
expect(screen.getByRole('listitem')).not.toHaveClass(`pf-m-${variant}`);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test(`Renders with class pf-m-${variant} when variant = ${variant} on containing li element`, () => {
|
|
50
|
+
render(<ProgressStep variant={`${variant as ProgressStepVariant}`}>Test</ProgressStep>);
|
|
51
|
+
expect(screen.getByRole('listitem')).toHaveClass(`pf-m-${variant}`);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test(`Does not render with ${variant} variant icon by default`, () => {
|
|
55
|
+
render(<ProgressStep>Test</ProgressStep>);
|
|
56
|
+
expect(screen.queryByText(`${capitalize(variant)} icon mock`)).not.toBeInTheDocument();
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test(`Renders with ${variant} variant icon when variant = ${variant}`, () => {
|
|
60
|
+
render(<ProgressStep variant={`${variant as ProgressStepVariant}`}>Test</ProgressStep>);
|
|
61
|
+
expect(screen.getByText(`${capitalize(variant)} icon mock`)).toBeVisible();
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test('Does not render with class pf-m-pending by default on containing li element', () => {
|
|
66
|
+
render(<ProgressStep>Test</ProgressStep>);
|
|
67
|
+
expect(screen.getByRole('listitem')).not.toHaveClass('pf-m-pending');
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
test('Renders with class pf-m-pending when variant = pending on containing li element', () => {
|
|
71
|
+
render(<ProgressStep variant="pending">Test</ProgressStep>);
|
|
72
|
+
expect(screen.getByRole('listitem')).toHaveClass('pf-m-pending');
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
test('Renders the element passed via the icon prop', () => {
|
|
76
|
+
render(<ProgressStep icon="Custom Icon">Test</ProgressStep>);
|
|
77
|
+
expect(screen.getByText('Custom Icon')).toBeVisible();
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
test('Renders the icon element inside span element with class pf-c-progress-stepper__step-icon', () => {
|
|
81
|
+
render(<ProgressStep icon="Custom Icon">Test</ProgressStep>);
|
|
82
|
+
expect(screen.getByText('Custom Icon')).toHaveClass('pf-c-progress-stepper__step-icon');
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test('Does not render with class pf-m-current by default on containing li element', () => {
|
|
86
|
+
render(<ProgressStep>Test</ProgressStep>);
|
|
87
|
+
expect(screen.getByRole('listitem')).not.toHaveClass('pf-m-current');
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
test('Renders with class pf-m-current on containing li element when isCurrent is passed', () => {
|
|
91
|
+
render(<ProgressStep isCurrent>Test</ProgressStep>);
|
|
92
|
+
expect(screen.getByRole('listitem')).toHaveClass('pf-m-current');
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
test('Renders without aria-current on containing li element by default', () => {
|
|
96
|
+
render(<ProgressStep>Test</ProgressStep>);
|
|
97
|
+
expect(screen.getByRole('listitem')).not.toHaveAttribute('aria-current');
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
test(`Renders with a aria-current of "step" on containing li element when isCurrent is passed`, () => {
|
|
101
|
+
render(<ProgressStep isCurrent>Test</ProgressStep>);
|
|
102
|
+
expect(screen.getByRole('listitem')).toHaveAttribute('aria-current', 'step');
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
test(`Renders with the aria label on containing li element passed via prop`, () => {
|
|
106
|
+
render(<ProgressStep aria-label="Test label">Test</ProgressStep>);
|
|
107
|
+
expect(screen.getByRole('listitem')).toHaveAccessibleName('Test label');
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
test('Renders the element passed via the description prop', () => {
|
|
111
|
+
render(<ProgressStep description={<button>Description</button>}>Test</ProgressStep>);
|
|
112
|
+
expect(screen.getByRole('button', { name: 'Description' })).toBeVisible();
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
test('Renders the description element inside div element with class pf-c-progress-stepper__step-description', () => {
|
|
116
|
+
render(<ProgressStep description="Description">Test</ProgressStep>);
|
|
117
|
+
expect(screen.getByText('Description')).toHaveClass('pf-c-progress-stepper__step-description');
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
test('Renders children inside class pf-c-progress-stepper__step-title', () => {
|
|
121
|
+
render(<ProgressStep>Test</ProgressStep>);
|
|
122
|
+
expect(screen.getByText('Test')).toHaveClass('pf-c-progress-stepper__step-title');
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
test('Renders Component element as div by default', () => {
|
|
126
|
+
render(<ProgressStep>Test</ProgressStep>);
|
|
127
|
+
expect(screen.getByText('Test')).toHaveProperty('nodeName', 'DIV');
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
test('Renders Component element as button when popoverRender is defined', () => {
|
|
131
|
+
render(<ProgressStep popoverRender={() => <div>Popover</div>}>Test</ProgressStep>);
|
|
132
|
+
expect(screen.getByRole('button')).toBeVisible();
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
test('Does not render with class pf-m-help-text by default on Component element', () => {
|
|
136
|
+
render(<ProgressStep>Test</ProgressStep>);
|
|
137
|
+
expect(screen.getByText('Test')).not.toHaveClass('pf-m-help-text');
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
test('Renders with class pf-m-help-text when popoverRender is defined', () => {
|
|
141
|
+
render(<ProgressStep popoverRender={() => <div>Popover</div>}>Test</ProgressStep>);
|
|
142
|
+
expect(screen.getByText('Test')).toHaveClass('pf-m-help-text');
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
test('Does not renders with aria-labelledBy by default on Component element', () => {
|
|
146
|
+
render(<ProgressStep>Test</ProgressStep>);
|
|
147
|
+
expect(screen.getByText('Test')).not.toHaveAccessibleName();
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
test('Renders with an accessible name that matches children', () => {
|
|
151
|
+
render(
|
|
152
|
+
<ProgressStep id="test-id" titleId="title-id">
|
|
153
|
+
Test
|
|
154
|
+
</ProgressStep>
|
|
155
|
+
);
|
|
156
|
+
expect(screen.getByText('Test')).toHaveAccessibleName('Test');
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
test('Renders with popoverRender element', () => {
|
|
160
|
+
render(<ProgressStep popoverRender={() => <div>Popover</div>}>Test</ProgressStep>);
|
|
161
|
+
expect(screen.getByText('Popover')).toBeVisible();
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
test('Renders with inherited element props spread to the component', () => {
|
|
165
|
+
render(
|
|
166
|
+
<>
|
|
167
|
+
<ProgressStep aria-describedby="labelling-id" aria-label="Test label" />
|
|
168
|
+
<p id="labelling-id">Described by text</p>
|
|
169
|
+
</>
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
expect(screen.getByLabelText('Test label')).toHaveAccessibleDescription('Described by text');
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
test('Matches snapshot', () => {
|
|
176
|
+
const { asFragment } = render(<ProgressStep>Test</ProgressStep>);
|
|
177
|
+
expect(asFragment()).toMatchSnapshot();
|
|
178
|
+
});
|
|
@@ -1,143 +1,57 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
|
3
3
|
import { ProgressStepper } from '../ProgressStepper';
|
|
4
|
-
import { ProgressStep } from '../ProgressStep';
|
|
5
|
-
import InProgressIcon from '@patternfly/react-icons/dist/esm/icons/in-progress-icon';
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<ProgressStepper
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</ProgressStepper>
|
|
15
|
-
);
|
|
16
|
-
expect(asFragment()).toMatchSnapshot();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
test('gets custom class and id', () => {
|
|
20
|
-
const { asFragment } = render(
|
|
21
|
-
<ProgressStepper className="custom-class" id="test-id">
|
|
22
|
-
<ProgressStep>First</ProgressStep>
|
|
23
|
-
<ProgressStep>Second</ProgressStep>
|
|
24
|
-
<ProgressStep>Third</ProgressStep>
|
|
25
|
-
</ProgressStepper>
|
|
26
|
-
);
|
|
27
|
-
expect(asFragment()).toMatchSnapshot();
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
test('renders vertically', () => {
|
|
31
|
-
const { asFragment } = render(
|
|
32
|
-
<ProgressStepper isVertical>
|
|
33
|
-
<ProgressStep>First</ProgressStep>
|
|
34
|
-
<ProgressStep>Second</ProgressStep>
|
|
35
|
-
<ProgressStep>Third</ProgressStep>
|
|
36
|
-
</ProgressStepper>
|
|
37
|
-
);
|
|
38
|
-
expect(asFragment()).toMatchSnapshot();
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
test('renders compact', () => {
|
|
42
|
-
const { asFragment } = render(
|
|
43
|
-
<ProgressStepper isCompact>
|
|
44
|
-
<ProgressStep>First</ProgressStep>
|
|
45
|
-
<ProgressStep>Second</ProgressStep>
|
|
46
|
-
<ProgressStep>Third</ProgressStep>
|
|
47
|
-
</ProgressStepper>
|
|
48
|
-
);
|
|
49
|
-
expect(asFragment()).toMatchSnapshot();
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
test('renders center aligned', () => {
|
|
53
|
-
const { asFragment } = render(
|
|
54
|
-
<ProgressStepper isCenterAligned>
|
|
55
|
-
<ProgressStep>First</ProgressStep>
|
|
56
|
-
<ProgressStep>Second</ProgressStep>
|
|
57
|
-
<ProgressStep>Third</ProgressStep>
|
|
58
|
-
</ProgressStepper>
|
|
59
|
-
);
|
|
60
|
-
expect(asFragment()).toMatchSnapshot();
|
|
61
|
-
});
|
|
5
|
+
test('Renders without children', () => {
|
|
6
|
+
render(
|
|
7
|
+
<div data-testid="progress-stepper">
|
|
8
|
+
<ProgressStepper />
|
|
9
|
+
</div>
|
|
10
|
+
);
|
|
11
|
+
expect(screen.getByTestId('progress-stepper').firstChild).toBeVisible();
|
|
62
12
|
});
|
|
63
13
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
Object.values(['default', 'success', 'info', 'pending', 'warning', 'danger']).forEach(variant => {
|
|
71
|
-
test(`renders ${variant} variant`, () => {
|
|
72
|
-
const { asFragment } = render(
|
|
73
|
-
<ProgressStep
|
|
74
|
-
variant={variant as 'default' | 'success' | 'info' | 'pending' | 'warning' | 'danger'}
|
|
75
|
-
aria-label={variant}
|
|
76
|
-
>
|
|
77
|
-
{variant} step
|
|
78
|
-
</ProgressStep>
|
|
79
|
-
);
|
|
80
|
-
expect(asFragment()).toMatchSnapshot();
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
test('renders current', () => {
|
|
85
|
-
const { asFragment } = render(<ProgressStep isCurrent>Title</ProgressStep>);
|
|
86
|
-
expect(asFragment()).toMatchSnapshot();
|
|
87
|
-
});
|
|
14
|
+
test('Renders children', () => {
|
|
15
|
+
render(<ProgressStepper>Test</ProgressStepper>);
|
|
16
|
+
expect(screen.getByRole('list')).toBeVisible();
|
|
17
|
+
});
|
|
88
18
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
19
|
+
test('Renders with only class name pf-c-progress-stepper by default', () => {
|
|
20
|
+
render(<ProgressStepper>Test</ProgressStepper>);
|
|
21
|
+
expect(screen.getByRole('list')).toHaveClass('pf-c-progress-stepper', { exact: true });
|
|
22
|
+
});
|
|
93
23
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
24
|
+
test('Renders with class name pf-c-progress-stepper', () => {
|
|
25
|
+
render(<ProgressStepper>Test</ProgressStepper>);
|
|
26
|
+
expect(screen.getByRole('list')).toHaveClass('pf-c-progress-stepper');
|
|
27
|
+
});
|
|
98
28
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
</ProgressStep>
|
|
104
|
-
);
|
|
105
|
-
expect(asFragment()).toMatchSnapshot();
|
|
106
|
-
});
|
|
29
|
+
test('Renders with custom class name when className prop is provided', () => {
|
|
30
|
+
render(<ProgressStepper className="custom-class">Test</ProgressStepper>);
|
|
31
|
+
expect(screen.getByRole('list')).toHaveClass('custom-class');
|
|
32
|
+
});
|
|
107
33
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
});
|
|
34
|
+
test('Renders with class name pf-m-center when isCenterAligned prop is passed', () => {
|
|
35
|
+
render(<ProgressStepper isCenterAligned>Test</ProgressStepper>);
|
|
36
|
+
expect(screen.getByRole('list')).toHaveClass('pf-m-center');
|
|
112
37
|
});
|
|
113
38
|
|
|
114
|
-
test('
|
|
115
|
-
render(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
>
|
|
119
|
-
Title
|
|
120
|
-
</ProgressStep>
|
|
121
|
-
);
|
|
39
|
+
test('Renders with class name pf-m-vertical when isVertical prop is passed', () => {
|
|
40
|
+
render(<ProgressStepper isVertical>Test</ProgressStepper>);
|
|
41
|
+
expect(screen.getByRole('list')).toHaveClass('pf-m-vertical');
|
|
42
|
+
});
|
|
122
43
|
|
|
123
|
-
|
|
124
|
-
|
|
44
|
+
test('Renders with class name pf-m-compact when isCompact prop is passed', () => {
|
|
45
|
+
render(<ProgressStepper isCompact>Test</ProgressStepper>);
|
|
46
|
+
expect(screen.getByRole('list')).toHaveClass('pf-m-compact');
|
|
125
47
|
});
|
|
126
48
|
|
|
127
|
-
test('
|
|
128
|
-
render(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
<>
|
|
132
|
-
Testing description
|
|
133
|
-
<br />
|
|
134
|
-
Line break
|
|
135
|
-
</>
|
|
136
|
-
}
|
|
137
|
-
>
|
|
138
|
-
Title
|
|
139
|
-
</ProgressStep>
|
|
140
|
-
);
|
|
49
|
+
test('Renders with inherited element props spread to the component', () => {
|
|
50
|
+
render(<ProgressStepper aria-label="Test label">Test</ProgressStepper>);
|
|
51
|
+
expect(screen.getByRole('list')).toHaveAccessibleName('Test label');
|
|
52
|
+
});
|
|
141
53
|
|
|
142
|
-
|
|
54
|
+
test('Matches the snapshot', () => {
|
|
55
|
+
const { asFragment } = render(<ProgressStepper>Test</ProgressStepper>);
|
|
56
|
+
expect(asFragment()).toMatchSnapshot();
|
|
143
57
|
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Matches snapshot 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<li
|
|
6
|
+
class="pf-c-progress-stepper__step"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
class="pf-c-progress-stepper__step-connector"
|
|
10
|
+
>
|
|
11
|
+
<span
|
|
12
|
+
class="pf-c-progress-stepper__step-icon"
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
<div
|
|
16
|
+
class="pf-c-progress-stepper__step-main"
|
|
17
|
+
>
|
|
18
|
+
<div
|
|
19
|
+
class="pf-c-progress-stepper__step-title"
|
|
20
|
+
>
|
|
21
|
+
Test
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</li>
|
|
25
|
+
</DocumentFragment>
|
|
26
|
+
`;
|