}
it('Should fail with a too small username', async function () {
- const fields = immutableAssign(baseCorrectParams, { username: 'fi' })
+ const fields = immutableAssign(baseCorrectParams, { username: '' })
await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
})
it('Should fail with a too long username', async function () {
- const fields = immutableAssign(baseCorrectParams, { username: 'my_super_username_which_is_very_long' })
+ const fields = immutableAssign(baseCorrectParams, { username: 'super'.repeat(50) })
await makePostBodyRequest({ url: server.url, path, token: server.accessToken, fields })
})
await makePutBodyRequest({ url: server.url, path: path + 'me', token: userAccessToken, fields })
})
+ it('Should fail with an invalid videosHistoryEnabled attribute', async function () {
+ const fields = {
+ videosHistoryEnabled: -1
+ }
+
+ await makePutBodyRequest({ url: server.url, path: path + 'me', token: userAccessToken, fields })
+ })
+
it('Should fail with an non authenticated user', async function () {
const fields = {
currentPassword: 'my super password',
await makePutBodyRequest({ url: server.url, path: path + userId, token: server.accessToken, fields })
})
+ it('Should fail with an invalid emailVerified attribute', async function () {
+ const fields = {
+ emailVerified: 'yes'
+ }
+
+ await makePutBodyRequest({ url: server.url, path: path + userId, token: server.accessToken, fields })
+ })
+
it('Should fail with an invalid videoQuota attribute', async function () {
const fields = {
videoQuota: -90
it('Should succeed with the correct params', async function () {
const fields = {
email: 'email@example.com',
+ emailVerified: true,
videoQuota: 42,
- role: UserRole.MODERATOR
+ role: UserRole.USER
}
await makePutBodyRequest({ url: server.url, path: path + userId, token: server.accessToken, fields, statusCodeExpected: 204 })
- userAccessToken = await userLogin(server, user)
})
})
}
it('Should fail with a too small username', async function () {
- const fields = immutableAssign(baseCorrectParams, { username: 'ji' })
+ const fields = immutableAssign(baseCorrectParams, { username: '' })
await makePostBodyRequest({ url: server.url, path: registrationPath, token: server.accessToken, fields })
})
it('Should fail with a too long username', async function () {
- const fields = immutableAssign(baseCorrectParams, { username: 'my_super_username_which_is_very_long' })
+ const fields = immutableAssign(baseCorrectParams, { username: 'super'.repeat(50) })
await makePostBodyRequest({ url: server.url, path: registrationPath, token: server.accessToken, fields })
})