Skip to content

Commit 6fdb74f

Browse files
committed
fix: unit test
1 parent bec7e71 commit 6fdb74f

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

plugins/communications-app/CheckBoxForm/index.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ const CheckBoxForm = ({ isChecked, handleChange, label }) => (
99
</Container>
1010
);
1111

12+
CheckBoxForm.defaultProps = {
13+
handleChange: () => {},
14+
};
15+
1216
CheckBoxForm.propTypes = {
1317
isChecked: PropTypes.bool.isRequired,
14-
handleChange: PropTypes.func.isRequired,
18+
handleChange: PropTypes.func,
1519
label: PropTypes.string.isRequired,
1620
};
1721

src/components/bulk-email-tool/bulk-email-form/BulkEmailForm.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ function BulkEmailForm(props) {
277277
as="communications-app-check-box-form"
278278
label="checkbox label - @openedx-plugins/communications-app-check-box-form"
279279
isChecked
280-
handleChange={() => null}
281280
>
282281
<h1>Checkbox -default</h1>
283282
</PluggableComponent>

src/components/bulk-email-tool/bulk-email-form/test/BulkEmailForm.test.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { formatDate } from '../../../../utils/formatDateAndTime';
1414
import cohortFactory from '../data/__factories__/bulkEmailFormCohort.factory';
1515

1616
jest.mock('../../text-editor/TextEditor');
17+
jest.mock('../../../PluggableComponent', () => () => null);
1718

1819
const appendMock = jest.spyOn(FormData.prototype, 'append');
1920
const dispatchMock = jest.fn();

0 commit comments

Comments
 (0)