@@ -6,12 +6,31 @@ describe("QA config-restart scenario catalog", () => {
66 it ( "waits for the restart wake before using restored capabilities" , ( ) => {
77 const flow = JSON . stringify ( readQaScenarioById ( "config-restart-capability-flip" ) ) ;
88 const restartPatchIndex = flow . indexOf ( '"note":{"ref":"wakeMarker"}' ) ;
9+ const restartOwnedPathIndex = flow . indexOf ( '"gateway.terminal.enabled"' ) ;
910 const wakeWaitIndex = flow . indexOf ( "candidate.text.includes(wakeMarker)" ) ;
1011 const capabilityPollIndex = flow . indexOf ( '"saveAs":"afterTools"' ) ;
1112
1213 expect ( restartPatchIndex ) . toBeGreaterThanOrEqual ( 0 ) ;
14+ expect ( restartOwnedPathIndex ) . toBeGreaterThanOrEqual ( 0 ) ;
15+ expect ( restartOwnedPathIndex ) . toBeLessThan ( wakeWaitIndex ) ;
1316 expect ( wakeWaitIndex ) . toBeGreaterThan ( restartPatchIndex ) ;
1417 expect ( capabilityPollIndex ) . toBeGreaterThan ( wakeWaitIndex ) ;
1518 expect ( flow . indexOf ( '"call":"runAgentPrompt"' ) ) . toBeGreaterThan ( capabilityPollIndex ) ;
1619 } ) ;
20+
21+ it ( "restores the complete terminal subtree, including its absence" , ( ) => {
22+ const flow = JSON . stringify ( readQaScenarioById ( "config-restart-capability-flip" ) ) ;
23+
24+ expect ( flow ) . toContain (
25+ '"expr":"original.config.gateway && Object.prototype.hasOwnProperty.call(original.config.gateway, \'terminal\') ? structuredClone(original.config.gateway.terminal) : undefined"' ,
26+ ) ;
27+ expect ( flow ) . toContain ( '"expr":"originalTerminal?.enabled === false ? true : false"' ) ;
28+ expect ( flow ) . toContain (
29+ '"expr":"originalTerminal !== undefined && Object.prototype.hasOwnProperty.call(originalTerminal, \'enabled\')"' ,
30+ ) ;
31+ expect ( flow ) . toContain (
32+ '"terminal":{"expr":"originalTerminal === undefined ? null : (originalTerminalEnabledPresent ? originalTerminal : { ...originalTerminal, enabled: null })"}' ,
33+ ) ;
34+ expect ( flow . match ( / " g a t e w a y \. t e r m i n a l \. e n a b l e d " / g) ) . toHaveLength ( 1 ) ;
35+ } ) ;
1736} ) ;
0 commit comments