aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/table_ux_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/casino/table_ux_test.go')
-rw-r--r--internal/casino/table_ux_test.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/internal/casino/table_ux_test.go b/internal/casino/table_ux_test.go
index 812bed0..cb13300 100644
--- a/internal/casino/table_ux_test.go
+++ b/internal/casino/table_ux_test.go
@@ -136,7 +136,7 @@ func TestQueuedLeaveAndSitoutPreserveCommittedBlackjackHands(t *testing.T) {
t.Fatalf("%s altered committed hand", action)
}
events := table.action("alice", "stand")
- if !hasMessage(events, "Net -10 credits") {
+ if !hasMessage(events, "{casino_payout}-10 credits{/}") {
t.Fatalf("missing settlement: %+v", events)
}
if action == "leave_after" && table.hasParticipant("alice") {
@@ -154,7 +154,13 @@ func TestSplitAndInsuranceRoundNetIncludesEveryStake(t *testing.T) {
p.hands = []*blackjackHand{{bet: 20, stood: true, cards: []card{{rank: "10"}, {rank: "10"}}}, {bet: 10, bust: true, cards: []card{{rank: "10"}, {rank: "10"}, {rank: "5"}}}}
p.insurance = 5
events := table.settle()
- for _, text := range []string{"Hand 1/2 | WIN | Net +20 credits | 40 returned", "Hand 2/2 | LOSS | Net -10 credits", "INSURANCE | Net -5 credits", "Round complete | Net +5 credits"} {
+ for _, text := range []string{
+ "{casino_result_win}WIN{/}",
+ "{casino_payout}+5 credits{/}",
+ "Hand 1/2:{/} {casino_result_win}+20 credits{/}",
+ "Hand 2/2:{/} {casino_result_loss}-10 credits{/}",
+ "Insurance:{/} {casino_result_loss}-5 credits{/}",
+ } {
if !hasMessage(events, text) {
t.Fatalf("missing %q in %+v", text, events)
}
@@ -184,7 +190,7 @@ func TestDepartingSettlementCarriesBalanceSummary(t *testing.T) {
events := table.settle()
found := false
for _, e := range events {
- if strings.Contains(e.Message, "Round complete") && e.ShowBalance {
+ if strings.Contains(e.PrivateMessage, "LOSS") && e.ShowBalance {
found = true
}
}