diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-12-08 17:31:21 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-12-08 17:31:21 +0100 |
commit | f595d3947708114deeed4312cc5ffd285745b090 (patch) | |
tree | e2fef8fae4e9d9ee6039ea2ab53eb20d11002969 /server/tests/api/multiple-servers.ts | |
parent | e600e1fea275c12f4420e23624804617e61a082c (diff) | |
download | PeerTube-f595d3947708114deeed4312cc5ffd285745b090.tar.gz PeerTube-f595d3947708114deeed4312cc5ffd285745b090.tar.zst PeerTube-f595d3947708114deeed4312cc5ffd285745b090.zip |
Finish admin design
Diffstat (limited to 'server/tests/api/multiple-servers.ts')
-rw-r--r-- | server/tests/api/multiple-servers.ts | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/server/tests/api/multiple-servers.ts b/server/tests/api/multiple-servers.ts index c7f19f261..c9f74cc8c 100644 --- a/server/tests/api/multiple-servers.ts +++ b/server/tests/api/multiple-servers.ts | |||
@@ -2,6 +2,8 @@ | |||
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | 4 | import * as chai from 'chai' |
5 | import { join } from "path" | ||
6 | import * as request from 'supertest' | ||
5 | 7 | ||
6 | import { | 8 | import { |
7 | dateIsValid, | 9 | dateIsValid, |
@@ -707,6 +709,50 @@ describe('Test multiple servers', function () { | |||
707 | }) | 709 | }) |
708 | }) | 710 | }) |
709 | 711 | ||
712 | describe('With minimum parameters', function () { | ||
713 | it('Should upload and propagate the video', async function () { | ||
714 | this.timeout(50000) | ||
715 | |||
716 | const path = '/api/v1/videos/upload' | ||
717 | |||
718 | const req = request(servers[1].url) | ||
719 | .post(path) | ||
720 | .set('Accept', 'application/json') | ||
721 | .set('Authorization', 'Bearer ' + servers[1].accessToken) | ||
722 | .field('name', 'minimum parameters') | ||
723 | .field('privacy', '1') | ||
724 | .field('nsfw', 'false') | ||
725 | .field('channelId', '1') | ||
726 | |||
727 | const filePath = join(__dirname, '..', 'api', 'fixtures', 'video_short.webm') | ||
728 | |||
729 | await req.attach('videofile', filePath) | ||
730 | .expect(200) | ||
731 | |||
732 | await wait(25000) | ||
733 | |||
734 | for (const server of servers) { | ||
735 | const res = await getVideosList(server.url) | ||
736 | const video = res.body.data.find(v => v.name === 'minimum parameters') | ||
737 | |||
738 | expect(video.name).to.equal('minimum parameters') | ||
739 | expect(video.category).to.equal(null) | ||
740 | expect(video.categoryLabel).to.equal('Misc') | ||
741 | expect(video.licence).to.equal(null) | ||
742 | expect(video.licenceLabel).to.equal('Unknown') | ||
743 | expect(video.language).to.equal(null) | ||
744 | expect(video.languageLabel).to.equal('Unknown') | ||
745 | expect(video.nsfw).to.not.be.ok | ||
746 | expect(video.description).to.equal(null) | ||
747 | expect(video.serverHost).to.equal('localhost:9002') | ||
748 | expect(video.accountName).to.equal('root') | ||
749 | expect(video.tags).to.deep.equal([ ]) | ||
750 | expect(dateIsValid(video.createdAt)).to.be.true | ||
751 | expect(dateIsValid(video.updatedAt)).to.be.true | ||
752 | } | ||
753 | }) | ||
754 | }) | ||
755 | |||
710 | after(async function () { | 756 | after(async function () { |
711 | killallServers(servers) | 757 | killallServers(servers) |
712 | 758 | ||