Skip to content

Commit 49d9d73

Browse files
committed
Update tests
1 parent e051a92 commit 49d9d73

File tree

21 files changed

+192
-332
lines changed

21 files changed

+192
-332
lines changed

packages/ant-component-mapper/src/tests/components.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ describe('formFields generated tests', () => {
108108
const errorField = {
109109
...field,
110110
validate: [{ type: validatorTypes.REQUIRED, warning: true }],
111+
useWarnings: true,
111112
validateOnMount: true
112113
};
113114
let wrapper;

packages/ant-component-mapper/src/tests/dual-list-select.test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ describe('DualListSelect', () => {
123123
wrapper.find('form').simulate('submit');
124124
});
125125

126-
expect(onSubmit).toHaveBeenCalledWith({
127-
'dual-Menu': []
128-
});
126+
expect(onSubmit).toHaveBeenCalledWith({});
129127
});
130128
});

packages/blueprint-component-mapper/src/tests/components.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ describe('formFields generated tests', () => {
113113
const errorField = {
114114
...field,
115115
validate: [{ type: validatorTypes.REQUIRED, warning: true }],
116+
useWarnings: true,
116117
validateOnMount: true
117118
};
118119
let wrapper;

packages/blueprint-component-mapper/src/tests/dual-list-select.test.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,7 @@ describe('DualListSelect', () => {
254254
wrapper.find('form').simulate('submit');
255255
});
256256

257-
expect(onSubmit).toHaveBeenCalledWith({
258-
'dual-Menu': []
259-
});
257+
expect(onSubmit).toHaveBeenCalledWith({});
260258
});
261259

262260
it('switch all to right', async () => {
@@ -290,9 +288,7 @@ describe('DualListSelect', () => {
290288
wrapper.find('form').simulate('submit');
291289
});
292290

293-
expect(onSubmit).toHaveBeenCalledWith({
294-
'dual-Menu': []
295-
});
291+
expect(onSubmit).toHaveBeenCalledWith({});
296292
});
297293

298294
it('filters options', async () => {

packages/carbon-component-mapper/src/tests/components.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ describe('component tests', () => {
113113
const errorField = {
114114
...field,
115115
validate: [{ type: validatorTypes.REQUIRED, warning: true }],
116+
useWarnings: true,
116117
validateOnMount: true
117118
};
118119
let wrapper;

packages/carbon-component-mapper/src/tests/dual-list-select.test.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,7 @@ describe('DualListSelect', () => {
249249
wrapper.find('form').simulate('submit');
250250
});
251251

252-
expect(onSubmit).toHaveBeenCalledWith({
253-
'dual-StructuredListWrapper': []
254-
});
252+
expect(onSubmit).toHaveBeenCalledWith({});
255253
});
256254

257255
it('switch all to right', async () => {
@@ -285,9 +283,7 @@ describe('DualListSelect', () => {
285283
wrapper.find('form').simulate('submit');
286284
});
287285

288-
expect(onSubmit).toHaveBeenCalledWith({
289-
'dual-StructuredListWrapper': []
290-
});
286+
expect(onSubmit).toHaveBeenCalledWith({});
291287
});
292288

293289
it('filters options', async () => {

packages/mui-component-mapper/src/tests/dual-list-select.test.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,7 @@ describe('DualListSelect', () => {
257257
wrapper.find('form').simulate('submit');
258258
});
259259

260-
expect(onSubmit).toHaveBeenCalledWith({
261-
'dual-list': []
262-
});
260+
expect(onSubmit).toHaveBeenCalledWith({});
263261
});
264262

265263
it('switch all to right', async () => {
@@ -293,9 +291,7 @@ describe('DualListSelect', () => {
293291
wrapper.find('form').simulate('submit');
294292
});
295293

296-
expect(onSubmit).toHaveBeenCalledWith({
297-
'dual-list': []
298-
});
294+
expect(onSubmit).toHaveBeenCalledWith({});
299295
});
300296

301297
it('filters options', async () => {

packages/mui-component-mapper/src/tests/form-fields.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ describe('formFields', () => {
103103
it('renders with warning', async () => {
104104
const errorField = {
105105
...field,
106-
validate: [{ type: validatorTypes.REQUIRED, warning: true }]
106+
validate: [{ type: validatorTypes.REQUIRED, warning: true }],
107+
useWarnings: true
107108
};
108109
let wrapper;
109110

packages/pf4-component-mapper/src/tests/__snapshots__/form-fields.test.js.snap

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
exports[`FormFields should render with onText/OffText Switch correctly 1`] = `
44
<RenderWithProvider>
5-
<Component
5+
<ReactFinalForm
66
onSubmit={[Function]}
77
>
88
<Switch
@@ -23,6 +23,7 @@ exports[`FormFields should render with onText/OffText Switch correctly 1`] = `
2323
"error": undefined,
2424
"initial": undefined,
2525
"invalid": false,
26+
"length": undefined,
2627
"modified": false,
2728
"modifiedSinceLastSubmit": false,
2829
"pristine": true,
@@ -34,7 +35,6 @@ exports[`FormFields should render with onText/OffText Switch correctly 1`] = `
3435
"valid": true,
3536
"validating": false,
3637
"visited": false,
37-
"warning": undefined,
3838
}
3939
}
4040
>
@@ -62,7 +62,6 @@ exports[`FormFields should render with onText/OffText Switch correctly 1`] = `
6262
onChange={[Function]}
6363
onFocus={[Function]}
6464
type="checkbox"
65-
value=""
6665
>
6766
<label
6867
className="pf-c-switch"
@@ -83,7 +82,6 @@ exports[`FormFields should render with onText/OffText Switch correctly 1`] = `
8382
onChange={[Function]}
8483
onFocus={[Function]}
8584
type="checkbox"
86-
value=""
8785
/>
8886
<span
8987
className="pf-c-switch__toggle"
@@ -109,6 +107,6 @@ exports[`FormFields should render with onText/OffText Switch correctly 1`] = `
109107
</FormGroup>
110108
</FormGroup>
111109
</Switch>
112-
</Component>
110+
</ReactFinalForm>
113111
</RenderWithProvider>
114112
`;

packages/pf4-component-mapper/src/tests/dual-list-select.test.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,7 @@ describe('DualListSelect', () => {
178178
wrapper.find('form').simulate('submit');
179179
});
180180

181-
expect(onSubmit).toHaveBeenCalledWith({
182-
'dual-list': []
183-
});
181+
expect(onSubmit).toHaveBeenCalledWith({});
184182
});
185183

186184
it('switch all to right', async () => {
@@ -215,9 +213,7 @@ describe('DualListSelect', () => {
215213
wrapper.find('form').simulate('submit');
216214
});
217215

218-
expect(onSubmit).toHaveBeenCalledWith({
219-
'dual-list': []
220-
});
216+
expect(onSubmit).toHaveBeenCalledWith({});
221217
});
222218

223219
it('filters options', async () => {

0 commit comments

Comments
 (0)