fix test
[arvados-workbench2.git] / src / components / dropdown-menu / dropdown-menu.test.tsx
index 19924ad76c70496477329b139f47db1bcc7a5bbe..54957f3772887aa06e2a56772267c1bf309c3b6f 100644 (file)
@@ -9,18 +9,19 @@ import ChevronRightIcon from '@material-ui/icons/ChevronRight';
 
 import * as Adapter from 'enzyme-adapter-react-16';
 import { MenuItem, IconButton, Menu } from "@material-ui/core";
+import IconBase, { IconTypes } from "../icon/icon";
 
 configure({ adapter: new Adapter() });
 
 describe("<DropdownMenu />", () => {
     it("renders menu icon", () => {
-        const dropdownMenu = shallow(<DropdownMenu id="test-menu" icon={ChevronRightIcon} />);
-        expect(dropdownMenu.find(ChevronRightIcon)).toHaveLength(1);
+        const dropdownMenu = shallow(<DropdownMenu id="test-menu" icon={IconTypes.CHEVRON_RIGHT} />);
+        expect(dropdownMenu.find(IconBase)).toHaveLength(1);
     });
 
     it("render menu items", () => {
         const dropdownMenu = shallow(
-            <DropdownMenu id="test-menu" icon={ChevronRightIcon}>
+            <DropdownMenu id="test-menu" icon={IconTypes.CHEVRON_RIGHT}>
                 <MenuItem>Item 1</MenuItem>
                 <MenuItem>Item 2</MenuItem>
             </DropdownMenu>
@@ -29,13 +30,13 @@ describe("<DropdownMenu />", () => {
     });
 
     it("opens on menu icon click", () => {
-        const dropdownMenu = shallow(<DropdownMenu id="test-menu" icon={ChevronRightIcon} />);
+        const dropdownMenu = shallow(<DropdownMenu id="test-menu" icon={IconTypes.CHEVRON_RIGHT} />);
         dropdownMenu.find(IconButton).simulate("click", {currentTarget: {}});
         expect(dropdownMenu.state().anchorEl).toBeDefined();
     });
     
     it("closes on menu click", () => {
-        const dropdownMenu = shallow(<DropdownMenu id="test-menu" icon={ChevronRightIcon} />);
+        const dropdownMenu = shallow(<DropdownMenu id="test-menu" icon={IconTypes.CHEVRON_RIGHT} />);
         dropdownMenu.find(Menu).simulate("click", {currentTarget: {}});
         expect(dropdownMenu.state().anchorEl).toBeUndefined();
     });