From 9bce0a34e3c78ea4968adbaa87fa6f229f4abfc8 Mon Sep 17 00:00:00 2001 From: Kristin Aoki <42981026+KristinAoki@users.noreply.github.com> Date: Wed, 10 Jul 2024 15:58:19 -0400 Subject: [PATCH] fix: remove deprecated feedback link (#493) --- .../__snapshots__/index.test.jsx.snap | 81 ------------------- .../components/EditorFooter/index.jsx | 76 +++++++---------- .../components/EditorFooter/index.test.jsx | 16 +--- 3 files changed, 31 insertions(+), 142 deletions(-) diff --git a/src/editors/containers/EditorContainer/components/EditorFooter/__snapshots__/index.test.jsx.snap b/src/editors/containers/EditorContainer/components/EditorFooter/__snapshots__/index.test.jsx.snap index 9ef9eddf0..dbfca713d 100644 --- a/src/editors/containers/EditorContainer/components/EditorFooter/__snapshots__/index.test.jsx.snap +++ b/src/editors/containers/EditorContainer/components/EditorFooter/__snapshots__/index.test.jsx.snap @@ -8,43 +8,6 @@ exports[`EditorFooter render snapshot: default args (disableSave: false, saveFai className="shadow-sm" > - - - - - - -`; - -exports[`EditorFooter render snapshot: dont show feedback link 1`] = ` -
- - - - - - -
-`; - -exports[`EditorFooter render snapshot: show feedback link 1`] = ` -
- - - - Share Feedback - - + + + +
+); - return ( -
- {saveFailed && ( - - - - )} - - - - { - // TODO: Remove this code when the problem Editor Beta is complete. - blockType === blockTypes.problem - && ( - - Share Feedback - - ) - } - - - - - -
- ); -}; EditorFooter.propTypes = { clearSaveFailed: PropTypes.func.isRequired, disableSave: PropTypes.bool.isRequired, diff --git a/src/editors/containers/EditorContainer/components/EditorFooter/index.test.jsx b/src/editors/containers/EditorContainer/components/EditorFooter/index.test.jsx index aabc48134..97f3f72df 100644 --- a/src/editors/containers/EditorContainer/components/EditorFooter/index.test.jsx +++ b/src/editors/containers/EditorContainer/components/EditorFooter/index.test.jsx @@ -1,7 +1,6 @@ import React from 'react'; import { shallow } from '@edx/react-unit-test-utils'; -import { useSelector } from 'react-redux'; import { formatMessage } from '../../../../../testUtils'; import { EditorFooter } from '.'; @@ -9,10 +8,6 @@ jest.mock('../../hooks', () => ({ nullMethod: jest.fn().mockName('hooks.nullMethod'), })); -jest.mock('react-redux', () => ({ - useSelector: jest.fn(), -})); - describe('EditorFooter', () => { const props = { intl: { formatMessage }, @@ -25,20 +20,13 @@ describe('EditorFooter', () => { test('snapshot: default args (disableSave: false, saveFailed: false)', () => { expect(shallow().snapshot).toMatchSnapshot(); }); + test('snapshot: save disabled. Show button spinner', () => { expect(shallow().snapshot).toMatchSnapshot(); }); + test('snapshot: save failed. Show error message', () => { expect(shallow().snapshot).toMatchSnapshot(); }); - - test('snapshot: show feedback link', () => { - useSelector.mockReturnValueOnce('problem'); - expect(shallow().snapshot).toMatchSnapshot(); - }); - test('snapshot: dont show feedback link', () => { - useSelector.mockReturnValueOnce('not a Problem'); - expect(shallow().snapshot).toMatchSnapshot(); - }); }); });