@@ -185,8 +185,10 @@ describe("TMU top-level surface smoke", () => {
185185 volumePercent : 45 ,
186186 } ;
187187 const writes : string [ ] = [ ] ;
188+ let reads = 0 ;
188189 const control = {
189- probe : async ( ) => snapshot , read : async ( ) => snapshot ,
190+ probe : async ( ) => snapshot ,
191+ read : async ( ) => { reads += 1 ; return snapshot ; } ,
190192 setEnabled : async ( enabled : boolean ) => ( writes . push ( `enabled:${ enabled } ` ) , snapshot = { ...snapshot , enabled } ) ,
191193 setSound : async ( id : string ) => ( writes . push ( `sound:${ id } ` ) , snapshot = { ...snapshot , sound : snapshot . sounds . find ( ( sound ) => sound . id === id ) ! } ) ,
192194 setVolume : async ( volumePercent : number ) => ( writes . push ( `volume:${ volumePercent } ` ) , snapshot = { ...snapshot , volumePercent } ) ,
@@ -205,8 +207,14 @@ describe("TMU top-level surface smoke", () => {
205207 expect ( writes ) . toEqual ( [ "enabled:true" ] ) ;
206208 await terminal . stdin . write ( "\r" ) ;
207209 expect ( terminal . lastFrame ( ) ) . toContain ( "Choose Background Sound" ) ;
210+ expect ( terminal . lastFrame ( ) ) . toContain ( "Missing sounds? macOS Settings download · Esc then u refresh" ) ;
208211 expect ( terminal . lastFrame ( ) ) . toContain ( "Rain" ) ;
209212 expect ( terminal . lastFrame ( ) ) . toContain ( "Ocean" ) ;
213+ await terminal . stdin . write ( "\x1b" ) ;
214+ await terminal . stdin . write ( "u" ) ;
215+ await sleep ( 0 ) ;
216+ expect ( reads ) . toBe ( 1 ) ;
217+ await terminal . stdin . write ( "\r" ) ;
210218 await terminal . stdin . write ( "\x1b[B" ) ;
211219 await terminal . stdin . write ( "\r" ) ;
212220 expect ( writes ) . toEqual ( [ "enabled:true" , "sound:Ocean" ] ) ;
0 commit comments