diff options
| author | historia <[not public]> | 2026-09-29 14:23:52 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-29 14:23:52 -0400 |
| commit | 004dcd3826856870b267a55dacf84aa7742b7e3f (patch) | |
| tree | 3789558833d8486153271e818e7579e86721855e /internal/casino/table_ux_test.go | |
| parent | 3db3071c444abb2133e1fcaf7e685095415c1adf (diff) | |
| download | thehouseoficarus-004dcd3826856870b267a55dacf84aa7742b7e3f.tar.gz | |
fix: detailed casino output by default, compact output overrides card size
Diffstat (limited to 'internal/casino/table_ux_test.go')
| -rw-r--r-- | internal/casino/table_ux_test.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/internal/casino/table_ux_test.go b/internal/casino/table_ux_test.go index 7f93951..812bed0 100644 --- a/internal/casino/table_ux_test.go +++ b/internal/casino/table_ux_test.go @@ -161,6 +161,38 @@ func TestSplitAndInsuranceRoundNetIncludesEveryStake(t *testing.T) { } } +func TestSingleHandSettlementKeepsSummaryQuiet(t *testing.T) { + // A connected player with one hand and no insurance already saw the net in + // the per-hand result; the next bet menu carries the balance. + table := uxBlackjack() + table.dealer.cards = []card{{rank: "10", suit: "spades"}, {rank: "7", suit: "hearts"}} + events := table.settle() + if hasMessage(events, "Round complete") { + t.Fatalf("single-hand settlement repeated the net: %+v", events) + } + for _, e := range events { + if e.ShowBalance { + t.Fatalf("balance attached to a settlement whose next menu carries it: %+v", e) + } + } +} + +func TestDepartingSettlementCarriesBalanceSummary(t *testing.T) { + table := uxBlackjack() + table.dealer.cards = []card{{rank: "10", suit: "spades"}, {rank: "7", suit: "hearts"}} + table.players.get("alice").LeaveAfter = true + events := table.settle() + found := false + for _, e := range events { + if strings.Contains(e.Message, "Round complete") && e.ShowBalance { + found = true + } + } + if !found { + t.Fatalf("departing player lost the balance summary: %+v", events) + } +} + func TestRebetMenusAndMidRoundJoin(t *testing.T) { table := uxBlackjack() events := table.join("bob") |
