fix linter
This commit is contained in:
parent
a0b8fc885c
commit
379aa3c2d1
1 changed files with 28 additions and 28 deletions
|
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue