Skip to content

Commit e681d82

Browse files
committed
fix: remove unused Redux store setup from TinyMceWidget tests
1 parent 31dc621 commit e681d82

1 file changed

Lines changed: 2 additions & 18 deletions

File tree

src/editors/sharedComponents/TinyMceWidget/index.test.jsx

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,12 @@
11
import React from 'react';
22
import { shallow } from '@edx/react-unit-test-utils';
3-
import { Provider } from 'react-redux';
4-
import { configureStore } from '@reduxjs/toolkit';
53
import SourceCodeModal from '../SourceCodeModal';
64
import ImageUploadModal from '../ImageUploadModal';
75
import { imgModalToggle, sourceCodeModalToggle } from './hooks';
86
import { TinyMceWidgetInternal as TinyMceWidget } from '.';
97

108
const staticUrl = '/assets/sOmEaSsET';
119

12-
const mockStore = configureStore({
13-
reducer: {
14-
// Add any required reducers for your tests
15-
test: (state = {}) => state,
16-
},
17-
});
18-
19-
// Helper function to create wrapped component
20-
const shallowWithStore = (component) => shallow(
21-
<Provider store={mockStore}>
22-
{component}
23-
</Provider>,
24-
);
25-
2610
// Per https://github.com/tinymce/tinymce-react/issues/91 React unit testing in JSDOM is not supported by tinymce.
2711
// Consequently, mock the Editor out.
2812
jest.mock('@tinymce/tinymce-react', () => {
@@ -85,12 +69,12 @@ describe('TinyMceWidget', () => {
8569
expect(shallow(<TinyMceWidget {...props} />).snapshot).toMatchSnapshot();
8670
});
8771
test('SourcecodeModal is not rendered', () => {
88-
const wrapper = shallowWithStore(<TinyMceWidget {...props} editorType="problem" />);
72+
const wrapper = shallow(<TinyMceWidget {...props} editorType="problem" />);
8973
expect(wrapper.snapshot).toMatchSnapshot();
9074
expect(wrapper.instance.findByType(SourceCodeModal).length).toBe(0);
9175
});
9276
test('ImageUploadModal is not rendered', () => {
93-
const wrapper = shallowWithStore(<TinyMceWidget {...props} enableImageUpload={false} />);
77+
const wrapper = shallow(<TinyMceWidget {...props} enableImageUpload={false} />);
9478
expect(wrapper.snapshot).toMatchSnapshot();
9579
expect(wrapper.instance.findByType(ImageUploadModal).length).toBe(0);
9680
});

0 commit comments

Comments
 (0)