Archived
test: close selected coverage gaps
This commit is contained in:
@@ -76,6 +76,17 @@ describe("recommendedCommand", () => {
|
||||
expect(result).toEqual({ label: "Restart everything", command: "pi-web restart" });
|
||||
});
|
||||
|
||||
it("recommends restart when the session daemon is stale", () => {
|
||||
const result = recommendedCommand(status({
|
||||
components: {
|
||||
web: component(),
|
||||
sessiond: component({ component: "sessiond", label: "Session daemon", stale: true }),
|
||||
},
|
||||
commands: { restart: "pi-web restart" },
|
||||
}));
|
||||
expect(result).toEqual({ label: "Restart everything", command: "pi-web restart" });
|
||||
});
|
||||
|
||||
it("returns nothing when everything is current and available", () => {
|
||||
expect(recommendedCommand(status({ commands: { restart: "pi-web restart" } }))).toBeUndefined();
|
||||
});
|
||||
@@ -243,6 +254,18 @@ describe("fallbackDockerStatus", () => {
|
||||
expect(fallback?.messages[0]?.id).toBe("docker-status-compatibility");
|
||||
});
|
||||
|
||||
it("creates Docker runtime commands without the development prefix", () => {
|
||||
const fallback = fallbackDockerStatus({ dockerMode: "runtime" });
|
||||
expect(fallback?.components.sessiond.installation).toEqual({ kind: "docker", dockerMode: "runtime" });
|
||||
expect(fallback?.commands).toEqual({
|
||||
update: "pi-web-docker update",
|
||||
restart: "pi-web-docker restart",
|
||||
restartWeb: "pi-web-docker restart-web",
|
||||
restartSessiond: "pi-web-docker restart-sessiond",
|
||||
status: "pi-web-docker status",
|
||||
});
|
||||
});
|
||||
|
||||
it("does not create a fallback without a Docker runtime hint", () => {
|
||||
expect(fallbackDockerStatus({})).toBeUndefined();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user