diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-03 10:12:36 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-03 10:38:19 +0100 |
commit | 47564bbe2eeb2baae9b7e3f9b2b8d16522bc7e04 (patch) | |
tree | 25e2836baf3dfce6f422192d98332db1bfe65890 /server/tests/api/videos/multiple-servers.ts | |
parent | c5911fd347c76e8bdc05ea9f3ee9efed4a58c236 (diff) | |
download | PeerTube-47564bbe2eeb2baae9b7e3f9b2b8d16522bc7e04.tar.gz PeerTube-47564bbe2eeb2baae9b7e3f9b2b8d16522bc7e04.tar.zst PeerTube-47564bbe2eeb2baae9b7e3f9b2b8d16522bc7e04.zip |
Add ability to disable video comments
Diffstat (limited to 'server/tests/api/videos/multiple-servers.ts')
-rw-r--r-- | server/tests/api/videos/multiple-servers.ts | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/server/tests/api/videos/multiple-servers.ts b/server/tests/api/videos/multiple-servers.ts index abd051a30..b6dfe0d1b 100644 --- a/server/tests/api/videos/multiple-servers.ts +++ b/server/tests/api/videos/multiple-servers.ts | |||
@@ -93,6 +93,7 @@ describe('Test multiple servers', function () { | |||
93 | duration: 10, | 93 | duration: 10, |
94 | tags: [ 'tag1p1', 'tag2p1' ], | 94 | tags: [ 'tag1p1', 'tag2p1' ], |
95 | privacy: VideoPrivacy.PUBLIC, | 95 | privacy: VideoPrivacy.PUBLIC, |
96 | commentsEnabled: true, | ||
96 | channel: { | 97 | channel: { |
97 | name: 'my channel', | 98 | name: 'my channel', |
98 | description: 'super channel', | 99 | description: 'super channel', |
@@ -155,6 +156,7 @@ describe('Test multiple servers', function () { | |||
155 | host: 'localhost:9002', | 156 | host: 'localhost:9002', |
156 | account: 'user1', | 157 | account: 'user1', |
157 | isLocal, | 158 | isLocal, |
159 | commentsEnabled: true, | ||
158 | duration: 5, | 160 | duration: 5, |
159 | tags: [ 'tag1p2', 'tag2p2', 'tag3p2' ], | 161 | tags: [ 'tag1p2', 'tag2p2', 'tag3p2' ], |
160 | privacy: VideoPrivacy.PUBLIC, | 162 | privacy: VideoPrivacy.PUBLIC, |
@@ -254,6 +256,7 @@ describe('Test multiple servers', function () { | |||
254 | account: 'root', | 256 | account: 'root', |
255 | isLocal, | 257 | isLocal, |
256 | duration: 5, | 258 | duration: 5, |
259 | commentsEnabled: true, | ||
257 | tags: [ 'tag1p3' ], | 260 | tags: [ 'tag1p3' ], |
258 | privacy: VideoPrivacy.PUBLIC, | 261 | privacy: VideoPrivacy.PUBLIC, |
259 | channel: { | 262 | channel: { |
@@ -280,6 +283,7 @@ describe('Test multiple servers', function () { | |||
280 | description: 'my super description for server 3-2', | 283 | description: 'my super description for server 3-2', |
281 | host: 'localhost:9003', | 284 | host: 'localhost:9003', |
282 | account: 'root', | 285 | account: 'root', |
286 | commentsEnabled: true, | ||
283 | isLocal, | 287 | isLocal, |
284 | duration: 5, | 288 | duration: 5, |
285 | tags: [ 'tag2p3', 'tag3p3', 'tag4p3' ], | 289 | tags: [ 'tag2p3', 'tag3p3', 'tag4p3' ], |
@@ -545,6 +549,7 @@ describe('Test multiple servers', function () { | |||
545 | account: 'root', | 549 | account: 'root', |
546 | isLocal, | 550 | isLocal, |
547 | duration: 5, | 551 | duration: 5, |
552 | commentsEnabled: true, | ||
548 | tags: [ 'tag_up_1', 'tag_up_2' ], | 553 | tags: [ 'tag_up_1', 'tag_up_2' ], |
549 | privacy: VideoPrivacy.PUBLIC, | 554 | privacy: VideoPrivacy.PUBLIC, |
550 | channel: { | 555 | channel: { |
@@ -732,6 +737,26 @@ describe('Test multiple servers', function () { | |||
732 | expect(secondChild.children).to.have.lengthOf(0) | 737 | expect(secondChild.children).to.have.lengthOf(0) |
733 | } | 738 | } |
734 | }) | 739 | }) |
740 | |||
741 | it('Should disable comments', async function () { | ||
742 | this.timeout(20000) | ||
743 | |||
744 | const attributes = { | ||
745 | commentsEnabled: false | ||
746 | } | ||
747 | |||
748 | await updateVideo(servers[0].url, servers[0].accessToken, videoUUID, attributes) | ||
749 | |||
750 | await wait(5000) | ||
751 | |||
752 | for (const server of servers) { | ||
753 | const res = await getVideo(server.url, videoUUID) | ||
754 | expect(res.body.commentsEnabled).to.be.false | ||
755 | |||
756 | const text = 'my super forbidden comment' | ||
757 | await addVideoCommentThread(server.url, server.accessToken, videoUUID, text, 409) | ||
758 | } | ||
759 | }) | ||
735 | }) | 760 | }) |
736 | 761 | ||
737 | describe('With minimum parameters', function () { | 762 | describe('With minimum parameters', function () { |
@@ -748,6 +773,7 @@ describe('Test multiple servers', function () { | |||
748 | .field('privacy', '1') | 773 | .field('privacy', '1') |
749 | .field('nsfw', 'false') | 774 | .field('nsfw', 'false') |
750 | .field('channelId', '1') | 775 | .field('channelId', '1') |
776 | .field('commentsEnabled', 'true') | ||
751 | 777 | ||
752 | const filePath = join(__dirname, '..', '..', 'api', 'fixtures', 'video_short.webm') | 778 | const filePath = join(__dirname, '..', '..', 'api', 'fixtures', 'video_short.webm') |
753 | 779 | ||
@@ -772,6 +798,7 @@ describe('Test multiple servers', function () { | |||
772 | account: 'root', | 798 | account: 'root', |
773 | isLocal, | 799 | isLocal, |
774 | duration: 5, | 800 | duration: 5, |
801 | commentsEnabled: true, | ||
775 | tags: [ ], | 802 | tags: [ ], |
776 | privacy: VideoPrivacy.PUBLIC, | 803 | privacy: VideoPrivacy.PUBLIC, |
777 | channel: { | 804 | channel: { |