impl,test fill non player aliases

This commit is contained in:
Bel LaPointe
2023-03-27 09:30:29 -06:00
parent 0435f7b3e8
commit d029d82366
2 changed files with 43 additions and 2 deletions

View File

@@ -194,7 +194,24 @@ func TestServeGM(t *testing.T) {
})
t.Run("fillNonPlayerAliases", func(t *testing.T) {
t.Error("not impl")
t.Run("happy", func(t *testing.T) {
v01 := NewV01(ctx, nil)
v01.cfg.Users = map[string]configUser{
"bel": configUser{Player: 1},
"zach": configUser{Player: 0},
}
do(v01, "/gm/rpc/fillNonPlayerAliases", "[qt]")
if v := v01.cfg.Users["bel"]; v.Alias != "" {
t.Error(v.Alias)
} else if v.Player != 1 {
t.Error(v.Player)
}
if v := v01.cfg.Users["zach"]; v.Alias != "qt" {
t.Error(v.Alias)
} else if v.Player != 0 {
t.Error(v.Player)
}
})
})
t.Run("vote", func(t *testing.T) {