aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/table_ux_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/casino/table_ux_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/casino/table_ux_test.go')
-rw-r--r--internal/casino/table_ux_test.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/internal/casino/table_ux_test.go b/internal/casino/table_ux_test.go
index cb13300..ea8bc04 100644
--- a/internal/casino/table_ux_test.go
+++ b/internal/casino/table_ux_test.go
@@ -57,14 +57,24 @@ func TestBlackjackWarnsOnceThenAutoStands(t *testing.T) {
}
}
}
- if warnings != 1 || !timeout {
- t.Fatalf("multi=%v warnings=%d timeout=%v", multi, warnings, timeout)
+ if multi {
+ if warnings != 1 || !timeout {
+ t.Fatalf("multi warnings=%d timeout=%v", warnings, timeout)
+ }
+ continue
+ }
+ // A lone player has no timer: no warning, no forced stand.
+ if warnings != 0 || timeout || table.phase != blackjackPlaying {
+ t.Fatalf("solo warnings=%d timeout=%v phase=%s", warnings, timeout, table.phase)
}
}
}
func TestInsuranceRequiresExplicitDecisionAndWarns(t *testing.T) {
table := uxBlackjack()
+ // A second seated player keeps the multi-player insurance timer running;
+ // they have already declined so only alice is still deciding.
+ table.players.add("bob", &blackjackPlayer{Participant: Participant{Name: "bob", Connected: true, HasBet: true, Wager: Wager{Total: 10}}, declinedInsurance: true})
table.phase = blackjackInsurance
table.timer.start(8)
before := len(table.players.get("alice").hands[0].cards)