mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 21:56:50 -04:00
Fix tests after last change.
This commit is contained in:
@@ -60,7 +60,7 @@ func TestAllianceStationDisplayWebsocket(t *testing.T) {
|
||||
web.arena.AllianceStations["B3"].Bypass = true
|
||||
web.arena.StartMatch()
|
||||
web.arena.Update()
|
||||
messages := readWebsocketMultiple(t, ws, 2)
|
||||
messages := readWebsocketMultiple(t, ws, 3)
|
||||
_, ok := messages["matchTime"]
|
||||
assert.True(t, ok)
|
||||
web.arena.MatchStartTime = time.Now().Add(-time.Duration(game.MatchTiming.WarmupDurationSec) * time.Second)
|
||||
|
||||
@@ -350,7 +350,7 @@ func TestMatchPlayWebsocketNotifications(t *testing.T) {
|
||||
web.arena.AllianceStations["B3"].Bypass = true
|
||||
assert.Nil(t, web.arena.StartMatch())
|
||||
web.arena.Update()
|
||||
messages := readWebsocketMultiple(t, ws, 3)
|
||||
messages := readWebsocketMultiple(t, ws, 4)
|
||||
_, ok := messages["matchTime"]
|
||||
assert.True(t, ok)
|
||||
_, ok = messages["audienceDisplayMode"]
|
||||
@@ -364,7 +364,6 @@ func TestMatchPlayWebsocketNotifications(t *testing.T) {
|
||||
assert.Equal(t, true, statusReceived)
|
||||
assert.Equal(t, 3, matchTime.MatchState)
|
||||
assert.Equal(t, 3, matchTime.MatchTimeSec)
|
||||
assert.True(t, ok)
|
||||
web.arena.ScoringStatusNotifier.Notify()
|
||||
readWebsocketType(t, ws, "scoringStatus")
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ package web
|
||||
|
||||
import (
|
||||
"github.com/Team254/cheesy-arena/field"
|
||||
"github.com/Team254/cheesy-arena/game"
|
||||
"github.com/Team254/cheesy-arena/websocket"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"net/http"
|
||||
@@ -83,6 +84,8 @@ func readWebsocketMultiple(t *testing.T, ws *websocket.Websocket, count int) map
|
||||
}
|
||||
|
||||
func setupTestWeb(t *testing.T) *Web {
|
||||
game.MatchTiming.WarmupDurationSec = 3
|
||||
game.MatchTiming.PauseDurationSec = 2
|
||||
arena := field.SetupTestArena(t, "web")
|
||||
return NewWeb(arena)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user