aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/manager_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/casino/manager_test.go')
-rw-r--r--internal/casino/manager_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/internal/casino/manager_test.go b/internal/casino/manager_test.go
index 245133d..8d6dd3d 100644
--- a/internal/casino/manager_test.go
+++ b/internal/casino/manager_test.go
@@ -64,6 +64,25 @@ func TestMultiplePlayersWaitForBets(t *testing.T) {
m.Bet(1, "slots", "bob", 10, wb)
}
+func TestTableBettingIgnoresDisconnected(t *testing.T) {
+ m := NewManager(1)
+ cfg := TableConfig{ID: "slots", Game: GameSlots, BettingTicks: 20}
+ m.Join(1, cfg, "alice")
+ m.Join(1, cfg, "bob")
+ m.MarkDisconnected("bob")
+ w := &testWallet{credits: 100}
+ events := m.Bet(1, "slots", "alice", 10, w)
+ found := false
+ for _, event := range events {
+ if event.Type == EventRoundStarted {
+ found = true
+ }
+ }
+ if !found {
+ t.Fatal("disconnected player stalled the table's round")
+ }
+}
+
func TestMachineAutobetCountdownAndStop(t *testing.T) {
m := NewManager(1)
cfg := MachineConfig{ID: "slots", Game: GameSlots, SpinTicks: 1}