f8e0615cc8
These changes ensure that the new (SHA256) session ID is returned in the "session_id" field, so that developers have time to update their client implementations to use the new "access_token" field. Signed-off-by: Michael Mayer <michael@photoprism.app>
24 lines
505 B
Go
24 lines
505 B
Go
package api
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestWebsocket(t *testing.T) {
|
|
t.Run("BadRequest", func(t *testing.T) {
|
|
app, router, _ := NewApiTest()
|
|
WebSocket(router)
|
|
r := PerformRequest(app, "GET", "/api/v1/ws")
|
|
assert.Equal(t, http.StatusBadRequest, r.Code)
|
|
})
|
|
|
|
t.Run("NoRouter", func(t *testing.T) {
|
|
app, _, _ := NewApiTest()
|
|
WebSocket(nil)
|
|
r := PerformRequest(app, "GET", "/api/v1/ws")
|
|
assert.Equal(t, http.StatusNotFound, r.Code)
|
|
})
|
|
}
|