WebClient: improve test coverage

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino 2023-12-10 18:34:09 +01:00
parent 8ce9af4adf
commit 691133d7c8
No known key found for this signature in database
GPG key ID: 935D2952DEC4EECF

View file

@ -18291,6 +18291,16 @@ func TestWebUserShareNoPasswordDisabled(t *testing.T) {
checkResponseCode(t, http.StatusOK, rr)
assert.Contains(t, rr.Body.String(), util.I18nErrorShareNoPwd)
user.Filters.DefaultSharesExpiration = 0
user.Filters.MaxSharesExpiration = 30
user, _, err = httpdtest.UpdateUser(user, http.StatusOK, "")
assert.NoError(t, err)
req, err = http.NewRequest(http.MethodGet, webClientSharePath, nil)
assert.NoError(t, err)
setJWTCookieForReq(req, token)
rr = executeRequest(req)
checkResponseCode(t, http.StatusOK, rr)
err = os.RemoveAll(user.GetHomeDir())
assert.NoError(t, err)
_, err = httpdtest.RemoveUser(user, http.StatusOK)