]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix tests
authorChocobozzz <florian.bigard@gmail.com>
Wed, 2 Aug 2017 19:44:01 +0000 (21:44 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Wed, 2 Aug 2017 19:51:40 +0000 (21:51 +0200)
server/tests/api/config.js
server/tests/api/multiple-pods.js
server/tests/api/single-pod.js
server/tests/api/users.js

index f2c00f85a94254f223a56ef3ab5807eb9a5a6fdd..052b3f036d3bdf0ebbc376b3cf5a1e1c9df189c6 100644 (file)
@@ -44,19 +44,15 @@ describe('Test config', function () {
   it('Should have a correct config on a server with registration enabled and a users limit', function (done) {
     series([
       function (next) {
-        usersUtils.registerUser(server.url, 'user1', 'super password', done)
+        usersUtils.registerUser(server.url, 'user1', 'super password', next)
       },
 
       function (next) {
-        usersUtils.registerUser(server.url, 'user2', 'super password', done)
+        usersUtils.registerUser(server.url, 'user2', 'super password', next)
       },
 
       function (next) {
-        usersUtils.registerUser(server.url, 'user3', 'super password', done)
-      },
-
-      function (next) {
-        usersUtils.registerUser(server.url, 'user4', 'super password', done)
+        usersUtils.registerUser(server.url, 'user3', 'super password', next)
       }
 
     ], function (err) {
@@ -67,7 +63,7 @@ describe('Test config', function () {
 
         const data = res.body
 
-        expect(data.signup.allowed).to.be.truthy
+        expect(data.signup.allowed).to.be.false
 
         done()
       })
index 7753e6f2dc8dc075830fbe73ed86ff7a8ed7ceb5..abbc2caf4765b5006b34f8a3ce703680f1ca1ecf 100644 (file)
@@ -118,7 +118,7 @@ describe('Test multiple pods', function () {
               expect(video.licenceLabel).to.equal('Attribution - Non Commercial')
               expect(video.language).to.equal(9)
               expect(video.languageLabel).to.equal('Japanese')
-              expect(video.nsfw).to.be.truthy
+              expect(video.nsfw).to.be.ok
               expect(video.description).to.equal('my super description for pod 1')
               expect(video.podHost).to.equal('localhost:9001')
               expect(video.magnetUri).to.exist
@@ -195,7 +195,7 @@ describe('Test multiple pods', function () {
               expect(video.licenceLabel).to.equal('Attribution - No Derivatives')
               expect(video.language).to.equal(11)
               expect(video.languageLabel).to.equal('German')
-              expect(video.nsfw).to.be.falsy
+              expect(video.nsfw).to.be.true
               expect(video.description).to.equal('my super description for pod 2')
               expect(video.podHost).to.equal('localhost:9002')
               expect(video.magnetUri).to.exist
@@ -294,7 +294,7 @@ describe('Test multiple pods', function () {
               expect(video1.licenceLabel).to.equal('Attribution - Non Commercial - Share Alike')
               expect(video1.language).to.equal(11)
               expect(video1.languageLabel).to.equal('German')
-              expect(video1.nsfw).to.be.truthy
+              expect(video1.nsfw).to.be.ok
               expect(video1.description).to.equal('my super description for pod 3')
               expect(video1.podHost).to.equal('localhost:9003')
               expect(video1.magnetUri).to.exist
@@ -311,7 +311,7 @@ describe('Test multiple pods', function () {
               expect(video2.licenceLabel).to.equal('Attribution - Non Commercial - No Derivatives')
               expect(video2.language).to.equal(12)
               expect(video2.languageLabel).to.equal('Korean')
-              expect(video2.nsfw).to.be.falsy
+              expect(video2.nsfw).to.be.false
               expect(video2.description).to.equal('my super description for pod 3-2')
               expect(video2.podHost).to.equal('localhost:9003')
               expect(video2.magnetUri).to.exist
@@ -695,7 +695,7 @@ describe('Test multiple pods', function () {
           expect(videoUpdated.licenceLabel).to.equal('Public Domain Dedication')
           expect(videoUpdated.language).to.equal(13)
           expect(videoUpdated.languageLabel).to.equal('French')
-          expect(videoUpdated.nsfw).to.be.truthy
+          expect(videoUpdated.nsfw).to.be.ok
           expect(videoUpdated.description).to.equal('my super description updated')
           expect(videoUpdated.tags).to.deep.equal([ 'tagup1', 'tagup2' ])
           expect(miscsUtils.dateIsValid(videoUpdated.updatedAt, 20000)).to.be.true
index 0dac9a1833a036f471e3f0ef78fc97fa9727c6bf..1258e7e5563f3a673f597295c948b051de72872a 100644 (file)
@@ -126,7 +126,7 @@ describe('Test a single pod', function () {
       expect(video.licenceLabel).to.equal('Attribution - Non Commercial - No Derivatives')
       expect(video.language).to.equal(3)
       expect(video.languageLabel).to.equal('Mandarin')
-      expect(video.nsfw).to.be.truthy
+      expect(video.nsfw).to.be.ok
       expect(video.description).to.equal('my super description')
       expect(video.podHost).to.equal('localhost:9001')
       expect(video.magnetUri).to.exist
@@ -169,7 +169,7 @@ describe('Test a single pod', function () {
       expect(video.licenceLabel).to.equal('Attribution - Non Commercial - No Derivatives')
       expect(video.language).to.equal(3)
       expect(video.languageLabel).to.equal('Mandarin')
-      expect(video.nsfw).to.be.truthy
+      expect(video.nsfw).to.be.ok
       expect(video.description).to.equal('my super description')
       expect(video.podHost).to.equal('localhost:9001')
       expect(video.magnetUri).to.exist
@@ -231,7 +231,7 @@ describe('Test a single pod', function () {
       expect(video.licenceLabel).to.equal('Attribution - Non Commercial - No Derivatives')
       expect(video.language).to.equal(3)
       expect(video.languageLabel).to.equal('Mandarin')
-      expect(video.nsfw).to.be.truthy
+      expect(video.nsfw).to.be.ok
       expect(video.description).to.equal('my super description')
       expect(video.podHost).to.equal('localhost:9001')
       expect(video.author).to.equal('root')
@@ -293,7 +293,7 @@ describe('Test a single pod', function () {
       expect(video.licenceLabel).to.equal('Attribution - Non Commercial - No Derivatives')
       expect(video.language).to.equal(3)
       expect(video.languageLabel).to.equal('Mandarin')
-      expect(video.nsfw).to.be.truthy
+      expect(video.nsfw).to.be.ok
       expect(video.description).to.equal('my super description')
       expect(video.podHost).to.equal('localhost:9001')
       expect(video.author).to.equal('root')
@@ -641,7 +641,7 @@ describe('Test a single pod', function () {
       expect(video.licenceLabel).to.equal('Attribution - Share Alike')
       expect(video.language).to.equal(5)
       expect(video.languageLabel).to.equal('Arabic')
-      expect(video.nsfw).to.be.truthy
+      expect(video.nsfw).to.be.ok
       expect(video.description).to.equal('my super description updated')
       expect(video.podHost).to.equal('localhost:9001')
       expect(video.author).to.equal('root')
@@ -685,7 +685,7 @@ describe('Test a single pod', function () {
         expect(video.licenceLabel).to.equal('Attribution - Share Alike')
         expect(video.language).to.equal(5)
         expect(video.languageLabel).to.equal('Arabic')
-        expect(video.nsfw).to.be.truthy
+        expect(video.nsfw).to.be.ok
         expect(video.description).to.equal('my super description updated')
         expect(video.podHost).to.equal('localhost:9001')
         expect(video.author).to.equal('root')
@@ -719,7 +719,7 @@ describe('Test a single pod', function () {
         expect(video.licenceLabel).to.equal('Attribution - Share Alike')
         expect(video.language).to.equal(5)
         expect(video.languageLabel).to.equal('Arabic')
-        expect(video.nsfw).to.be.truthy
+        expect(video.nsfw).to.be.ok
         expect(video.description).to.equal('hello everybody')
         expect(video.podHost).to.equal('localhost:9001')
         expect(video.author).to.equal('root')
index 74477ae2d8db11ec1525e11f9a9dd017974fb9fb..dacecf2959debc2d0a4dde5067b05edc52aef56f 100644 (file)
@@ -209,7 +209,7 @@ describe('Test users', function () {
 
       expect(user.username).to.equal('user_1')
       expect(user.email).to.equal('user_1@example.com')
-      expect(user.displayNSFW).to.be.falsy
+      expect(user.displayNSFW).to.be.false
       expect(user.id).to.exist
 
       done()
@@ -238,12 +238,12 @@ describe('Test users', function () {
       const user = users[0]
       expect(user.username).to.equal('user_1')
       expect(user.email).to.equal('user_1@example.com')
-      expect(user.displayNSFW).to.be.falsy
+      expect(user.displayNSFW).to.be.false
 
       const rootUser = users[1]
       expect(rootUser.username).to.equal('root')
       expect(rootUser.email).to.equal('admin1@example.com')
-      expect(rootUser.displayNSFW).to.be.falsy
+      expect(rootUser.displayNSFW).to.be.false
 
       userId = user.id
 
@@ -265,7 +265,7 @@ describe('Test users', function () {
       const user = users[0]
       expect(user.username).to.equal('root')
       expect(user.email).to.equal('admin1@example.com')
-      expect(user.displayNSFW).to.be.falsy
+      expect(user.displayNSFW).to.be.false
 
       done()
     })
@@ -285,7 +285,7 @@ describe('Test users', function () {
       const user = users[0]
       expect(user.username).to.equal('user_1')
       expect(user.email).to.equal('user_1@example.com')
-      expect(user.displayNSFW).to.be.falsy
+      expect(user.displayNSFW).to.be.false
 
       done()
     })
@@ -305,7 +305,7 @@ describe('Test users', function () {
       const user = users[0]
       expect(user.username).to.equal('user_1')
       expect(user.email).to.equal('user_1@example.com')
-      expect(user.displayNSFW).to.be.falsy
+      expect(user.displayNSFW).to.be.false
 
       done()
     })
@@ -324,11 +324,11 @@ describe('Test users', function () {
 
       expect(users[0].username).to.equal('root')
       expect(users[0].email).to.equal('admin1@example.com')
-      expect(users[0].displayNSFW).to.be.falsy
+      expect(users[0].displayNSFW).to.be.false
 
       expect(users[1].username).to.equal('user_1')
       expect(users[1].email).to.equal('user_1@example.com')
-      expect(users[1].displayNSFW).to.be.falsy
+      expect(users[1].displayNSFW).to.be.false
 
       done()
     })
@@ -354,7 +354,7 @@ describe('Test users', function () {
 
         expect(user.username).to.equal('user_1')
         expect(user.email).to.equal('user_1@example.com')
-        expect(user.displayNSFW).to.be.truthy
+        expect(user.displayNSFW).to.be.ok
         expect(user.id).to.exist
 
         done()