Merge branch 'master' of https://github.com/openedx/frontend-app-learner-dashboard into mashal-m/replace-edx/paragon-frontend-build

This commit is contained in:
Bilal Qamar
2024-02-15 14:51:25 +05:00
110 changed files with 1044 additions and 1232 deletions

View File

@@ -1,4 +1,4 @@
import { shallow } from 'enzyme';
import { shallow } from '@edx/react-unit-test-utils';
import { FilterKeys } from 'data/constants/app';
import ActiveCourseFilters from './ActiveCourseFilters';
@@ -15,7 +15,7 @@ describe('ActiveCourseFilters', () => {
describe('snapshot', () => {
test('renders', () => {
const wrapper = shallow(<ActiveCourseFilters {...props} />);
expect(wrapper).toMatchSnapshot();
expect(wrapper.snapshot).toMatchSnapshot();
});
});
});

View File

@@ -1,4 +1,4 @@
import { shallow } from 'enzyme';
import { shallow } from '@edx/react-unit-test-utils';
import { breakpoints, useWindowSize } from '@openedx/paragon';
@@ -44,21 +44,21 @@ describe('CourseFilterControls', () => {
reduxHooks.useHasCourses.mockReturnValueOnce(false);
useWindowSize.mockReturnValueOnce({ width: breakpoints.small.minWidth });
const wrapper = shallow(<CourseFilterControls {...props} />);
expect(wrapper).toMatchSnapshot();
expect(wrapper.snapshot).toMatchSnapshot();
});
});
describe('mobile', () => {
test('snapshot', () => {
useWindowSize.mockReturnValueOnce({ width: breakpoints.small.minWidth - 1 });
const wrapper = shallow(<CourseFilterControls {...props} />);
expect(wrapper).toMatchSnapshot();
expect(wrapper.snapshot).toMatchSnapshot();
});
});
describe('is not mobile', () => {
test('snapshot', () => {
useWindowSize.mockReturnValueOnce({ width: breakpoints.small.minWidth });
const wrapper = shallow(<CourseFilterControls {...props} />);
expect(wrapper).toMatchSnapshot();
expect(wrapper.snapshot).toMatchSnapshot();
});
});
});

View File

@@ -1,4 +1,4 @@
import { shallow } from 'enzyme';
import { shallow } from '@edx/react-unit-test-utils';
import { FilterKeys } from 'data/constants/app';
import Checkbox from './Checkbox';
@@ -8,7 +8,7 @@ describe('Checkbox', () => {
Object.keys(FilterKeys).forEach((filterKey) => {
it(`renders ${filterKey}`, () => {
const wrapper = shallow(<Checkbox filterKey={filterKey} />);
expect(wrapper).toMatchSnapshot();
expect(wrapper.snapshot).toMatchSnapshot();
});
});
});

View File

@@ -1,4 +1,4 @@
import { shallow } from 'enzyme';
import { shallow } from '@edx/react-unit-test-utils';
import { FilterKeys } from 'data/constants/app';
import FilterForm, { filterOrder } from './FilterForm';
@@ -13,7 +13,7 @@ describe('FilterForm', () => {
describe('snapshot', () => {
test('renders', () => {
const wrapper = shallow(<FilterForm {...props} />);
expect(wrapper).toMatchSnapshot();
expect(wrapper.snapshot).toMatchSnapshot();
});
});

View File

@@ -1,4 +1,4 @@
import { shallow } from 'enzyme';
import { shallow } from '@edx/react-unit-test-utils';
import { SortKeys } from 'data/constants/app';
import SortForm from './SortForm';
@@ -13,7 +13,7 @@ describe('SortForm', () => {
describe('snapshot', () => {
test('renders', () => {
const wrapper = shallow(<SortForm {...props} />);
expect(wrapper).toMatchSnapshot();
expect(wrapper.snapshot).toMatchSnapshot();
});
});
});