projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add hover styles to sorting arrow
[arvados-workbench2.git]
/
src
/
components
/
context-menu
/
context-menu.test.tsx
diff --git
a/src/components/context-menu/context-menu.test.tsx
b/src/components/context-menu/context-menu.test.tsx
index e4e2397da280ae7ddfa20d9a7a6ed816c5c83c80..faf05f1ff32984d3b663ce5eaa296e0fdd28a306 100644
(file)
--- a/
src/components/context-menu/context-menu.test.tsx
+++ b/
src/components/context-menu/context-menu.test.tsx
@@
-3,33
+3,35
@@
// SPDX-License-Identifier: AGPL-3.0
import * as React from "react";
// SPDX-License-Identifier: AGPL-3.0
import * as React from "react";
-import { mount, configure
, shallow
} from "enzyme";
+import { mount, configure } from "enzyme";
import * as Adapter from "enzyme-adapter-react-16";
import * as Adapter from "enzyme-adapter-react-16";
-import
ContextMenu
from "./context-menu";
+import
{ ContextMenu }
from "./context-menu";
import { ListItem } from "@material-ui/core";
import { ListItem } from "@material-ui/core";
+import { ShareIcon } from "../icon/icon";
configure({ adapter: new Adapter() });
describe("<ContextMenu />", () => {
configure({ adapter: new Adapter() });
describe("<ContextMenu />", () => {
- const
action
s = [[{
- icon:
""
,
+ const
item
s = [[{
+ icon:
ShareIcon
,
name: "Action 1.1"
}, {
name: "Action 1.1"
}, {
- icon:
""
,
+ icon:
ShareIcon
,
name: "Action 1.2"
},], [{
name: "Action 1.2"
},], [{
- icon:
""
,
+ icon:
ShareIcon
,
name: "Action 2.1"
}]];
name: "Action 2.1"
}]];
- it("calls on
Action
Click with clicked action", () => {
- const on
Action
Click = jest.fn();
+ it("calls on
Item
Click with clicked action", () => {
+ const on
Item
Click = jest.fn();
const contextMenu = mount(<ContextMenu
anchorEl={document.createElement("div")}
const contextMenu = mount(<ContextMenu
anchorEl={document.createElement("div")}
+ open={true}
onClose={jest.fn()}
onClose={jest.fn()}
- on
ActionClick={onAction
Click}
-
actions={action
s} />);
+ on
ItemClick={onItem
Click}
+
items={item
s} />);
contextMenu.find(ListItem).at(2).simulate("click");
contextMenu.find(ListItem).at(2).simulate("click");
- expect(on
ActionClick).toHaveBeenCalledWith(action
s[1][0]);
+ expect(on
ItemClick).toHaveBeenCalledWith(item
s[1][0]);
});
});
-});
\ No newline at end of file
+});