merge: watch-wording shortFingerprint review-comment fixes
This commit is contained in:
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user