(new): rich message support
(fix): runtime reliability (tests): regression coverage (doc): v1.1 release notes
This commit is contained in:
+66
-1
@@ -318,6 +318,15 @@ func TestPrepareUpdateCtxContract(t *testing.T) {
|
||||
wantFrom: true,
|
||||
wantFromID: 115,
|
||||
},
|
||||
{
|
||||
name: "anonymous poll answer",
|
||||
update: &tgapi.Update{
|
||||
Type: tgapi.UpdateTypePollAnswer,
|
||||
PollAnswer: &tgapi.PollAnswer{VoterChat: tgapi.Chat{ID: -2007}},
|
||||
},
|
||||
wantChat: true,
|
||||
wantChatID: -2007,
|
||||
},
|
||||
{
|
||||
name: "message reaction",
|
||||
update: &tgapi.Update{
|
||||
@@ -368,8 +377,64 @@ func TestPrepareUpdateCtxContract(t *testing.T) {
|
||||
name: "message reaction count",
|
||||
update: &tgapi.Update{
|
||||
Type: tgapi.UpdateTypeMessageReactionCount,
|
||||
MessageReactionCount: &tgapi.MessageReactionCountUpdated{},
|
||||
MessageReactionCount: &tgapi.MessageReactionCountUpdated{Chat: &tgapi.Chat{ID: -2008}},
|
||||
},
|
||||
wantChat: true,
|
||||
wantChatID: -2008,
|
||||
},
|
||||
{
|
||||
name: "guest message",
|
||||
update: &tgapi.Update{
|
||||
Type: tgapi.UpdateTypeGuestMessage,
|
||||
GuestMessage: &tgapi.Message{
|
||||
From: &tgapi.User{ID: 119},
|
||||
Chat: &tgapi.Chat{ID: -2009},
|
||||
},
|
||||
},
|
||||
wantMsg: true,
|
||||
wantFrom: true,
|
||||
wantFromID: 119,
|
||||
wantChat: true,
|
||||
wantChatID: -2009,
|
||||
},
|
||||
{
|
||||
name: "deleted business messages",
|
||||
update: &tgapi.Update{
|
||||
Type: tgapi.UpdateTypeDeletedBusinessMessages,
|
||||
DeletedBusinessMessages: &tgapi.BusinessMessagesDeleted{Chat: tgapi.Chat{ID: -2010}},
|
||||
},
|
||||
wantChat: true,
|
||||
wantChatID: -2010,
|
||||
},
|
||||
{
|
||||
name: "managed bot",
|
||||
update: &tgapi.Update{
|
||||
Type: tgapi.UpdateTypeManagedBot,
|
||||
ManagedBot: &tgapi.ManagedBotUpdated{User: tgapi.User{ID: 120}},
|
||||
},
|
||||
wantFrom: true,
|
||||
wantFromID: 120,
|
||||
},
|
||||
{
|
||||
name: "subscription",
|
||||
update: &tgapi.Update{
|
||||
Type: tgapi.UpdateTypeSubscription,
|
||||
Subscription: &tgapi.BotSubscriptionUpdated{User: tgapi.User{ID: 121}},
|
||||
},
|
||||
wantFrom: true,
|
||||
wantFromID: 121,
|
||||
},
|
||||
{
|
||||
name: "giveaway chat boost has no user",
|
||||
update: &tgapi.Update{
|
||||
Type: tgapi.UpdateTypeChatBoost,
|
||||
ChatBoost: &tgapi.ChatBoostUpdated{
|
||||
Chat: tgapi.Chat{ID: -2011},
|
||||
Boost: tgapi.ChatBoost{Source: tgapi.ChatBoostSource{Source: "giveaway"}},
|
||||
},
|
||||
},
|
||||
wantChat: true,
|
||||
wantChatID: -2011,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user