diff --git a/__tests__/src/components/CompanionArea.test.js b/__tests__/src/components/CompanionArea.test.js index 92414cc4d738acc76842516abd61c8509b9b8a4e..6e390ad13632ff646f0ee7c8c7996cc170aaaba3 100644 --- a/__tests__/src/components/CompanionArea.test.js +++ b/__tests__/src/components/CompanionArea.test.js @@ -1,6 +1,8 @@ import React from 'react'; import { shallow } from 'enzyme'; import Slide from '@material-ui/core/Slide'; +import ArrowLeftIcon from '@material-ui/icons/ArrowLeftSharp'; +import ArrowRightIcon from '@material-ui/icons/ArrowRightSharp'; import MiradorMenuButton from '../../../src/containers/MiradorMenuButton'; import { CompanionArea } from '../../../src/components/CompanionArea'; import CompanionWindowFactory from '../../../src/containers/CompanionWindowFactory'; @@ -69,7 +71,7 @@ describe('CompanionArea', () => { }); expect(wrapper.find(MiradorMenuButton).length).toBe(1); - expect(wrapper.find(MiradorMenuButton).first().children('ArrowRightSharpIcon').length).toBe(1); + expect(wrapper.find(MiradorMenuButton).first().children(ArrowRightIcon).length).toBe(1); expect(wrapper.find(Slide).prop('direction')).toBe('right'); expect(wrapper.find(MiradorMenuButton).prop('aria-expanded')).toBe(false); expect(wrapper.find('div.mirador-companion-windows').length).toBe(1); @@ -91,7 +93,7 @@ describe('CompanionArea', () => { }); expect(wrapper.find(MiradorMenuButton).length).toBe(1); - expect(wrapper.find(MiradorMenuButton).first().children('ArrowLeftSharpIcon').length).toBe(1); + expect(wrapper.find(MiradorMenuButton).first().children(ArrowLeftIcon).length).toBe(1); expect(wrapper.find(MiradorMenuButton).prop('aria-expanded')).toBe(true); expect(wrapper.find('div.mirador-companion-windows').length).toBe(1); diff --git a/__tests__/src/components/FullScreenButton.test.js b/__tests__/src/components/FullScreenButton.test.js index cdd961c03880bf52e3e64b7c960996d18dff7604..48701a823ad8859c11f73a1b14ee6bcfcc6c8d28 100644 --- a/__tests__/src/components/FullScreenButton.test.js +++ b/__tests__/src/components/FullScreenButton.test.js @@ -1,5 +1,7 @@ import React from 'react'; import { shallow } from 'enzyme'; +import FullscreenIcon from '@material-ui/icons/FullscreenSharp'; +import FullscreenExitIcon from '@material-ui/icons/FullscreenExitSharp'; import MiradorMenuButton from '../../../src/containers/MiradorMenuButton'; import { FullScreenButton } from '../../../src/components/FullScreenButton'; @@ -36,7 +38,7 @@ describe('FullScreenButton', () => { }); it('has the FullscreenIcon', () => { - expect(menuButton.children('FullscreenSharpIcon').length).toBe(1); + expect(menuButton.children(FullscreenIcon).length).toBe(1); }); it('has the proper aria-label i18n key', () => { @@ -58,7 +60,7 @@ describe('FullScreenButton', () => { }); it('has the FullscreenExitIcon', () => { - expect(menuButton.children('FullscreenExitSharpIcon').length).toBe(1); + expect(menuButton.children(FullscreenExitIcon).length).toBe(1); }); it('has the proper aria-label', () => { diff --git a/__tests__/src/components/LanguageSettings.test.js b/__tests__/src/components/LanguageSettings.test.js index 88909f66fd5d400235e4b8120e44e2e10fc6bb08..ff1731013b2dbeb8deebaabcdfd88f22081b016b 100644 --- a/__tests__/src/components/LanguageSettings.test.js +++ b/__tests__/src/components/LanguageSettings.test.js @@ -2,6 +2,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import ListItemText from '@material-ui/core/ListItemText'; import MenuItem from '@material-ui/core/MenuItem'; +import CheckIcon from '@material-ui/icons/CheckSharp'; import { LanguageSettings } from '../../../src/components/LanguageSettings'; /** @@ -63,7 +64,7 @@ describe('LanguageSettings', () => { wrapper .find(MenuItem) .first() - .find('CheckSharpIcon') + .find(CheckIcon) .length, ).toBe(1); }); diff --git a/__tests__/src/components/NestedMenu.test.js b/__tests__/src/components/NestedMenu.test.js index a2ce2bcd0f32e3d6cc65b453bdb014733f53af71..f6c49ba3cccc8b3865a1aefef80d8e5b953effa9 100644 --- a/__tests__/src/components/NestedMenu.test.js +++ b/__tests__/src/components/NestedMenu.test.js @@ -2,6 +2,8 @@ import React from 'react'; import { shallow } from 'enzyme'; import ListItemIcon from '@material-ui/core/ListItemIcon'; import ListItemText from '@material-ui/core/ListItemText'; +import ExpandLessIcon from '@material-ui/icons/ExpandLessSharp'; +import ExpandMoreIcon from '@material-ui/icons/ExpandMoreSharp'; import MenuItem from '@material-ui/core/MenuItem'; import { NestedMenu } from '../../../src/components/NestedMenu'; @@ -61,11 +63,11 @@ describe('NestedMenu', () => { wrapper = createWrapper(); expect(wrapper.state().nestedMenuIsOpen).toBe(false); - expect(wrapper.find('ExpandMoreSharpIcon').length).toBe(1); - expect(wrapper.find('ExpandLessSharpIcon').length).toBe(0); + expect(wrapper.find(ExpandMoreIcon).length).toBe(1); + expect(wrapper.find(ExpandLessIcon).length).toBe(0); wrapper.setState({ nestedMenuIsOpen: true }); - expect(wrapper.find('ExpandMoreSharpIcon').length).toBe(0); - expect(wrapper.find('ExpandLessSharpIcon').length).toBe(1); + expect(wrapper.find(ExpandMoreIcon).length).toBe(0); + expect(wrapper.find(ExpandLessIcon).length).toBe(1); }); it("renders the component's children based on the nestedMenuIsOpen state", () => { diff --git a/__tests__/src/components/SearchPanelControls.test.js b/__tests__/src/components/SearchPanelControls.test.js index a4c14ee48511f3e46707134ebb6786fbb50687af..d09f641230cbb66e5cc7dcec22eaa22c2e3710db 100644 --- a/__tests__/src/components/SearchPanelControls.test.js +++ b/__tests__/src/components/SearchPanelControls.test.js @@ -4,6 +4,7 @@ import Autocomplete from '@material-ui/lab/Autocomplete'; import CircularProgress from '@material-ui/core/CircularProgress'; import Input from '@material-ui/core/Input'; import TextField from '@material-ui/core/TextField'; +import SearchIcon from '@material-ui/icons/SearchSharp'; import { SearchPanelControls } from '../../../src/components/SearchPanelControls'; /** @@ -56,7 +57,7 @@ describe('SearchPanelControls', () => { .dive() .dive(); expect(divedInput.find(CircularProgress).length).toEqual(0); - expect(divedInput.find('SearchSharpIcon').length).toEqual(1); + expect(divedInput.find(SearchIcon).length).toEqual(1); expect(divedInput.find('Connect(WithPlugins(MiradorMenuButton))[type="submit"]').length).toEqual(1); }); diff --git a/__tests__/src/components/ViewerNavigation.test.js b/__tests__/src/components/ViewerNavigation.test.js index 3ffe5b2657b6f6c4504fa8f0c55d7863c8b9b3f5..36ffe068bdeae5cc577e68b58754d195717de906 100644 --- a/__tests__/src/components/ViewerNavigation.test.js +++ b/__tests__/src/components/ViewerNavigation.test.js @@ -1,5 +1,6 @@ import React from 'react'; import { shallow } from 'enzyme'; +import NavigationIcon from '@material-ui/icons/PlayCircleOutlineSharp'; import MiradorMenuButton from '../../../src/containers/MiradorMenuButton'; import { ViewerNavigation } from '../../../src/components/ViewerNavigation'; @@ -89,8 +90,8 @@ describe('ViewerNavigation', () => { }); it('changes the arrow styles', () => { - const previous = wrapper.find(MiradorMenuButton).first().children('PlayCircleOutlineSharpIcon').props(); - const next = wrapper.find(MiradorMenuButton).last().children('PlayCircleOutlineSharpIcon').props(); + const previous = wrapper.find(MiradorMenuButton).first().children(NavigationIcon).props(); + const next = wrapper.find(MiradorMenuButton).last().children(NavigationIcon).props(); expect(previous.style).toEqual({}); expect(next.style).toEqual({ transform: 'rotate(180deg)' }); }); @@ -112,8 +113,8 @@ describe('ViewerNavigation', () => { }); it('changes the arrow styles', () => { - const previous = wrapper.find(MiradorMenuButton).first().children('PlayCircleOutlineSharpIcon').props(); - const next = wrapper.find(MiradorMenuButton).last().children('PlayCircleOutlineSharpIcon').props(); + const previous = wrapper.find(MiradorMenuButton).first().children(NavigationIcon).props(); + const next = wrapper.find(MiradorMenuButton).last().children(NavigationIcon).props(); expect(previous.style).toEqual({ transform: 'rotate(270deg)' }); expect(next.style).toEqual({ transform: 'rotate(90deg)' }); }); @@ -131,8 +132,8 @@ describe('ViewerNavigation', () => { }); it('changes the arrow styles', () => { - const previous = wrapper.find(MiradorMenuButton).first().children('PlayCircleOutlineSharpIcon').props(); - const next = wrapper.find(MiradorMenuButton).last().children('PlayCircleOutlineSharpIcon').props(); + const previous = wrapper.find(MiradorMenuButton).first().children(NavigationIcon).props(); + const next = wrapper.find(MiradorMenuButton).last().children(NavigationIcon).props(); expect(previous.style).toEqual({ transform: 'rotate(90deg)' }); expect(next.style).toEqual({ transform: 'rotate(270deg)' }); }); diff --git a/package.json b/package.json index c972860becc8875a7f7a59db474dac90a9e900a4..79c79108a42e6a4bd39b6e9064a4138b4ace11eb 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "repository": "https://github.com/ProjectMirador/mirador", "dependencies": { "@material-ui/core": "^4.11.0", - "@material-ui/icons": "~4.9.1", + "@material-ui/icons": "^4.9.1", "@material-ui/lab": "^4.0.0-alpha.53", "@researchgate/react-intersection-observer": "^1.0.0", "classnames": "^2.2.6", @@ -97,7 +97,7 @@ "codecov": "^3.7.0", "core-js": "^3.4.8", "enzyme": "^3.10.0", - "enzyme-adapter-react-16": "^1.14.0", + "enzyme-adapter-react-16": "^1.15.0", "eslint": "^6.0.0", "eslint-config-airbnb": "^18.2.0", "eslint-config-react-app": "^3.0.5",