chore: update to paragon 17.0.0

- Drop our custom breakpoints (identical to paragon's)
- Drop our custom useWindowSize (and adapt to paragon's version
  not providing a size initially at component mount)
- Drop our dependency on react-responsive
- Drop our dependency on react-break
This commit is contained in:
Michael Terry
2022-02-18 13:55:19 -05:00
committed by Michael Terry
parent c25ec8f1ae
commit cc8ee33dcd
21 changed files with 138 additions and 257 deletions

View File

@@ -1,16 +1,14 @@
import React from 'react';
import { Factory } from 'rosie';
import { sendTrackEvent } from '@edx/frontend-platform/analytics';
import { breakpoints } from '@edx/paragon';
import {
loadUnit, render, screen, fireEvent, waitFor, initializeTestStore,
} from '../../../setupTest';
import Sequence from './Sequence';
import { fetchSequenceFailure } from '../../data/slice';
import useWindowSize from '../../../generic/tabs/useWindowSize';
jest.mock('@edx/frontend-platform/analytics');
jest.mock('../../../generic/tabs/useWindowSize');
useWindowSize.mockReturnValue({ width: 1200 });
describe('Sequence', () => {
let mockData;
@@ -36,6 +34,10 @@ describe('Sequence', () => {
};
});
beforeEach(() => {
global.innerWidth = breakpoints.extraLarge.minWidth;
});
it('renders correctly without data', async () => {
const testStore = await initializeTestStore({ excludeFetchCourse: true, excludeFetchSequence: true }, false);
render(<Sequence {...mockData} {...{ unitId: undefined, sequenceId: undefined }} />, { store: testStore });
@@ -406,7 +408,7 @@ describe('Sequence', () => {
});
it('does not render notification tray in sequence by default if in responsive view', async () => {
useWindowSize.mockReturnValue({ width: 991 });
global.innerWidth = breakpoints.medium.maxWidth;
const { container } = render(<Sequence {...mockData} />);
// unable to test the absence of 'Notifications' by finding it by text, using the class of the tray instead:
expect(container).not.toHaveClass('notification-tray-container');