File tree Expand file tree Collapse file tree
internal-packages/dashboard-agent-contracts/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -463,7 +463,7 @@ export function watchConditionWording(spec: WatchSpec): WatchConditionWording {
463463 label : "If it happens again" ,
464464 clause : "in case it happens again" ,
465465 tooltip : "Get notified if this error happens again" ,
466- note : `ping me if error ${ spec . fingerprint } happens again` ,
466+ note : `ping me if error ${ shortFingerprint ( spec . fingerprint ) } happens again` ,
467467 } ;
468468 case "health_recovery" :
469469 return {
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ import {
2323 type WatchKind ,
2424 type WatchSpec ,
2525} from "./watch.js" ;
26- import { watchResolvedBlockBody } from "./watch-wording.js" ;
26+ import { watchConditionWording , watchResolvedBlockBody } from "./watch-wording.js" ;
2727
2828const common = { maxHours : 6 , note : "because I asked" } ;
2929
@@ -611,3 +611,17 @@ describe("watchResolvedBlockBody", () => {
611611 ) . toBe ( "impossible" ) ;
612612 } ) ;
613613} ) ;
614+
615+ describe ( "watchConditionWording" , ( ) => {
616+ it ( "shortens the fingerprint in the error-recurrence note" , ( ) => {
617+ const note = watchConditionWording ( {
618+ ...common ,
619+ kind : "error_recurrence" ,
620+ fingerprint : "error_c4b4" ,
621+ checkEveryMinutes : 15 ,
622+ } ) . note ;
623+
624+ expect ( note ) . not . toContain ( "error error_" ) ;
625+ expect ( note ) . toBe ( "ping me if error c4b4 happens again" ) ;
626+ } ) ;
627+ } ) ;
You can’t perform that action at this time.
0 commit comments