Fix failing test.
This commit is contained in:
parent
5e497cfcba
commit
e41be9f718
1 changed files with 7 additions and 7 deletions
|
@ -688,11 +688,13 @@ func TestDeleteMessage(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPinChatMessage(t *testing.T) {
|
func TestPinChatMessage(t *testing.T) {
|
||||||
bot, _ := getBot(t)
|
bot, err := getBot(t)
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
msg := tgbotapi.NewMessage(SupergroupChatID, "A test message from the test library in telegram-bot-api")
|
msg := tgbotapi.NewMessage(SupergroupChatID, "A test message from the test library in telegram-bot-api")
|
||||||
msg.ParseMode = tgbotapi.ModeMarkdown
|
msg.ParseMode = tgbotapi.ModeMarkdown
|
||||||
message, _ := bot.Send(msg)
|
message, err := bot.Send(msg)
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
pinChatMessageConfig := tgbotapi.PinChatMessageConfig{
|
pinChatMessageConfig := tgbotapi.PinChatMessageConfig{
|
||||||
BaseChatMessage: tgbotapi.BaseChatMessage{
|
BaseChatMessage: tgbotapi.BaseChatMessage{
|
||||||
|
@ -703,11 +705,9 @@ func TestPinChatMessage(t *testing.T) {
|
||||||
},
|
},
|
||||||
DisableNotification: false,
|
DisableNotification: false,
|
||||||
}
|
}
|
||||||
_, err := bot.Request(pinChatMessageConfig)
|
res, err := bot.Request(pinChatMessageConfig)
|
||||||
|
require.NoError(t, err)
|
||||||
if err != nil {
|
require.NotNil(t, res)
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestUnpinChatMessage(t *testing.T) {
|
func TestUnpinChatMessage(t *testing.T) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue