aboutsummaryrefslogtreecommitdiff
path: root/internal/game/render_roulette_tracker_test.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-01 19:30:38 -0400
committerhistoria <[not public]>2026-10-01 19:30:38 -0400
commit6d9908b29c8187196d23b126b1165c7e0bd0fc76 (patch)
treeddbc02357ed92646b801687b90b1a06c71a15d71 /internal/game/render_roulette_tracker_test.go
parent8a94f21bd47c0a00bc415395232dba22fa958837 (diff)
downloadthehouseoficarus-6d9908b29c8187196d23b126b1165c7e0bd0fc76.tar.gz
fix: casino pai gow sorting, universal unbet, table/rules split, remove solo timers
Diffstat (limited to 'internal/game/render_roulette_tracker_test.go')
-rw-r--r--internal/game/render_roulette_tracker_test.go18
1 files changed, 15 insertions, 3 deletions
diff --git a/internal/game/render_roulette_tracker_test.go b/internal/game/render_roulette_tracker_test.go
index a629b57..b05a2be 100644
--- a/internal/game/render_roulette_tracker_test.go
+++ b/internal/game/render_roulette_tracker_test.go
@@ -105,7 +105,7 @@ func TestRouletteTrackerAboveBettingBoardsOnly(t *testing.T) {
}
}
-func TestRouletteRulesUseLiveHistory(t *testing.T) {
+func TestRouletteTableShowsLiveHistory(t *testing.T) {
g := &Game{Casino: casino.NewManager(7)}
p := player.New("alice")
p.RoomID, p.Credits = 1, 100
@@ -116,8 +116,20 @@ func TestRouletteRulesUseLiveHistory(t *testing.T) {
g.Casino.Bet(1, "r", p.Name, "red", 1, casinoWallet{g: g, p: p, saveCharacter: func(*player.Player) error { return nil }})
g.Casino.Tick()
g.Casino.Tick()
- art := g.renderCasinoRules(sess, cfg)
+ // The table command renders the live status snapshot, which carries the
+ // tracker's completed-spin history.
+ var snap *casino.RouletteSnapshot
+ for _, event := range g.Casino.Table(1, "r").Status(p.Name) {
+ if view, ok := event.Snapshot.(*casino.RouletteSnapshot); ok && view.Phase != "result" {
+ snap = view
+ break
+ }
+ }
+ if snap == nil {
+ t.Fatal("no live roulette snapshot")
+ }
+ art := g.renderCasinoSnapshot(sess, snap)
if !strings.Contains(art, "History: last 1 spin") || strings.Contains(art, "awaiting the first spin") {
- t.Fatalf("rules did not show live history:\n%s", art)
+ t.Fatalf("table did not show live history:\n%s", art)
}
}