@@ -101,17 +101,35 @@ describe("DesktopUpdates", () => {
101101
102102 const deb = yield * linuxState ( "deb\n" ) ;
103103 assert . equal ( deb . status , "idle" ) ;
104- assert . equal ( deb . message , null ) ;
105104
106105 const unmarked = yield * linuxState ( undefined ) ;
107106 assert . equal ( unmarked . status , "disabled" ) ;
108- assert . equal (
109- unmarked . message ,
110- "Automatic updates on Linux require the AppImage or the .deb package." ,
111- ) ;
112107 } ) ,
113108 ) ;
114109
110+ it . effect ( "keeps the disabled reason available after configuration and channel changes" , ( ) => {
111+ const harness = makeHarness ( { env : { T3CODE_DISABLE_AUTO_UPDATE : "true" } } ) ;
112+ const reason = "Automatic updates are disabled by the T3CODE_DISABLE_AUTO_UPDATE setting." ;
113+
114+ return Effect . scoped (
115+ Effect . gen ( function * ( ) {
116+ const updates = yield * DesktopUpdates . DesktopUpdates ;
117+ yield * updates . configure ;
118+
119+ const configured = yield * updates . getState ;
120+ assert . equal ( configured . message , reason ) ;
121+
122+ const changed = yield * updates . setChannel ( "nightly" ) ;
123+ assert . equal ( changed . channel , "nightly" ) ;
124+ assert . equal ( changed . enabled , false ) ;
125+ assert . equal ( changed . status , "disabled" ) ;
126+ assert . equal ( changed . message , reason ) ;
127+ assert . equal ( harness . sentStates . at ( - 1 ) ?. message , reason ) ;
128+ assert . equal ( harness . checkCount ( ) , 0 ) ;
129+ } ) ,
130+ ) . pipe ( Effect . provide ( harness . layer ) ) ;
131+ } ) ;
132+
115133 it . effect ( "subscribe delivers the latest state plus subsequent changes" , ( ) => {
116134 const harness = makeHarness ( ) ;
117135
0 commit comments