diff options
Diffstat (limited to 'internal/game/quit_casino_test.go')
| -rw-r--r-- | internal/game/quit_casino_test.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/game/quit_casino_test.go b/internal/game/quit_casino_test.go index 50f9ac8..f373457 100644 --- a/internal/game/quit_casino_test.go +++ b/internal/game/quit_casino_test.go @@ -169,7 +169,9 @@ func TestQuitMidRoundMentionsQuitNow(t *testing.T) { // "quit now" starts the logout countdown while the player keeps their seat // and wager; the stake is forfeited and the seat freed only on the final -// tick, immediately before the disconnect. +// tick, immediately before the disconnect. The round must be IN FLIGHT for +// that: a stake placed in the betting window has had no card dealt for it and +// is refunded on disconnect (see markDisconnected). func TestQuitNowForfeitsOnlyAtLogout(t *testing.T) { g, sess := quitTestGame(t) sess.Account = &player.Account{Name: "alice"} @@ -177,6 +179,10 @@ func TestQuitNowForfeitsOnlyAtLogout(t *testing.T) { g.Casino.Join(1, cfg, "alice") g.Casino.Join(1, cfg, "bob") g.Casino.Bet(1, "blackjack", "alice", "", 10, casinoWallet{g: g, p: sess.Player}) + // Bob bets too so the round actually starts and alice holds a dealt hand. + bobWallet := player.New("bob") + bobWallet.Credits = 1000 + g.Casino.Bet(1, "blackjack", "bob", "", 10, casinoWallet{g: g, p: bobWallet}) wallet := sess.Player g.doQuitNow(sess) |
