fix(top bar): a signed-out ON-AIR press starts sign-in instead of disabling the button
Reported: EDIT on + ON-AIR on, signed out → the button reads "Test Stream" and cannot be pressed. Cause: the primary button bound straight to StartTestCommand, whose CanExecute needs a connection. StartSession already routed signed-out ON-AIR to the sign-in flow; the test path bypassed it. The route is now explicit and pure: RouteFor(kind, connected) → SignIn | Record | Live | Test. The primary command calls SignInAsync for the SignIn route, BeginTestStream for Test, StartSession otherwise — so the label, the action and the sign-in fallback cannot drift apart. Pinned in SessionStartDecisionTests for both live and test, connected and not.
This commit is contained in:
@@ -26,6 +26,14 @@ public class SessionStartDecisionTests
|
||||
Assert.Equal(SessionStartKind.Record, SessionStartDecision.For(true, false, true));
|
||||
Assert.Equal("Start Recording", SessionStartDecision.LabelFor(SessionStartKind.Record));
|
||||
|
||||
// Signed out: an ON-AIR press (live OR test) routes to the sign-in flow, never a dead
|
||||
// button. Recording never needs an account.
|
||||
Assert.Equal(SessionStartDecision.Route.SignIn, SessionStartDecision.RouteFor(SessionStartKind.Live, connected: false));
|
||||
Assert.Equal(SessionStartDecision.Route.SignIn, SessionStartDecision.RouteFor(SessionStartKind.Test, connected: false));
|
||||
Assert.Equal(SessionStartDecision.Route.Live, SessionStartDecision.RouteFor(SessionStartKind.Live, connected: true));
|
||||
Assert.Equal(SessionStartDecision.Route.Test, SessionStartDecision.RouteFor(SessionStartKind.Test, connected: true));
|
||||
Assert.Equal(SessionStartDecision.Route.Record, SessionStartDecision.RouteFor(SessionStartKind.Record, connected: false));
|
||||
|
||||
// Unarmed start records locally (the no-dead-ends rule).
|
||||
Assert.Equal(SessionStartKind.Record, SessionStartDecision.For(false, false, false));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user