diff options
Diffstat (limited to 'server/tests/api/multiple-pods.js')
-rw-r--r-- | server/tests/api/multiple-pods.js | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/server/tests/api/multiple-pods.js b/server/tests/api/multiple-pods.js index 552f10c6f..eccc9ecef 100644 --- a/server/tests/api/multiple-pods.js +++ b/server/tests/api/multiple-pods.js | |||
@@ -81,10 +81,11 @@ describe('Test multiple pods', function () { | |||
81 | series([ | 81 | series([ |
82 | function (next) { | 82 | function (next) { |
83 | const name = 'my super name for pod 1' | 83 | const name = 'my super name for pod 1' |
84 | const category = 5 | ||
84 | const description = 'my super description for pod 1' | 85 | const description = 'my super description for pod 1' |
85 | const tags = [ 'tag1p1', 'tag2p1' ] | 86 | const tags = [ 'tag1p1', 'tag2p1' ] |
86 | const file = 'video_short1.webm' | 87 | const file = 'video_short1.webm' |
87 | videosUtils.uploadVideo(servers[0].url, servers[0].accessToken, name, description, tags, file, next) | 88 | videosUtils.uploadVideo(servers[0].url, servers[0].accessToken, name, category, description, tags, file, next) |
88 | }, | 89 | }, |
89 | function (next) { | 90 | function (next) { |
90 | setTimeout(next, 11000) | 91 | setTimeout(next, 11000) |
@@ -104,6 +105,8 @@ describe('Test multiple pods', function () { | |||
104 | expect(videos.length).to.equal(1) | 105 | expect(videos.length).to.equal(1) |
105 | const video = videos[0] | 106 | const video = videos[0] |
106 | expect(video.name).to.equal('my super name for pod 1') | 107 | expect(video.name).to.equal('my super name for pod 1') |
108 | expect(video.category).to.equal(5) | ||
109 | expect(video.categoryLabel).to.equal('Sports') | ||
107 | expect(video.description).to.equal('my super description for pod 1') | 110 | expect(video.description).to.equal('my super description for pod 1') |
108 | expect(video.podHost).to.equal('localhost:9001') | 111 | expect(video.podHost).to.equal('localhost:9001') |
109 | expect(video.magnetUri).to.exist | 112 | expect(video.magnetUri).to.exist |
@@ -144,10 +147,11 @@ describe('Test multiple pods', function () { | |||
144 | series([ | 147 | series([ |
145 | function (next) { | 148 | function (next) { |
146 | const name = 'my super name for pod 2' | 149 | const name = 'my super name for pod 2' |
150 | const category = 4 | ||
147 | const description = 'my super description for pod 2' | 151 | const description = 'my super description for pod 2' |
148 | const tags = [ 'tag1p2', 'tag2p2', 'tag3p2' ] | 152 | const tags = [ 'tag1p2', 'tag2p2', 'tag3p2' ] |
149 | const file = 'video_short2.webm' | 153 | const file = 'video_short2.webm' |
150 | videosUtils.uploadVideo(servers[1].url, servers[1].accessToken, name, description, tags, file, next) | 154 | videosUtils.uploadVideo(servers[1].url, servers[1].accessToken, name, category, description, tags, file, next) |
151 | }, | 155 | }, |
152 | function (next) { | 156 | function (next) { |
153 | setTimeout(next, 11000) | 157 | setTimeout(next, 11000) |
@@ -167,6 +171,8 @@ describe('Test multiple pods', function () { | |||
167 | expect(videos.length).to.equal(2) | 171 | expect(videos.length).to.equal(2) |
168 | const video = videos[1] | 172 | const video = videos[1] |
169 | expect(video.name).to.equal('my super name for pod 2') | 173 | expect(video.name).to.equal('my super name for pod 2') |
174 | expect(video.category).to.equal(4) | ||
175 | expect(video.categoryLabel).to.equal('Art') | ||
170 | expect(video.description).to.equal('my super description for pod 2') | 176 | expect(video.description).to.equal('my super description for pod 2') |
171 | expect(video.podHost).to.equal('localhost:9002') | 177 | expect(video.podHost).to.equal('localhost:9002') |
172 | expect(video.magnetUri).to.exist | 178 | expect(video.magnetUri).to.exist |
@@ -207,17 +213,19 @@ describe('Test multiple pods', function () { | |||
207 | series([ | 213 | series([ |
208 | function (next) { | 214 | function (next) { |
209 | const name = 'my super name for pod 3' | 215 | const name = 'my super name for pod 3' |
216 | const category = 6 | ||
210 | const description = 'my super description for pod 3' | 217 | const description = 'my super description for pod 3' |
211 | const tags = [ 'tag1p3' ] | 218 | const tags = [ 'tag1p3' ] |
212 | const file = 'video_short3.webm' | 219 | const file = 'video_short3.webm' |
213 | videosUtils.uploadVideo(servers[2].url, servers[2].accessToken, name, description, tags, file, next) | 220 | videosUtils.uploadVideo(servers[2].url, servers[2].accessToken, name, category, description, tags, file, next) |
214 | }, | 221 | }, |
215 | function (next) { | 222 | function (next) { |
216 | const name = 'my super name for pod 3-2' | 223 | const name = 'my super name for pod 3-2' |
224 | const category = 7 | ||
217 | const description = 'my super description for pod 3-2' | 225 | const description = 'my super description for pod 3-2' |
218 | const tags = [ 'tag2p3', 'tag3p3', 'tag4p3' ] | 226 | const tags = [ 'tag2p3', 'tag3p3', 'tag4p3' ] |
219 | const file = 'video_short.webm' | 227 | const file = 'video_short.webm' |
220 | videosUtils.uploadVideo(servers[2].url, servers[2].accessToken, name, description, tags, file, next) | 228 | videosUtils.uploadVideo(servers[2].url, servers[2].accessToken, name, category, description, tags, file, next) |
221 | }, | 229 | }, |
222 | function (next) { | 230 | function (next) { |
223 | setTimeout(next, 22000) | 231 | setTimeout(next, 22000) |
@@ -247,6 +255,8 @@ describe('Test multiple pods', function () { | |||
247 | } | 255 | } |
248 | 256 | ||
249 | expect(video1.name).to.equal('my super name for pod 3') | 257 | expect(video1.name).to.equal('my super name for pod 3') |
258 | expect(video1.category).to.equal(6) | ||
259 | expect(video1.categoryLabel).to.equal('Travels') | ||
250 | expect(video1.description).to.equal('my super description for pod 3') | 260 | expect(video1.description).to.equal('my super description for pod 3') |
251 | expect(video1.podHost).to.equal('localhost:9003') | 261 | expect(video1.podHost).to.equal('localhost:9003') |
252 | expect(video1.magnetUri).to.exist | 262 | expect(video1.magnetUri).to.exist |
@@ -257,6 +267,8 @@ describe('Test multiple pods', function () { | |||
257 | expect(miscsUtils.dateIsValid(video1.updatedAt)).to.be.true | 267 | expect(miscsUtils.dateIsValid(video1.updatedAt)).to.be.true |
258 | 268 | ||
259 | expect(video2.name).to.equal('my super name for pod 3-2') | 269 | expect(video2.name).to.equal('my super name for pod 3-2') |
270 | expect(video2.category).to.equal(7) | ||
271 | expect(video2.categoryLabel).to.equal('Gaming') | ||
260 | expect(video2.description).to.equal('my super description for pod 3-2') | 272 | expect(video2.description).to.equal('my super description for pod 3-2') |
261 | expect(video2.podHost).to.equal('localhost:9003') | 273 | expect(video2.podHost).to.equal('localhost:9003') |
262 | expect(video2.magnetUri).to.exist | 274 | expect(video2.magnetUri).to.exist |
@@ -603,10 +615,11 @@ describe('Test multiple pods', function () { | |||
603 | this.timeout(15000) | 615 | this.timeout(15000) |
604 | 616 | ||
605 | const name = 'my super video updated' | 617 | const name = 'my super video updated' |
618 | const category = 10 | ||
606 | const description = 'my super description updated' | 619 | const description = 'my super description updated' |
607 | const tags = [ 'tagup1', 'tagup2' ] | 620 | const tags = [ 'tagup1', 'tagup2' ] |
608 | 621 | ||
609 | videosUtils.updateVideo(servers[2].url, servers[2].accessToken, toRemove[0].id, name, description, tags, function (err) { | 622 | videosUtils.updateVideo(servers[2].url, servers[2].accessToken, toRemove[0].id, name, category, description, tags, function (err) { |
610 | if (err) throw err | 623 | if (err) throw err |
611 | 624 | ||
612 | setTimeout(done, 11000) | 625 | setTimeout(done, 11000) |
@@ -629,6 +642,8 @@ describe('Test multiple pods', function () { | |||
629 | }) | 642 | }) |
630 | 643 | ||
631 | expect(!!videoUpdated).to.be.true | 644 | expect(!!videoUpdated).to.be.true |
645 | expect(videoUpdated.category).to.equal(10) | ||
646 | expect(videoUpdated.categoryLabel).to.equal('Entertainment') | ||
632 | expect(videoUpdated.description).to.equal('my super description updated') | 647 | expect(videoUpdated.description).to.equal('my super description updated') |
633 | expect(videoUpdated.tags).to.deep.equal([ 'tagup1', 'tagup2' ]) | 648 | expect(videoUpdated.tags).to.deep.equal([ 'tagup1', 'tagup2' ]) |
634 | expect(miscsUtils.dateIsValid(videoUpdated.updatedAt, 20000)).to.be.true | 649 | expect(miscsUtils.dateIsValid(videoUpdated.updatedAt, 20000)).to.be.true |