]> git.giacomolli.uk - onechat/blobdiff - telegram_test.go
Document user service updates
[onechat] / telegram_test.go
index 5e50ec15755f1b8f3367a44f6120697dcddf6d9b..66a5f4749d1d17866731412dc8969c8784891792 100644 (file)
@@ -179,6 +179,24 @@ func TestBotShowsOnlyTheStartAndTheEndOfASubagent(t *testing.T) {
        }, sent)
 }
 
+func TestBotSkipsTheWorkOfWhatsAppAndTheSchedules(t *testing.T) {
+       bot := &TelegramBot{
+               ready: make(chan struct{}, 1),
+       }
+
+       bot.Notify(Event{
+               Kind:   "work",
+               Source: whatsappSource,
+               Text:   "[WhatsApp] Ana Souza",
+       })
+       bot.Notify(Event{
+               Kind:   "work",
+               Source: scheduleSource,
+               Text:   "[Schedule 1] Sunday 2026-11-08 20:05 -03:00, once",
+       })
+       require.Empty(t, bot.queue)
+}
+
 func TestBotStartsAtTheStoredOffset(t *testing.T) {
        server := newModelFake(t)
        server.reply = func(w http.ResponseWriter, call ModelFakeCall) {