ed3cb91cd4
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
23 lines
963 B
TypeScript
23 lines
963 B
TypeScript
// server/services/report.test.ts
|
|
import { describe, it, expect } from "vitest";
|
|
import { buildReportMarkdown } from "./report.js";
|
|
import type { ExecutionResult } from "@shared/types.js";
|
|
|
|
const exec: ExecutionResult = {
|
|
executionId: "exec_1", machineId: "m1", startedAt: "2026-06-04T12:00:00Z",
|
|
finishedAt: "2026-06-04T12:05:00Z", mode: "manual", action: "apt_full_upgrade",
|
|
status: "ok", rebootRequiredAfterRun: true,
|
|
importantLogLines: ["Inst libc6 [2.31-13] (2.31-13+deb11u5 Debian [amd64])"],
|
|
rawLogRef: "reports/m1/exec_1.log", reportRef: "reports/m1/exec_1.md",
|
|
};
|
|
|
|
describe("buildReportMarkdown", () => {
|
|
it("contient l'en-tête, le statut et les lignes importantes", () => {
|
|
const md = buildReportMarkdown(exec, "deb-01");
|
|
expect(md).toContain("# Rapport d'exécution — deb-01");
|
|
expect(md).toContain("apt_full_upgrade");
|
|
expect(md).toContain("Redémarrage requis : oui");
|
|
expect(md).toContain("Inst libc6");
|
|
});
|
|
});
|