* move GradesTab and BulkHistoryTab to views and control from container through redux * add data logic for view control and import success toast * add NetworkButton component for download/upload buttons * remove download button from Bulk History view and update heading and help text * add View control button to GradebookHeader if bulk management available * remove FilterMenuToggle from SearchControls * update BulkManagementControls to now include upload/download grades buttons * add Import Success toast * rename UserLabel to FilteredUsersLabel for clarity * add InterventionsReport component * update GradesView top-level component * messageing update (separate messages into per-component files) * style updates * update test plan * clean up css and add docstrings * typo fix * fix typo in bulk management view header
33 lines
994 B
JavaScript
33 lines
994 B
JavaScript
import React from 'react';
|
|
import { shallow } from 'enzyme';
|
|
|
|
import selectors from 'data/selectors';
|
|
import { SpinnerIcon, mapStateToProps } from './SpinnerIcon';
|
|
|
|
jest.mock('@edx/paragon', () => ({
|
|
Icon: () => 'Icon',
|
|
}));
|
|
jest.mock('data/selectors', () => ({
|
|
__esModule: true,
|
|
default: {
|
|
root: { shouldShowSpinner: state => ({ shouldShowSpinner: state }) },
|
|
},
|
|
}));
|
|
|
|
describe('SpinnerIcon', () => {
|
|
describe('component', () => {
|
|
it('snapshot - does not render if show: false', () => {
|
|
expect(shallow(<SpinnerIcon />)).toMatchSnapshot();
|
|
});
|
|
test('snapshot - displays spinner overlay with spinner icon', () => {
|
|
expect(shallow(<SpinnerIcon show />)).toMatchSnapshot();
|
|
});
|
|
});
|
|
describe('mapStateToProps', () => {
|
|
const testState = { a: 'nice', day: 'for', some: 'sun' };
|
|
test('show from root.shouldShowSpinner', () => {
|
|
expect(mapStateToProps(testState).show).toEqual(selectors.root.shouldShowSpinner(testState));
|
|
});
|
|
});
|
|
});
|