diff --git a/src/device/input/parse/v01/server.go b/src/device/input/parse/v01/server.go index 5183ca7..4fe5a28 100644 --- a/src/device/input/parse/v01/server.go +++ b/src/device/input/parse/v01/server.go @@ -158,7 +158,7 @@ func (v01 *V01) serveGM(w http.ResponseWriter, r *http.Request) { v01.cfg.Users[k] = v } v01.servePutBroadcastValue(fmt.Sprintf("<>", strings.ToUpper(r.URL.Query().Get("message")))) - case "/gm/rpc/setNonPlayerAliases": + case "/gm/rpc/fillNonPlayerAliases": panic("TODO stash aliases") case "/gm/rpc/vote": panic("TODO stash user:votedForUser") diff --git a/src/device/input/parse/v01/server_test.go b/src/device/input/parse/v01/server_test.go index ec23c02..bcb6e8e 100644 --- a/src/device/input/parse/v01/server_test.go +++ b/src/device/input/parse/v01/server_test.go @@ -192,18 +192,50 @@ func TestServeGM(t *testing.T) { } }) - t.Run("publicStatus", func(t *testing.T) { + t.Run("fillNonPlayerAliases", func(t *testing.T) { + t.Error("not impl") }) - t.Run("publicStatus", func(t *testing.T) { + t.Run("vote", func(t *testing.T) { + t.Error("not impl") }) - t.Run("publicStatus", func(t *testing.T) { + t.Run("elect", func(t *testing.T) { + t.Error("not impl") }) - t.Run("publicStatus", func(t *testing.T) { + t.Run("shuffle", func(t *testing.T) { + t.Run("happy", func(t *testing.T) { + v01 := NewV01(ctx, nil) + v01.cfg.Quiet = true + v01.cfg.Users = map[string]configUser{ + "bel": configUser{Player: 1}, + "zach": configUser{Player: 2}, + } + resp := do(v01, "/gm/rpc/swap?a=bel&b=zach", "") + if resp.Code != http.StatusOK { + t.Error(resp.Code) + } + if v01.cfg.Quiet { + t.Error(v01.cfg.Quiet) + } + if v01.cfg.Users["bel"].Player != 2 { + t.Error(v01.cfg.Users["bel"]) + } else if v01.cfg.Users["zach"].Player != 1 { + t.Error(v01.cfg.Users["zach"]) + } + }) }) - t.Run("publicStatus", func(t *testing.T) { + t.Run("swap", func(t *testing.T) { + t.Error("not impl") + }) + + t.Run("404", func(t *testing.T) { + v01 := NewV01(ctx, nil) + resp := do(v01, "/gm/teehee", "") + if resp.Code != http.StatusNotFound { + t.Error(resp.Code) + } }) }