@@ -229,6 +229,40 @@ public void RequiresSetup_PreservesNodeModePrecedence_WhenRegistryHasExternalGat
229229 Assert . True ( StartupSetupState . RequiresSetup ( settings , temp . Path , registry ) ) ;
230230 }
231231
232+ [ Fact ]
233+ public void RequiresSetup_ReturnsFalse_WhenNodeModeHasActiveBootstrapGateway ( )
234+ {
235+ using var temp = TempSettings . Create ( ) ;
236+ var settings = new SettingsManager ( temp . Path ) { EnableNodeMode = true } ;
237+ var registry = new GatewayRegistry ( temp . Path ) ;
238+ registry . AddOrUpdate ( new GatewayRecord
239+ {
240+ Id = "bootstrap-gateway" ,
241+ Url = "wss://remote.example.com" ,
242+ BootstrapToken = "bootstrap-token"
243+ } ) ;
244+ registry . SetActive ( "bootstrap-gateway" ) ;
245+
246+ Assert . False ( StartupSetupState . RequiresSetup ( settings , temp . Path , registry ) ) ;
247+ Assert . False ( StartupSetupState . CanStartNodeGateway ( settings , temp . Path ) ) ;
248+ }
249+
250+ [ Fact ]
251+ public void RequiresSetup_ReturnsTrue_WhenNodeModeHasInactiveBootstrapGateway ( )
252+ {
253+ using var temp = TempSettings . Create ( ) ;
254+ var settings = new SettingsManager ( temp . Path ) { EnableNodeMode = true } ;
255+ var registry = new GatewayRegistry ( temp . Path ) ;
256+ registry . AddOrUpdate ( new GatewayRecord
257+ {
258+ Id = "inactive-bootstrap-gateway" ,
259+ Url = "wss://remote.example.com" ,
260+ BootstrapToken = "bootstrap-token"
261+ } ) ;
262+
263+ Assert . True ( StartupSetupState . RequiresSetup ( settings , temp . Path , registry ) ) ;
264+ }
265+
232266 [ Fact ]
233267 public async Task ClassifyAsync_ReturnsAppOwnedLocalWsl_WhenDistroAndLocalRegistryEvidenceExist ( )
234268 {
0 commit comments