X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/9ec2e259bd565aea710cdae34d8cba433b09a749..7400998048d63d93ac6eb63895cd4a9e4d728591:/src/components/dropdown-menu/dropdown-menu.test.tsx?ds=sidebyside

diff --git a/src/components/dropdown-menu/dropdown-menu.test.tsx b/src/components/dropdown-menu/dropdown-menu.test.tsx
index 08f5e0f8..32039939 100644
--- a/src/components/dropdown-menu/dropdown-menu.test.tsx
+++ b/src/components/dropdown-menu/dropdown-menu.test.tsx
@@ -4,23 +4,22 @@
 
 import * as React from "react";
 import { shallow, configure } from "enzyme";
-import DropdownMenu from "./dropdown-menu";
+import { DropdownMenu } from "./dropdown-menu";
 import * as Adapter from 'enzyme-adapter-react-16';
 import { MenuItem, IconButton, Menu } from "@material-ui/core";
 import { PaginationRightArrowIcon } from "../icon/icon";
-import ChevronRight from '@material-ui/icons/ChevronRight';
 
 configure({ adapter: new Adapter() });
 
 describe("<DropdownMenu />", () => {
     it("renders menu icon", () => {
-        const dropdownMenu = shallow(<DropdownMenu id="test-menu" icon={PaginationRightArrowIcon()} />);
-        expect(dropdownMenu.find(ChevronRight)).toHaveLength(1);
+        const dropdownMenu = shallow(<DropdownMenu id="test-menu" icon={<PaginationRightArrowIcon />} />);
+        expect(dropdownMenu.find(PaginationRightArrowIcon)).toHaveLength(1);
     });
 
     it("render menu items", () => {
         const dropdownMenu = shallow(
-            <DropdownMenu id="test-menu" icon={PaginationRightArrowIcon()}>
+            <DropdownMenu id="test-menu" icon={<PaginationRightArrowIcon />}>
                 <MenuItem>Item 1</MenuItem>
                 <MenuItem>Item 2</MenuItem>
             </DropdownMenu>
@@ -29,15 +28,15 @@ describe("<DropdownMenu />", () => {
     });
 
     it("opens on menu icon click", () => {
-        const dropdownMenu = shallow(<DropdownMenu id="test-menu" icon={PaginationRightArrowIcon()} />);
+        const dropdownMenu = shallow(<DropdownMenu id="test-menu" icon={<PaginationRightArrowIcon />} />);
         dropdownMenu.find(IconButton).simulate("click", {currentTarget: {}});
-        expect(dropdownMenu.state().anchorEl).toBeDefined();
+        expect((dropdownMenu.state() as any).anchorEl).toBeDefined();
     });
-    
+
     it("closes on menu click", () => {
-        const dropdownMenu = shallow(<DropdownMenu id="test-menu" icon={PaginationRightArrowIcon()} />);
+        const dropdownMenu = shallow(<DropdownMenu id="test-menu" icon={<PaginationRightArrowIcon />} />);
         dropdownMenu.find(Menu).simulate("click", {currentTarget: {}});
-        expect(dropdownMenu.state().anchorEl).toBeUndefined();
+        expect((dropdownMenu.state() as any).anchorEl).toBeUndefined();
     });
 
-});
\ No newline at end of file
+});
