aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/plugins/video-constants.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-01-31 16:56:52 +0100
committerChocobozzz <me@florianbigard.com>2020-02-03 08:31:02 +0100
commita15871560f80e07386c1dabb8370cd2664ecfd1f (patch)
tree44440e140c9e43b0d7f97ade777a76e649e0553d /server/tests/plugins/video-constants.ts
parenta22046d166805222ca76060e471b6cb3d419a32d (diff)
downloadPeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.tar.gz
PeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.tar.zst
PeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.zip
Move to eslintcontain
Diffstat (limited to 'server/tests/plugins/video-constants.ts')
-rw-r--r--server/tests/plugins/video-constants.ts58
1 files changed, 20 insertions, 38 deletions
diff --git a/server/tests/plugins/video-constants.ts b/server/tests/plugins/video-constants.ts
index 6562e2b45..5374b5ecc 100644
--- a/server/tests/plugins/video-constants.ts
+++ b/server/tests/plugins/video-constants.ts
@@ -1,38 +1,20 @@
1/* tslint:disable:no-unused-expression */ 1/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
2 2
3import * as chai from 'chai' 3import * as chai from 'chai'
4import 'mocha' 4import 'mocha'
5import { cleanupTests, flushAndRunServer, ServerInfo } from '../../../shared/extra-utils/server/servers'
5import { 6import {
6 cleanupTests,
7 flushAndRunMultipleServers,
8 flushAndRunServer, killallServers, reRunServer,
9 ServerInfo,
10 waitUntilLog
11} from '../../../shared/extra-utils/server/servers'
12import {
13 addVideoCommentReply,
14 addVideoCommentThread,
15 deleteVideoComment,
16 getPluginTestPath, 7 getPluginTestPath,
17 getVideosList, 8 getVideo,
9 getVideoCategories,
10 getVideoLanguages,
11 getVideoLicences,
18 installPlugin, 12 installPlugin,
19 removeVideo,
20 setAccessTokensToServers, 13 setAccessTokensToServers,
21 updateVideo, 14 uninstallPlugin,
22 uploadVideo, 15 uploadVideo
23 viewVideo,
24 getVideosListPagination,
25 getVideo,
26 getVideoCommentThreads,
27 getVideoThreadComments,
28 getVideoWithToken,
29 setDefaultVideoChannel,
30 waitJobs,
31 doubleFollow, getVideoLanguages, getVideoLicences, getVideoCategories, uninstallPlugin
32} from '../../../shared/extra-utils' 16} from '../../../shared/extra-utils'
33import { VideoCommentThreadTree } from '../../../shared/models/videos/video-comment.model'
34import { VideoDetails } from '../../../shared/models/videos' 17import { VideoDetails } from '../../../shared/models/videos'
35import { getYoutubeVideoUrl, importVideo } from '../../../shared/extra-utils/videos/video-imports'
36 18
37const expect = chai.expect 19const expect = chai.expect
38 20
@@ -104,33 +86,33 @@ describe('Test plugin altering video constants', function () {
104 const res = await getVideoLanguages(server.url) 86 const res = await getVideoLanguages(server.url)
105 const languages = res.body 87 const languages = res.body
106 88
107 expect(languages[ 'en' ]).to.equal('English') 89 expect(languages['en']).to.equal('English')
108 expect(languages[ 'fr' ]).to.equal('French') 90 expect(languages['fr']).to.equal('French')
109 91
110 expect(languages[ 'al_bhed' ]).to.not.exist 92 expect(languages['al_bhed']).to.not.exist
111 expect(languages[ 'al_bhed2' ]).to.not.exist 93 expect(languages['al_bhed2']).to.not.exist
112 } 94 }
113 95
114 { 96 {
115 const res = await getVideoCategories(server.url) 97 const res = await getVideoCategories(server.url)
116 const categories = res.body 98 const categories = res.body
117 99
118 expect(categories[ 1 ]).to.equal('Music') 100 expect(categories[1]).to.equal('Music')
119 expect(categories[ 2 ]).to.equal('Films') 101 expect(categories[2]).to.equal('Films')
120 102
121 expect(categories[ 42 ]).to.not.exist 103 expect(categories[42]).to.not.exist
122 expect(categories[ 43 ]).to.not.exist 104 expect(categories[43]).to.not.exist
123 } 105 }
124 106
125 { 107 {
126 const res = await getVideoLicences(server.url) 108 const res = await getVideoLicences(server.url)
127 const licences = res.body 109 const licences = res.body
128 110
129 expect(licences[ 1 ]).to.equal('Attribution') 111 expect(licences[1]).to.equal('Attribution')
130 expect(licences[ 7 ]).to.equal('Public Domain Dedication') 112 expect(licences[7]).to.equal('Public Domain Dedication')
131 113
132 expect(licences[ 42 ]).to.not.exist 114 expect(licences[42]).to.not.exist
133 expect(licences[ 43 ]).to.not.exist 115 expect(licences[43]).to.not.exist
134 } 116 }
135 }) 117 })
136 118