mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 13:46:44 -04:00
Refactor match sounds such that they only need to be listed in one place.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"github.com/Team254/cheesy-arena/game"
|
||||
"github.com/Team254/cheesy-arena/model"
|
||||
"github.com/Team254/cheesy-arena/websocket"
|
||||
"net/http"
|
||||
@@ -29,7 +30,8 @@ func (web *Web) audienceDisplayHandler(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
data := struct {
|
||||
*model.EventSettings
|
||||
}{web.arena.EventSettings}
|
||||
MatchSounds []*game.MatchSound
|
||||
}{web.arena.EventSettings, game.MatchSounds}
|
||||
err = template.ExecuteTemplate(w, "audience_display.html", data)
|
||||
if err != nil {
|
||||
handleWebErr(w, err)
|
||||
|
||||
@@ -64,7 +64,7 @@ func TestAudienceDisplayWebsocket(t *testing.T) {
|
||||
}
|
||||
sound, ok := messages["playSound"]
|
||||
if assert.True(t, ok) {
|
||||
assert.Equal(t, "match-start", sound)
|
||||
assert.Equal(t, "start", sound)
|
||||
}
|
||||
_, ok = messages["matchTime"]
|
||||
assert.True(t, ok)
|
||||
|
||||
Reference in New Issue
Block a user