Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: machine status in the header lp#2044399 (#5221) 3.4 backport #5222

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { MachineHeaderViews } from "app/machines/constants";
import { actions as machineActions } from "app/store/machine";
import type { RootState } from "app/store/root/types";
import { PowerState } from "app/store/types/enum";
import { NodeActions } from "app/store/types/node";
import { NodeActions, NodeStatus } from "app/store/types/node";
import {
generalState as generalStateFactory,
machine as machineFactory,
Expand Down Expand Up @@ -127,6 +127,21 @@ describe("MachineHeader", () => {
expect(screen.getByText(/power on/i)).toBeInTheDocument();
});

it("displays machine status", () => {
state.machine.items[0].status = NodeStatus.DEPLOYED;

renderWithBrowserRouter(
<MachineHeader
setSidePanelContent={jest.fn()}
sidePanelContent={null}
systemId="abc123"
/>,
{ state, route: "/machine/abc123" }
);

expect(screen.getByText(/deployed/i)).toBeInTheDocument();
});

it("displays power status when checking power", () => {
state.machine.statuses["abc123"] = machineStatusFactory({
checkingPower: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const MachineHeader = ({
subtitle={
editingName ? null : (
<div className="u-flex--wrap u-flex--align-center">
<div className="u-nudge-left">
<div className="u-nudge-left u-nudge-right">
{machine.locked ? (
<TooltipButton
aria-label="locked"
Expand All @@ -115,6 +115,7 @@ const MachineHeader = ({
position="btm-left"
/>
) : null}
{machine.status}
</div>
<div>
<PowerIcon
Expand Down
Loading