Fix JS error when receiving reply during channel switch (#5582)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
2e911b77c3
Коммит
e739a91c94
@@ -4,6 +4,7 @@
|
||||
package api4
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"testing"
|
||||
@@ -504,6 +505,16 @@ func TestViewChannel(t *testing.T) {
|
||||
_, resp = Client.ViewChannel(th.BasicUser2.Id, view)
|
||||
CheckForbiddenStatus(t, resp)
|
||||
|
||||
if r, err := Client.DoApiPost(fmt.Sprintf("/channels/members/%v/view", th.BasicUser.Id), "garbage"); err == nil {
|
||||
t.Fatal("should have errored")
|
||||
} else {
|
||||
if r.StatusCode != http.StatusBadRequest {
|
||||
t.Log("actual: " + strconv.Itoa(r.StatusCode))
|
||||
t.Log("expected: " + strconv.Itoa(http.StatusBadRequest))
|
||||
t.Fatal("wrong status code")
|
||||
}
|
||||
}
|
||||
|
||||
Client.Logout()
|
||||
_, resp = Client.ViewChannel(th.BasicUser.Id, view)
|
||||
CheckUnauthorizedStatus(t, resp)
|
||||
|
||||
Ссылка в новой задаче
Block a user