Skip to content

Commit 0167d7f

Browse files
committed
Add missing test for PF4 multiple checkbox
1 parent 95a447b commit 0167d7f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
SwitchField,
1212
} from '../form-fields/form-fields';
1313
import { mount, shallow } from 'enzyme';
14-
import { Radio } from '@patternfly/react-core';
14+
import { Radio, Checkbox } from '@patternfly/react-core';
1515

1616
describe('FormFields', () => {
1717
let FieldProvider;
@@ -101,6 +101,18 @@ describe('FormFields', () => {
101101
expect(toJson(wrapper)).toMatchSnapshot();
102102
});
103103

104+
it('Multiple checkbox - should call on change correctly', () => {
105+
const wrapper = mount(
106+
<CheckboxField { ...propsWithOptions } FieldProvider={ FieldProvider } />
107+
);
108+
109+
expect(onChangeSpy).not.toHaveBeenCalled();
110+
111+
wrapper.find(Checkbox).first().props().onChange();
112+
113+
expect(onChangeSpy).toHaveBeenCalled();
114+
});
115+
104116
it('should render TextArea correctly', () => {
105117
const wrapper = mount(
106118
<TextAreaField { ...props } />

0 commit comments

Comments
 (0)