projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
18881: Fixes the "non-status" indication on objects that aren't processes.
[arvados-workbench2.git]
/
src
/
components
/
breadcrumbs
/
breadcrumbs.test.tsx
diff --git
a/src/components/breadcrumbs/breadcrumbs.test.tsx
b/src/components/breadcrumbs/breadcrumbs.test.tsx
index 77beb49478783c6ea308d27072ad7b20da342684..fe3d2ab09983151d06cd2bfee697f2caa42667d6 100644
(file)
--- a/
src/components/breadcrumbs/breadcrumbs.test.tsx
+++ b/
src/components/breadcrumbs/breadcrumbs.test.tsx
@@
-2,11
+2,11
@@
//
// SPDX-License-Identifier: AGPL-3.0
//
// SPDX-License-Identifier: AGPL-3.0
-import
* as
React from "react";
-import {
mount, configure
} from "enzyme";
+import React from "react";
+import {
configure, shallow
} from "enzyme";
-import
* as
Adapter from "enzyme-adapter-react-16";
-import
Breadcrumbs
from "./breadcrumbs";
+import Adapter from "enzyme-adapter-react-16";
+import
{ Breadcrumbs }
from "./breadcrumbs";
import { Button } from "@material-ui/core";
import ChevronRightIcon from '@material-ui/icons/ChevronRight';
import { Button } from "@material-ui/core";
import ChevronRightIcon from '@material-ui/icons/ChevronRight';
@@
-22,32
+22,31
@@
describe("<Breadcrumbs />", () => {
it("renders one item", () => {
const items = [
it("renders one item", () => {
const items = [
- {
label: 'breadcrumb 1'
}
+ {
label: 'breadcrumb 1'
}
];
];
- const breadcrumbs =
mount(<Breadcrumbs items={items} onClick={onClick} />
);
+ const breadcrumbs =
shallow(<Breadcrumbs items={items} onClick={onClick} onContextMenu={jest.fn()} />).dive(
);
expect(breadcrumbs.find(Button)).toHaveLength(1);
expect(breadcrumbs.find(ChevronRightIcon)).toHaveLength(0);
});
expect(breadcrumbs.find(Button)).toHaveLength(1);
expect(breadcrumbs.find(ChevronRightIcon)).toHaveLength(0);
});
-
+
it("renders multiple items", () => {
const items = [
it("renders multiple items", () => {
const items = [
- {
label: 'breadcrumb 1'
},
- {
label: 'breadcrumb 2'
}
+ {
label: 'breadcrumb 1'
},
+ {
label: 'breadcrumb 2'
}
];
];
- const breadcrumbs =
mount(<Breadcrumbs items={items} onClick={onClick} />
);
+ const breadcrumbs =
shallow(<Breadcrumbs items={items} onClick={onClick} onContextMenu={jest.fn()} />).dive(
);
expect(breadcrumbs.find(Button)).toHaveLength(2);
expect(breadcrumbs.find(ChevronRightIcon)).toHaveLength(1);
});
expect(breadcrumbs.find(Button)).toHaveLength(2);
expect(breadcrumbs.find(ChevronRightIcon)).toHaveLength(1);
});
-
+
it("calls onClick with clicked item", () => {
const items = [
it("calls onClick with clicked item", () => {
const items = [
- {
label: 'breadcrumb 1'
},
- {
label: 'breadcrumb 2'
}
+ {
label: 'breadcrumb 1'
},
+ {
label: 'breadcrumb 2'
}
];
];
- const breadcrumbs =
mount(<Breadcrumbs items={items} onClick={onClick} />
);
+ const breadcrumbs =
shallow(<Breadcrumbs items={items} onClick={onClick} onContextMenu={jest.fn()} />).dive(
);
breadcrumbs.find(Button).at(1).simulate('click');
expect(onClick).toBeCalledWith(items[1]);
});
breadcrumbs.find(Button).at(1).simulate('click');
expect(onClick).toBeCalledWith(items[1]);
});
-
-});
\ No newline at end of file
+});