Files
tiennm99 53f387c576 feat(random): add an unlisted /genshin meteor wish command
/genshin takes the same input as /gacha and sends the Genshin-style
meteor wish that wheelofnames serves on /api/genshin, as a 7-second
640x360 MP4. It stays out of the command menu and /help.
2026-10-01 23:38:21 +07:00

36 lines
926 B
Go

package random
import (
"testing"
"github.com/tiennm99/miti99bot/internal/modules"
"github.com/tiennm99/miti99bot/internal/storage"
)
func TestNew_RegistersRandomGroup(t *testing.T) {
mod := New(modules.Deps{Store: storage.NewMemoryProvider().Collection("random")})
want := map[string]modules.Visibility{
"random": modules.VisibilityPublic,
"wheelofnames": modules.VisibilityPublic,
"gacha": modules.VisibilityPublic,
"genshin": modules.VisibilityUnlisted,
}
if len(mod.Commands) != len(want) {
t.Fatalf("commands count = %d, want %d", len(mod.Commands), len(want))
}
for _, c := range mod.Commands {
v, ok := want[c.Name]
if !ok {
t.Errorf("unexpected command %q", c.Name)
continue
}
if c.Visibility != v {
t.Errorf("command %q visibility = %d, want %d", c.Name, c.Visibility, v)
}
if c.Handler == nil {
t.Errorf("command %q has nil handler", c.Name)
}
}
}