merge: watch-wording shortFingerprint review-comment fixes

This commit is contained in:
Katia Bulatova
2026-08-10 19:10:03 +00:00
2 changed files with 16 additions and 2 deletions
@@ -463,7 +463,7 @@ export function watchConditionWording(spec: WatchSpec): WatchConditionWording {
label: "If it happens again",
clause: "in case it happens again",
tooltip: "Get notified if this error happens again",
note: `ping me if error ${spec.fingerprint} happens again`,
note: `ping me if error ${shortFingerprint(spec.fingerprint)} happens again`,
};
case "health_recovery":
return {
@@ -23,7 +23,7 @@ import {
type WatchKind,
type WatchSpec,
} from "./watch.js";
import { watchResolvedBlockBody } from "./watch-wording.js";
import { watchConditionWording, watchResolvedBlockBody } from "./watch-wording.js";
const common = { maxHours: 6, note: "because I asked" };
@@ -611,3 +611,17 @@ describe("watchResolvedBlockBody", () => {
).toBe("impossible");
});
});
describe("watchConditionWording", () => {
it("shortens the fingerprint in the error-recurrence note", () => {
const note = watchConditionWording({
...common,
kind: "error_recurrence",
fingerprint: "error_c4b4",
checkEveryMinutes: 15,
}).note;
expect(note).not.toContain("error error_");
expect(note).toBe("ping me if error c4b4 happens again");
});
});