feat: migrate enzyme to edx react-unit-test-utils

This commit is contained in:
Syed Ali Abbas Zaidi
2024-01-25 02:51:53 +05:00
committed by GitHub
parent 1bc4e51c22
commit dcdaace08d
108 changed files with 1155 additions and 1046 deletions

View File

@@ -1,5 +1,5 @@
import React from 'react';
import { shallow } from 'enzyme';
import { shallow } from '@edx/react-unit-test-utils';
import { EditorState } from '@codemirror/state';
import { EditorView } from '@codemirror/view';
@@ -171,7 +171,7 @@ describe('CodeEditor', () => {
test('Renders and calls Hooks ', () => {
jest.spyOn(hooks, 'prepareShowBtnEscapeHTML').mockImplementation(() => ({ showBtnEscapeHTML: true, hideBtn: mockHideBtn }));
// Note: ref won't show up as it is not acutaly a DOM attribute.
expect(shallow(<module.CodeEditor {...props} />)).toMatchSnapshot();
expect(shallow(<module.CodeEditor {...props} />).snapshot).toMatchSnapshot();
expect(hooks.createCodeMirrorDomNode).toHaveBeenCalled();
});
});