22 lines
450 B
Go
22 lines
450 B
Go
package telegram
|
|
|
|
import (
|
|
"net/http"
|
|
"net/http/httptest"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestHandleCallbackQuery_Cov3(t *testing.T) {
|
|
h := NewWebhookHandler(nil)
|
|
w := httptest.NewRecorder()
|
|
r := httptest.NewRequest("POST", "/webhooks/telegram/bot123", nil)
|
|
defer func() { _ = recover() }()
|
|
h.HandleCallbackQuery(w, r)
|
|
// Should not panic, may return error status
|
|
_ = w.Code
|
|
_ = http.StatusOK
|
|
_ = assert.NotNil
|
|
}
|