aboutsummaryrefslogtreecommitdiff
path: root/internal/game/roulette_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/roulette_test.go')
-rw-r--r--internal/game/roulette_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/game/roulette_test.go b/internal/game/roulette_test.go
index e581435..7b83807 100644
--- a/internal/game/roulette_test.go
+++ b/internal/game/roulette_test.go
@@ -173,3 +173,23 @@ func TestCasinoTestPortalAuthoredContract(t *testing.T) {
}
}
}
+
+// A wager must not re-send the betting board; the board arrives on join,
+// after settlement via the next-spin menu, or on an explicit "table".
+func TestRouletteBetDoesNotResendBoard(t *testing.T) {
+ g, sess, conn := uxCasinoGame(t)
+ cfg := casino.TableConfig{ID: "roulette", Game: casino.GameRoulette}
+ g.emitCasinoEvents(g.Casino.Join(1, cfg, sess.Player.Name))
+ if !strings.Contains(string(conn.data), "1to12") {
+ t.Fatalf("join did not draw the board: %q", conn.data)
+ }
+ conn.data = nil
+ g.executeBet(sess, []string{"10", "on", "red"}, "bet 10 on red")
+ text := string(conn.data)
+ if strings.Contains(text, "1to12") {
+ t.Fatalf("placing a wager redrew the board: %q", text)
+ }
+ if !strings.Contains(text, "You bet 10 on red") {
+ t.Fatalf("missing wager confirmation: %q", text)
+ }
+}