diff --git a/src/editors/containers/EditorContainer/__snapshots__/index.test.jsx.snap b/src/editors/containers/EditorContainer/__snapshots__/index.test.jsx.snap index 7cff64690..f78e8586b 100644 --- a/src/editors/containers/EditorContainer/__snapshots__/index.test.jsx.snap +++ b/src/editors/containers/EditorContainer/__snapshots__/index.test.jsx.snap @@ -12,7 +12,13 @@ exports[`EditorContainer component render snapshot: initialized. enable save and > @@ -54,7 +60,13 @@ exports[`EditorContainer component render snapshot: not initialized. disable sav > diff --git a/src/editors/containers/EditorContainer/index.jsx b/src/editors/containers/EditorContainer/index.jsx index c3b209bcd..e3427df5b 100644 --- a/src/editors/containers/EditorContainer/index.jsx +++ b/src/editors/containers/EditorContainer/index.jsx @@ -27,7 +27,7 @@ export const EditorContainer = ({ diff --git a/src/editors/containers/EditorContainer/index.test.jsx b/src/editors/containers/EditorContainer/index.test.jsx index beacc55ae..a1a73bf63 100644 --- a/src/editors/containers/EditorContainer/index.test.jsx +++ b/src/editors/containers/EditorContainer/index.test.jsx @@ -1,3 +1,4 @@ +import { IconButton } from '@edx/paragon'; import { shallow } from 'enzyme'; import { useDispatch } from 'react-redux'; @@ -36,16 +37,23 @@ describe('EditorContainer component', () => { beforeEach(() => { el = shallow({testContent}); }); - test('close behavior is linked to modal onClose and footer onCancel', () => { + test('close behavior is linked to modal onClose', () => { const expected = hooks.handleCancelClicked({ onClose: props.onClose }); - expect(el.children().at(2).props().onCancel).toEqual(expected); + expect(el.find(IconButton) + .props().onClick).toEqual(expected); + }); + test('close behavior is linked to footer onCancel', () => { + const expected = hooks.handleCancelClicked({ onClose: props.onClose }); + expect(el.children().at(2) + .props().onCancel).toEqual(expected); }); test('save behavior is linked to footer onSave', () => { const expected = hooks.handleSaveClicked({ getContent: props.getContent, dispatch: useDispatch(), }); - expect(el.children().at(2).props().onSave).toEqual(expected); + expect(el.children().at(2) + .props().onSave).toEqual(expected); }); }); });