@@ -33,24 +33,20 @@ describe("which model narrates a wake", () => {
3333 const plan = planWatchNarration ( DRAINED ) ;
3434 expect ( plan . model ) . toBe ( "none" ) ;
3535 if ( plan . model !== "none" ) throw new Error ( "unreachable" ) ;
36- // Just what to do. The banner above the wake already states the headline and
37- // the user's reason, and a wake says each fact once.
38- expect ( plan . text ) . toBe ( "Nothing to do — I've stopped watching." ) ;
39- expect ( plan . presentation . headline ) . toBe ( "task/send-receipt queue drained" ) ;
36+ // The dashboard's own sentence, the user's reason, then what to do — each once.
37+ // The banner above the wake carries the label and nothing else.
38+ expect ( plan . text . split ( "\n\n" ) ) . toEqual ( [
39+ "task/send-receipt queue drained" ,
40+ "You asked to be told when: tell me when the backlog drains" ,
41+ "Nothing to do — I've stopped watching it." ,
42+ ] ) ;
4043 } ) ;
4144
4245 it ( "needs no model when the answer is that the watched thing is gone" , ( ) => {
4346 const plan = planWatchNarration ( { ...DRAINED , resolution : "condition_impossible" } ) ;
4447 expect ( plan . model ) . toBe ( "none" ) ;
4548 if ( plan . model !== "none" ) throw new Error ( "unreachable" ) ;
46- expect ( plan . presentation . headline ) . toContain ( "no longer exists" ) ;
47- } ) ;
48-
49- it ( "never repeats the headline or the note the banner already states" , ( ) => {
50- const { text } = deterministicWakeNarration ( DRAINED ) ;
51- expect ( text ) . not . toContain ( "queue drained" ) ;
52- expect ( text ) . not . toContain ( "tell me when the backlog drains" ) ;
53- expect ( text ) . not . toContain ( "You asked to be told when" ) ;
49+ expect ( plan . text ) . toContain ( "no longer exists" ) ;
5450 } ) ;
5551
5652 it ( "uses Haiku when the fact has to be turned into what to do" , ( ) => {
@@ -64,10 +60,15 @@ describe("which model narrates a wake", () => {
6460 expect ( planWatchNarration ( { ...DRAINED , startsInvestigation : true } ) . model ) . toBe ( "sonnet" ) ;
6561 } ) ;
6662
67- it ( "never names the watched object again — the banner just named it" , ( ) => {
68- const { text } = deterministicWakeNarration ( DRAINED ) ;
69- expect ( text ) . not . toContain ( "task/send-receipt" ) ;
70- expect ( text ) . not . toContain ( "trigger://" ) ;
63+ it ( "links the watched object once, on the line that acts on it" , ( ) => {
64+ const { text } = deterministicWakeNarration ( {
65+ ...DRAINED ,
66+ subjectLink : "[task/send-receipt](trigger://queue/proj_abc/env_abc/task%2Fsend-receipt)" ,
67+ } ) ;
68+ expect ( text ) . toContain ( "I've stopped watching [task/send-receipt]" ) ;
69+ // The headline already names the queue, so it is not followed by the link too.
70+ expect ( text . split ( "\n\n" ) [ 0 ] ) . toBe ( "task/send-receipt queue drained" ) ;
71+ expect ( text . match ( / t r i g g e r : \/ \/ / g) ) . toHaveLength ( 1 ) ;
7172 } ) ;
7273
7374 it ( "never says fired or expired" , ( ) => {
0 commit comments