projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
17098: Improves wording on the "Restore version" action.
[arvados-workbench2.git]
/
src
/
components
/
dropdown-menu
/
dropdown-menu.test.tsx
diff --git
a/src/components/dropdown-menu/dropdown-menu.test.tsx
b/src/components/dropdown-menu/dropdown-menu.test.tsx
index 19924ad76c70496477329b139f47db1bcc7a5bbe..32039939031290d018a34855db76d17664f7ec9f 100644
(file)
--- 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 * as React from "react";
import { shallow, configure } from "enzyme";
-import DropdownMenu from "./dropdown-menu";
-import ChevronRightIcon from '@material-ui/icons/ChevronRight';
-
+import { DropdownMenu } from "./dropdown-menu";
import * as Adapter from 'enzyme-adapter-react-16';
import { MenuItem, IconButton, Menu } from "@material-ui/core";
import * as Adapter from 'enzyme-adapter-react-16';
import { MenuItem, IconButton, Menu } from "@material-ui/core";
+import { PaginationRightArrowIcon } from "../icon/icon";
configure({ adapter: new Adapter() });
describe("<DropdownMenu />", () => {
it("renders menu icon", () => {
configure({ adapter: new Adapter() });
describe("<DropdownMenu />", () => {
it("renders menu icon", () => {
- const dropdownMenu = shallow(<DropdownMenu id="test-menu" icon={
ChevronRightIcon
} />);
- expect(dropdownMenu.find(
ChevronRight
Icon)).toHaveLength(1);
+ const dropdownMenu = shallow(<DropdownMenu id="test-menu" icon={
<PaginationRightArrowIcon />
} />);
+ expect(dropdownMenu.find(
PaginationRightArrow
Icon)).toHaveLength(1);
});
it("render menu items", () => {
const dropdownMenu = shallow(
});
it("render menu items", () => {
const dropdownMenu = shallow(
- <DropdownMenu id="test-menu" icon={
ChevronRightIcon
}>
+ <DropdownMenu id="test-menu" icon={
<PaginationRightArrowIcon />
}>
<MenuItem>Item 1</MenuItem>
<MenuItem>Item 2</MenuItem>
</DropdownMenu>
<MenuItem>Item 1</MenuItem>
<MenuItem>Item 2</MenuItem>
</DropdownMenu>
@@
-29,15
+28,15
@@
describe("<DropdownMenu />", () => {
});
it("opens on menu icon click", () => {
});
it("opens on menu icon click", () => {
- const dropdownMenu = shallow(<DropdownMenu id="test-menu" icon={
ChevronRightIcon
} />);
+ const dropdownMenu = shallow(<DropdownMenu id="test-menu" icon={
<PaginationRightArrowIcon />
} />);
dropdownMenu.find(IconButton).simulate("click", {currentTarget: {}});
dropdownMenu.find(IconButton).simulate("click", {currentTarget: {}});
- expect(
dropdownMenu.state(
).anchorEl).toBeDefined();
+ expect(
(dropdownMenu.state() as any
).anchorEl).toBeDefined();
});
});
-
+
it("closes on menu click", () => {
it("closes on menu click", () => {
- const dropdownMenu = shallow(<DropdownMenu id="test-menu" icon={
ChevronRightIcon
} />);
+ const dropdownMenu = shallow(<DropdownMenu id="test-menu" icon={
<PaginationRightArrowIcon />
} />);
dropdownMenu.find(Menu).simulate("click", {currentTarget: {}});
dropdownMenu.find(Menu).simulate("click", {currentTarget: {}});
- expect(
dropdownMenu.state(
).anchorEl).toBeUndefined();
+ expect(
(dropdownMenu.state() as any
).anchorEl).toBeUndefined();
});
});
-});
\ No newline at end of file
+});