test(users): add e2e tests for preferences apis
This commit is contained in:
parent
fbe8708718
commit
2497968b82
5 changed files with 68 additions and 3 deletions
|
@ -5,9 +5,9 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/ihexxa/quickshare/src/db/userstore"
|
||||
"github.com/ihexxa/quickshare/src/handlers"
|
||||
"github.com/ihexxa/quickshare/src/handlers/multiusers"
|
||||
"github.com/ihexxa/quickshare/src/db/userstore"
|
||||
"github.com/parnurzeal/gorequest"
|
||||
)
|
||||
|
||||
|
@ -162,3 +162,12 @@ func (cl *SingleUserClient) Self(token *http.Cookie) (*http.Response, *multiuser
|
|||
}
|
||||
return resp, selfResp, errs
|
||||
}
|
||||
|
||||
func (cl *SingleUserClient) SetPreferences(prefers *userstore.Preferences, token *http.Cookie) (*http.Response, string, []error) {
|
||||
return cl.r.Patch(cl.url("/v1/users/preferences")).
|
||||
Send(multiusers.SetPreferencesReq{
|
||||
Preferences: prefers,
|
||||
}).
|
||||
AddCookie(token).
|
||||
End()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue