@@ -449,3 +449,55 @@ releaseFlowInitialRenderTest = do
449449test_releaseFlowInitialRender :: TestT IO ()
450450test_releaseFlowInitialRender =
451451 tmuxTest True 10 releaseFlowInitialRenderTest
452+
453+ -- | Context proto with packages at the same version and no --version flag.
454+ -- This should default to shared mode in the UI.
455+ sharedDefaultContext :: ReleaseContextProto
456+ sharedDefaultContext =
457+ ReleaseContextProto {
458+ packages = [
459+ (" local1" , ReleasePackage {name = " local1" , version = [0 , 5 , 0 , 0 ], path = [reldir |local1|]}),
460+ (" local2" , ReleasePackage {name = " local2" , version = [0 , 5 , 0 , 0 ], path = [reldir |local2|]})
461+ ],
462+ hackage = [unsafeCentralHackageContextFixed],
463+ hooks = [] ,
464+ commitExtraArgs = [] ,
465+ tagExtraArgs = [] ,
466+ managed = True
467+ }
468+
469+ sharedDefaultConfig :: ReleaseConfig
470+ sharedDefaultConfig =
471+ def {
472+ publish = bothArtifacts,
473+ targets = Just [" local1" , " local2" ],
474+ version = Nothing ,
475+ interactive = True
476+ }
477+
478+ sharedDefaultVersionBox :: Text
479+ sharedDefaultVersionBox =
480+ [exon |┌──────────────────────────────────┐
481+ │██ Choose release versions │
482+ │ │
483+ │● All packages 0.5.0.0 bump b│
484+ │ shared s│
485+ │○ local1 0.5.0.0 quit q│
486+ │○ local2 0.5.0.0 help ?│
487+ └──────────────────────────────────┘
488+ |]
489+
490+ sharedDefaultFlowTest :: TmuxTest M ()
491+ sharedDefaultFlowTest = do
492+ debug <- tmuxLiftM brickDebug
493+ handlers <- tmuxLiftM (handlersFlowTest defaultTestConfig debug)
494+ withAsync (tmuxLiftM (void (release handlers sharedDefaultConfig sharedDefaultContext))) \ _ -> do
495+ runStep debug FlowStep {
496+ label = " version-selection (shared default)" ,
497+ expected = sharedDefaultVersionBox,
498+ keys = [KEnter ]
499+ }
500+
501+ test_releaseFlowSharedDefault :: TestT IO ()
502+ test_releaseFlowSharedDefault =
503+ tmuxTest True 10 sharedDefaultFlowTest
0 commit comments