mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Repair unit tests for main-layout-header
Signed-off-by: Alex Culliere <alozhkin@mirantis.com>
This commit is contained in:
parent
5e2d77d358
commit
26125b1327
@ -25,12 +25,12 @@ describe("<MainLayoutHeader />", () => {
|
||||
expect(container).toBeInstanceOf(HTMLElement);
|
||||
});
|
||||
|
||||
it("renders gear icon", () => {
|
||||
it("renders three dots icon", () => {
|
||||
const { container } = render(<MainLayoutHeader cluster={cluster} />);
|
||||
const icon = container.querySelector(".Icon .icon");
|
||||
|
||||
expect(icon).toBeInstanceOf(HTMLElement);
|
||||
expect(icon).toHaveTextContent("settings");
|
||||
expect(icon).toHaveTextContent("more_vert");
|
||||
});
|
||||
|
||||
it("navigates to cluster settings", () => {
|
||||
@ -38,6 +38,11 @@ describe("<MainLayoutHeader />", () => {
|
||||
const icon = container.querySelector(".Icon");
|
||||
|
||||
fireEvent.click(icon);
|
||||
|
||||
const settingsBtn = document.querySelectorAll("ul.ClusterActionsMenu > li > span")[0];
|
||||
|
||||
expect(settingsBtn.textContent).toBe("Settings");
|
||||
fireEvent.click(settingsBtn);
|
||||
expect(mockBroadcastIpc).toBeCalledWith("renderer:navigate", "/cluster/foo/settings");
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user