aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos/multiple-servers.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/videos/multiple-servers.ts')
-rw-r--r--server/tests/api/videos/multiple-servers.ts34
1 files changed, 17 insertions, 17 deletions
diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts
index 2ad749fd4..ff730287a 100644
--- a/server/tests/api/videos/multiple-servers.ts
+++ b/server/tests/api/videos/multiple-servers.ts
@@ -105,7 +105,7 @@ describe('Test multiple servers', function () {
105 originallyPublishedAt: '2019-02-10T13:38:14.449Z', 105 originallyPublishedAt: '2019-02-10T13:38:14.449Z',
106 account: { 106 account: {
107 name: 'root', 107 name: 'root',
108 host: 'localhost:' + servers[0].port 108 host: servers[0].host
109 }, 109 },
110 isLocal, 110 isLocal,
111 publishedAt, 111 publishedAt,
@@ -185,7 +185,7 @@ describe('Test multiple servers', function () {
185 185
186 // All servers should have this video 186 // All servers should have this video
187 for (const server of servers) { 187 for (const server of servers) {
188 const isLocal = server.url === 'http://localhost:' + servers[1].port 188 const isLocal = server.url === servers[1].url
189 const checkAttributes = { 189 const checkAttributes = {
190 name: 'my super name for server 2', 190 name: 'my super name for server 2',
191 category: 4, 191 category: 4,
@@ -196,7 +196,7 @@ describe('Test multiple servers', function () {
196 support: 'my super support text for server 2', 196 support: 'my super support text for server 2',
197 account: { 197 account: {
198 name: 'user1', 198 name: 'user1',
199 host: 'localhost:' + servers[1].port 199 host: servers[1].host
200 }, 200 },
201 isLocal, 201 isLocal,
202 commentsEnabled: true, 202 commentsEnabled: true,
@@ -279,7 +279,7 @@ describe('Test multiple servers', function () {
279 279
280 // All servers should have this video 280 // All servers should have this video
281 for (const server of servers) { 281 for (const server of servers) {
282 const isLocal = server.url === 'http://localhost:' + servers[2].port 282 const isLocal = server.url === servers[2].url
283 const { data } = await server.videos.list() 283 const { data } = await server.videos.list()
284 284
285 expect(data).to.be.an('array') 285 expect(data).to.be.an('array')
@@ -306,7 +306,7 @@ describe('Test multiple servers', function () {
306 support: 'my super support text for server 3', 306 support: 'my super support text for server 3',
307 account: { 307 account: {
308 name: 'root', 308 name: 'root',
309 host: 'localhost:' + servers[2].port 309 host: servers[2].host
310 }, 310 },
311 isLocal, 311 isLocal,
312 duration: 5, 312 duration: 5,
@@ -340,7 +340,7 @@ describe('Test multiple servers', function () {
340 support: 'my super support text for server 3-2', 340 support: 'my super support text for server 3-2',
341 account: { 341 account: {
342 name: 'root', 342 name: 'root',
343 host: 'localhost:' + servers[2].port 343 host: servers[2].host
344 }, 344 },
345 commentsEnabled: true, 345 commentsEnabled: true,
346 downloadEnabled: true, 346 downloadEnabled: true,
@@ -649,7 +649,7 @@ describe('Test multiple servers', function () {
649 649
650 expect(new Date(videoUpdated.updatedAt)).to.be.greaterThan(updatedAtMin) 650 expect(new Date(videoUpdated.updatedAt)).to.be.greaterThan(updatedAtMin)
651 651
652 const isLocal = server.url === 'http://localhost:' + servers[2].port 652 const isLocal = server.url === servers[2].url
653 const checkAttributes = { 653 const checkAttributes = {
654 name: 'my super video updated', 654 name: 'my super video updated',
655 category: 10, 655 category: 10,
@@ -661,7 +661,7 @@ describe('Test multiple servers', function () {
661 originallyPublishedAt: '2019-02-11T13:38:14.449Z', 661 originallyPublishedAt: '2019-02-11T13:38:14.449Z',
662 account: { 662 account: {
663 name: 'root', 663 name: 'root',
664 host: 'localhost:' + servers[2].port 664 host: servers[2].host
665 }, 665 },
666 isLocal, 666 isLocal,
667 duration: 5, 667 duration: 5,
@@ -830,7 +830,7 @@ describe('Test multiple servers', function () {
830 expect(comment).to.not.be.undefined 830 expect(comment).to.not.be.undefined
831 expect(comment.inReplyToCommentId).to.be.null 831 expect(comment.inReplyToCommentId).to.be.null
832 expect(comment.account.name).to.equal('root') 832 expect(comment.account.name).to.equal('root')
833 expect(comment.account.host).to.equal('localhost:' + servers[0].port) 833 expect(comment.account.host).to.equal(servers[0].host)
834 expect(comment.totalReplies).to.equal(3) 834 expect(comment.totalReplies).to.equal(3)
835 expect(dateIsValid(comment.createdAt as string)).to.be.true 835 expect(dateIsValid(comment.createdAt as string)).to.be.true
836 expect(dateIsValid(comment.updatedAt as string)).to.be.true 836 expect(dateIsValid(comment.updatedAt as string)).to.be.true
@@ -841,7 +841,7 @@ describe('Test multiple servers', function () {
841 expect(comment).to.not.be.undefined 841 expect(comment).to.not.be.undefined
842 expect(comment.inReplyToCommentId).to.be.null 842 expect(comment.inReplyToCommentId).to.be.null
843 expect(comment.account.name).to.equal('root') 843 expect(comment.account.name).to.equal('root')
844 expect(comment.account.host).to.equal('localhost:' + servers[2].port) 844 expect(comment.account.host).to.equal(servers[2].host)
845 expect(comment.totalReplies).to.equal(0) 845 expect(comment.totalReplies).to.equal(0)
846 expect(dateIsValid(comment.createdAt as string)).to.be.true 846 expect(dateIsValid(comment.createdAt as string)).to.be.true
847 expect(dateIsValid(comment.updatedAt as string)).to.be.true 847 expect(dateIsValid(comment.updatedAt as string)).to.be.true
@@ -858,25 +858,25 @@ describe('Test multiple servers', function () {
858 858
859 expect(tree.comment.text).equal('my super first comment') 859 expect(tree.comment.text).equal('my super first comment')
860 expect(tree.comment.account.name).equal('root') 860 expect(tree.comment.account.name).equal('root')
861 expect(tree.comment.account.host).equal('localhost:' + servers[0].port) 861 expect(tree.comment.account.host).equal(servers[0].host)
862 expect(tree.children).to.have.lengthOf(2) 862 expect(tree.children).to.have.lengthOf(2)
863 863
864 const firstChild = tree.children[0] 864 const firstChild = tree.children[0]
865 expect(firstChild.comment.text).to.equal('my super answer to thread 1') 865 expect(firstChild.comment.text).to.equal('my super answer to thread 1')
866 expect(firstChild.comment.account.name).equal('root') 866 expect(firstChild.comment.account.name).equal('root')
867 expect(firstChild.comment.account.host).equal('localhost:' + servers[1].port) 867 expect(firstChild.comment.account.host).equal(servers[1].host)
868 expect(firstChild.children).to.have.lengthOf(1) 868 expect(firstChild.children).to.have.lengthOf(1)
869 869
870 childOfFirstChild = firstChild.children[0] 870 childOfFirstChild = firstChild.children[0]
871 expect(childOfFirstChild.comment.text).to.equal('my super answer to answer of thread 1') 871 expect(childOfFirstChild.comment.text).to.equal('my super answer to answer of thread 1')
872 expect(childOfFirstChild.comment.account.name).equal('root') 872 expect(childOfFirstChild.comment.account.name).equal('root')
873 expect(childOfFirstChild.comment.account.host).equal('localhost:' + servers[2].port) 873 expect(childOfFirstChild.comment.account.host).equal(servers[2].host)
874 expect(childOfFirstChild.children).to.have.lengthOf(0) 874 expect(childOfFirstChild.children).to.have.lengthOf(0)
875 875
876 const secondChild = tree.children[1] 876 const secondChild = tree.children[1]
877 expect(secondChild.comment.text).to.equal('my second answer to thread 1') 877 expect(secondChild.comment.text).to.equal('my second answer to thread 1')
878 expect(secondChild.comment.account.name).equal('root') 878 expect(secondChild.comment.account.name).equal('root')
879 expect(secondChild.comment.account.host).equal('localhost:' + servers[2].port) 879 expect(secondChild.comment.account.host).equal(servers[2].host)
880 expect(secondChild.children).to.have.lengthOf(0) 880 expect(secondChild.children).to.have.lengthOf(0)
881 } 881 }
882 }) 882 })
@@ -935,7 +935,7 @@ describe('Test multiple servers', function () {
935 expect(comment).to.not.be.undefined 935 expect(comment).to.not.be.undefined
936 expect(comment.inReplyToCommentId).to.be.null 936 expect(comment.inReplyToCommentId).to.be.null
937 expect(comment.account.name).to.equal('root') 937 expect(comment.account.name).to.equal('root')
938 expect(comment.account.host).to.equal('localhost:' + servers[2].port) 938 expect(comment.account.host).to.equal(servers[2].host)
939 expect(comment.totalReplies).to.equal(0) 939 expect(comment.totalReplies).to.equal(0)
940 expect(dateIsValid(comment.createdAt as string)).to.be.true 940 expect(dateIsValid(comment.createdAt as string)).to.be.true
941 expect(dateIsValid(comment.updatedAt as string)).to.be.true 941 expect(dateIsValid(comment.updatedAt as string)).to.be.true
@@ -1042,7 +1042,7 @@ describe('Test multiple servers', function () {
1042 const { data } = await server.videos.list() 1042 const { data } = await server.videos.list()
1043 const video = data.find(v => v.name === 'minimum parameters') 1043 const video = data.find(v => v.name === 'minimum parameters')
1044 1044
1045 const isLocal = server.url === 'http://localhost:' + servers[1].port 1045 const isLocal = server.url === servers[1].url
1046 const checkAttributes = { 1046 const checkAttributes = {
1047 name: 'minimum parameters', 1047 name: 'minimum parameters',
1048 category: null, 1048 category: null,
@@ -1053,7 +1053,7 @@ describe('Test multiple servers', function () {
1053 support: null, 1053 support: null,
1054 account: { 1054 account: {
1055 name: 'root', 1055 name: 'root',
1056 host: 'localhost:' + servers[1].port 1056 host: servers[1].host
1057 }, 1057 },
1058 isLocal, 1058 isLocal,
1059 duration: 5, 1059 duration: 5,