diff --git a/api4/preference_test.go b/api4/preference_test.go index 4a68bc8049..68d34784ff 100644 --- a/api4/preference_test.go +++ b/api4/preference_test.go @@ -252,6 +252,10 @@ func TestUpdatePreferencesWebsocket(t *testing.T) { } WebSocketClient.Listen() + time.Sleep(300 * time.Millisecond) + if resp := <-WebSocketClient.ResponseChannel; resp.Status != model.STATUS_OK { + t.Fatal("should have responded OK to authentication challenge") + } userId := th.BasicUser.Id preferences := &model.Preferences{ @@ -371,6 +375,10 @@ func TestDeletePreferencesWebsocket(t *testing.T) { } WebSocketClient.Listen() + time.Sleep(300 * time.Millisecond) + if resp := <-WebSocketClient.ResponseChannel; resp.Status != model.STATUS_OK { + t.Fatal("should have responded OK to authentication challenge") + } _, resp = th.Client.DeletePreferences(userId, preferences) CheckNoError(t, resp)