fix linter

This commit is contained in:
Christoforus Surjoputro 2026-03-23 18:22:15 +07:00
parent a0b8fc885c
commit 379aa3c2d1

View file

@ -644,34 +644,34 @@ func TestHandleMessage_ReplyThread_NonForum_NoIsolation(t *testing.T) {
} }
func TestHandleMessage_EmptyContent_Ignored(t *testing.T) { func TestHandleMessage_EmptyContent_Ignored(t *testing.T) {
messageBus := bus.NewMessageBus() messageBus := bus.NewMessageBus()
ch := &TelegramChannel{ ch := &TelegramChannel{
BaseChannel: channels.NewBaseChannel("telegram", nil, messageBus, nil), BaseChannel: channels.NewBaseChannel("telegram", nil, messageBus, nil),
chatIDs: make(map[string]int64), chatIDs: make(map[string]int64),
ctx: context.Background(), ctx: context.Background(),
} }
// Service message with no text/caption/media (like ForumTopicCreated) // Service message with no text/caption/media (like ForumTopicCreated)
msg := &telego.Message{ msg := &telego.Message{
MessageID: 123, MessageID: 123,
Chat: telego.Chat{ Chat: telego.Chat{
ID: 456, ID: 456,
Type: "group", Type: "group",
}, },
From: &telego.User{ From: &telego.User{
ID: 789, ID: 789,
FirstName: "User", FirstName: "User",
}, },
} }
err := ch.handleMessage(context.Background(), msg) err := ch.handleMessage(context.Background(), msg)
require.NoError(t, err) require.NoError(t, err)
// Should NOT publish to message bus // Should NOT publish to message bus
select { select {
case <-messageBus.InboundChan(): case <-messageBus.InboundChan():
t.Fatal("Empty message should not be published to message bus") t.Fatal("Empty message should not be published to message bus")
case <-time.After(100 * time.Millisecond): case <-time.After(100 * time.Millisecond):
// nothing was published // nothing was published
} }
} }