mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-22 07:30:25 +00:00
WebClient: improve test coverage
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
parent
8ce9af4adf
commit
691133d7c8
1 changed files with 10 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue