(new): rich message support
(fix): runtime reliability (tests): regression coverage (doc): v1.1 release notes
This commit is contained in:
@@ -72,6 +72,18 @@ func TestUpdateUnmarshalSetsType(t *testing.T) {
|
||||
}`,
|
||||
want: UpdateTypeManagedBot,
|
||||
},
|
||||
{
|
||||
name: "subscription",
|
||||
body: `{
|
||||
"update_id": 6,
|
||||
"subscription": {
|
||||
"user": {"id": 13, "is_bot": false, "first_name": "Subscriber"},
|
||||
"invoice_payload": "monthly",
|
||||
"state": "active"
|
||||
}
|
||||
}`,
|
||||
want: UpdateTypeSubscription,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
@@ -89,6 +101,9 @@ func TestUpdateUnmarshalSetsType(t *testing.T) {
|
||||
if tt.want == UpdateTypeManagedBot && update.ManagedBot.Bot.ID != 12 {
|
||||
t.Fatalf("unexpected managed bot id: got %d want %d", update.ManagedBot.Bot.ID, 12)
|
||||
}
|
||||
if tt.want == UpdateTypeSubscription && update.Subscription.User.ID != 13 {
|
||||
t.Fatalf("unexpected subscription user id: got %d want %d", update.Subscription.User.ID, 13)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user