test /gm/rpc/broadcastSomeoneSaidAlias

This commit is contained in:
Bel LaPointe
2023-03-27 07:26:40 -06:00
parent 8ff1c2fab4
commit dd41028aab
2 changed files with 27 additions and 4 deletions

View File

@@ -166,7 +166,30 @@ func TestServeGM(t *testing.T) {
})
})
t.Run("publicStatus", func(t *testing.T) {
t.Run("broadcastSomeoneSaidAlias", func(t *testing.T) {
v01 := NewV01(ctx, nil)
v01.cfg.Quiet = false
v01.cfg.Users = map[string]configUser{
"bel": configUser{
Alias: "driver",
Message: "if someone else says 'driver', then you get to play",
},
"broadcast": configUser{
Message: ":)",
},
}
do(v01, "/gm/rpc/broadcastSomeoneSaidAlias", "")
if !v01.cfg.Quiet {
t.Error(v01.cfg.Quiet)
}
if v := v01.cfg.Users["bel"]; v.Alias != "" {
t.Error(v.Alias)
} else if v.Message != "driver" {
t.Error(v.Message)
}
if bc := v01.cfg.Users["broadcast"]; bc.Message == ":)" {
t.Error(bc)
}
})
t.Run("publicStatus", func(t *testing.T) {