aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/users/users.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-04-19 11:01:34 +0200
committerChocobozzz <me@florianbigard.com>2018-04-19 11:01:34 +0200
commit0883b3245bf0deb9106c4041e9afbd3521b79280 (patch)
treefcb73005e0b31a3b763ee5d22d5fc39c2da89907 /server/tests/api/users/users.ts
parent04ed10b21e8e1339514faae0bb690e4d97c23b0a (diff)
downloadPeerTube-0883b3245bf0deb9106c4041e9afbd3521b79280.tar.gz
PeerTube-0883b3245bf0deb9106c4041e9afbd3521b79280.tar.zst
PeerTube-0883b3245bf0deb9106c4041e9afbd3521b79280.zip
Add ability to choose what policy we have for NSFW videos
There is a global instance setting and a per user setting
Diffstat (limited to 'server/tests/api/users/users.ts')
-rw-r--r--server/tests/api/users/users.ts26
1 files changed, 13 insertions, 13 deletions
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts
index b6ab4f660..1192ef9e4 100644
--- a/server/tests/api/users/users.ts
+++ b/server/tests/api/users/users.ts
@@ -168,7 +168,7 @@ describe('Test users', function () {
168 168
169 expect(user.username).to.equal('user_1') 169 expect(user.username).to.equal('user_1')
170 expect(user.email).to.equal('user_1@example.com') 170 expect(user.email).to.equal('user_1@example.com')
171 expect(user.displayNSFW).to.be.false 171 expect(user.nsfwPolicy).to.equal('display')
172 expect(user.videoQuota).to.equal(2 * 1024 * 1024) 172 expect(user.videoQuota).to.equal(2 * 1024 * 1024)
173 expect(user.roleLabel).to.equal('User') 173 expect(user.roleLabel).to.equal('User')
174 expect(user.id).to.be.a('number') 174 expect(user.id).to.be.a('number')
@@ -215,12 +215,12 @@ describe('Test users', function () {
215 const user = users[ 0 ] 215 const user = users[ 0 ]
216 expect(user.username).to.equal('user_1') 216 expect(user.username).to.equal('user_1')
217 expect(user.email).to.equal('user_1@example.com') 217 expect(user.email).to.equal('user_1@example.com')
218 expect(user.displayNSFW).to.be.false 218 expect(user.nsfwPolicy).to.equal('display')
219 219
220 const rootUser = users[ 1 ] 220 const rootUser = users[ 1 ]
221 expect(rootUser.username).to.equal('root') 221 expect(rootUser.username).to.equal('root')
222 expect(rootUser.email).to.equal('admin1@example.com') 222 expect(rootUser.email).to.equal('admin1@example.com')
223 expect(rootUser.displayNSFW).to.be.false 223 expect(user.nsfwPolicy).to.equal('display')
224 224
225 userId = user.id 225 userId = user.id
226 }) 226 })
@@ -239,7 +239,7 @@ describe('Test users', function () {
239 expect(user.username).to.equal('root') 239 expect(user.username).to.equal('root')
240 expect(user.email).to.equal('admin1@example.com') 240 expect(user.email).to.equal('admin1@example.com')
241 expect(user.roleLabel).to.equal('Administrator') 241 expect(user.roleLabel).to.equal('Administrator')
242 expect(user.displayNSFW).to.be.false 242 expect(user.nsfwPolicy).to.equal('display')
243 }) 243 })
244 244
245 it('Should list only the first user by username desc', async function () { 245 it('Should list only the first user by username desc', async function () {
@@ -254,7 +254,7 @@ describe('Test users', function () {
254 const user = users[ 0 ] 254 const user = users[ 0 ]
255 expect(user.username).to.equal('user_1') 255 expect(user.username).to.equal('user_1')
256 expect(user.email).to.equal('user_1@example.com') 256 expect(user.email).to.equal('user_1@example.com')
257 expect(user.displayNSFW).to.be.false 257 expect(user.nsfwPolicy).to.equal('display')
258 }) 258 })
259 259
260 it('Should list only the second user by createdAt desc', async function () { 260 it('Should list only the second user by createdAt desc', async function () {
@@ -269,7 +269,7 @@ describe('Test users', function () {
269 const user = users[ 0 ] 269 const user = users[ 0 ]
270 expect(user.username).to.equal('user_1') 270 expect(user.username).to.equal('user_1')
271 expect(user.email).to.equal('user_1@example.com') 271 expect(user.email).to.equal('user_1@example.com')
272 expect(user.displayNSFW).to.be.false 272 expect(user.nsfwPolicy).to.equal('display')
273 }) 273 })
274 274
275 it('Should list all the users by createdAt asc', async function () { 275 it('Should list all the users by createdAt asc', async function () {
@@ -283,11 +283,11 @@ describe('Test users', function () {
283 283
284 expect(users[ 0 ].username).to.equal('root') 284 expect(users[ 0 ].username).to.equal('root')
285 expect(users[ 0 ].email).to.equal('admin1@example.com') 285 expect(users[ 0 ].email).to.equal('admin1@example.com')
286 expect(users[ 0 ].displayNSFW).to.be.false 286 expect(users[ 0 ].nsfwPolicy).to.equal('display')
287 287
288 expect(users[ 1 ].username).to.equal('user_1') 288 expect(users[ 1 ].username).to.equal('user_1')
289 expect(users[ 1 ].email).to.equal('user_1@example.com') 289 expect(users[ 1 ].email).to.equal('user_1@example.com')
290 expect(users[ 1 ].displayNSFW).to.be.false 290 expect(users[ 1 ].nsfwPolicy).to.equal('display')
291 }) 291 })
292 292
293 it('Should update my password', async function () { 293 it('Should update my password', async function () {
@@ -305,7 +305,7 @@ describe('Test users', function () {
305 await updateMyUser({ 305 await updateMyUser({
306 url: server.url, 306 url: server.url,
307 accessToken: accessTokenUser, 307 accessToken: accessTokenUser,
308 displayNSFW: true 308 nsfwPolicy: 'do_not_list'
309 }) 309 })
310 310
311 const res = await getMyUserInformation(server.url, accessTokenUser) 311 const res = await getMyUserInformation(server.url, accessTokenUser)
@@ -313,7 +313,7 @@ describe('Test users', function () {
313 313
314 expect(user.username).to.equal('user_1') 314 expect(user.username).to.equal('user_1')
315 expect(user.email).to.equal('user_1@example.com') 315 expect(user.email).to.equal('user_1@example.com')
316 expect(user.displayNSFW).to.be.ok 316 expect(user.nsfwPolicy).to.equal('do_not_list')
317 expect(user.videoQuota).to.equal(2 * 1024 * 1024) 317 expect(user.videoQuota).to.equal(2 * 1024 * 1024)
318 expect(user.id).to.be.a('number') 318 expect(user.id).to.be.a('number')
319 expect(user.account.description).to.be.null 319 expect(user.account.description).to.be.null
@@ -344,7 +344,7 @@ describe('Test users', function () {
344 344
345 expect(user.username).to.equal('user_1') 345 expect(user.username).to.equal('user_1')
346 expect(user.email).to.equal('updated@example.com') 346 expect(user.email).to.equal('updated@example.com')
347 expect(user.displayNSFW).to.be.ok 347 expect(user.nsfwPolicy).to.equal('do_not_list')
348 expect(user.videoQuota).to.equal(2 * 1024 * 1024) 348 expect(user.videoQuota).to.equal(2 * 1024 * 1024)
349 expect(user.id).to.be.a('number') 349 expect(user.id).to.be.a('number')
350 expect(user.account.description).to.be.null 350 expect(user.account.description).to.be.null
@@ -377,7 +377,7 @@ describe('Test users', function () {
377 377
378 expect(user.username).to.equal('user_1') 378 expect(user.username).to.equal('user_1')
379 expect(user.email).to.equal('updated@example.com') 379 expect(user.email).to.equal('updated@example.com')
380 expect(user.displayNSFW).to.be.ok 380 expect(user.nsfwPolicy).to.equal('do_not_list')
381 expect(user.videoQuota).to.equal(2 * 1024 * 1024) 381 expect(user.videoQuota).to.equal(2 * 1024 * 1024)
382 expect(user.id).to.be.a('number') 382 expect(user.id).to.be.a('number')
383 expect(user.account.description).to.equal('my super description updated') 383 expect(user.account.description).to.equal('my super description updated')
@@ -398,7 +398,7 @@ describe('Test users', function () {
398 398
399 expect(user.username).to.equal('user_1') 399 expect(user.username).to.equal('user_1')
400 expect(user.email).to.equal('updated2@example.com') 400 expect(user.email).to.equal('updated2@example.com')
401 expect(user.displayNSFW).to.be.ok 401 expect(user.nsfwPolicy).to.equal('do_not_list')
402 expect(user.videoQuota).to.equal(42) 402 expect(user.videoQuota).to.equal(42)
403 expect(user.roleLabel).to.equal('Moderator') 403 expect(user.roleLabel).to.equal('Moderator')
404 expect(user.id).to.be.a('number') 404 expect(user.id).to.be.a('number')