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:
committed by
Michael Terry
parent
c25ec8f1ae
commit
cc8ee33dcd
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user