Skip to content

Commit

Permalink
refactor: after second review
Browse files Browse the repository at this point in the history
  • Loading branch information
PKulkoRaccoonGang committed May 7, 2024
1 parent bc6f9d7 commit f37ef50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/course-unit/CourseUnit.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,7 @@ describe('<CourseUnit />', () => {

userEvent.click(xblockEditBtn);

const iframePostMsg = getIFramePostMessages('close_edit_modal');
const iframePostMsg = getIFramePostMessages('close_modal');
const editModalIFrame = getByTitle('xblock-edit-modal-iframe');

expect(editModalIFrame).toHaveAttribute('src', `${getConfig().STUDIO_BASE_URL}/xblock/${courseVerticalChildrenMock.children[0].block_id}/actions/edit`);
Expand Down
9 changes: 2 additions & 7 deletions src/course-unit/course-xblock/CourseXBlock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,12 @@ const CourseXBlock = memo(({
useEffect(() => {
const handleMessage = (event) => {
const { method, params } = event.data;

if (method === 'close_edit_modal') {
console.log('method', method);

Check warning on line 89 in src/course-unit/course-xblock/CourseXBlock.jsx

View workflow job for this annotation

GitHub Actions / tests

Unexpected console statement
if (method === 'close_modal') {
toggleLegacyEditModal(false);
dispatch(fetchCourseVerticalChildrenData(blockId));
dispatch(fetchXBlockIFrameHtmlAndResourcesQuery(id));
dispatch(fetchCourseUnitQuery(blockId));
} else if (method === 'close_move_modal') {
toggleLegacyMoveModal(false);
dispatch(fetchCourseVerticalChildrenData(blockId));
dispatch(fetchXBlockIFrameHtmlAndResourcesQuery(id));
dispatch(fetchCourseUnitQuery(blockId));
} else if (method === 'move_xblock') {
toggleLegacyMoveModal(false);
dispatch(updateMovedXBlockParams({
Expand Down

0 comments on commit f37ef50

Please sign in to comment.