aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-24 11:25:40 +0200
committerChocobozzz <me@florianbigard.com>2020-08-24 11:25:40 +0200
commitcf649c2ed918b3cc6bd4c92f38c7752174ac1e9a (patch)
tree11f3be3a12ee6f717d1e814e26fa802a8ac871bc /server/tests
parent5505981154195131f961beeba355cc1d173983f7 (diff)
downloadPeerTube-cf649c2ed918b3cc6bd4c92f38c7752174ac1e9a.tar.gz
PeerTube-cf649c2ed918b3cc6bd4c92f38c7752174ac1e9a.tar.zst
PeerTube-cf649c2ed918b3cc6bd4c92f38c7752174ac1e9a.zip
Inject plugin CSS in embed too
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/server/plugins.ts33
1 files changed, 26 insertions, 7 deletions
diff --git a/server/tests/api/server/plugins.ts b/server/tests/api/server/plugins.ts
index 9885be4e8..ad0a5139b 100644
--- a/server/tests/api/server/plugins.ts
+++ b/server/tests/api/server/plugins.ts
@@ -28,7 +28,8 @@ import {
28 updatePluginPackageJSON, 28 updatePluginPackageJSON,
29 updatePluginSettings, 29 updatePluginSettings,
30 wait, 30 wait,
31 waitUntilLog 31 waitUntilLog,
32 makeHTMLRequest
32} from '../../../../shared/extra-utils' 33} from '../../../../shared/extra-utils'
33import { PluginType } from '../../../../shared/models/plugins/plugin.type' 34import { PluginType } from '../../../../shared/models/plugins/plugin.type'
34import { PeerTubePluginIndex } from '../../../../shared/models/plugins/peertube-plugin-index.model' 35import { PeerTubePluginIndex } from '../../../../shared/models/plugins/peertube-plugin-index.model'
@@ -119,9 +120,15 @@ describe('Test plugins', function () {
119 }) 120 })
120 121
121 it('Should have an empty global css', async function () { 122 it('Should have an empty global css', async function () {
122 const res = await getPluginsCSS(server.url) 123 {
124 const res = await getPluginsCSS(server.url)
125 expect(res.text).to.be.empty
126 }
123 127
124 expect(res.text).to.be.empty 128 for (const path of [ '/', '/videos/embed/1', '/video-playlists/embed/1' ]) {
129 const res = await makeHTMLRequest(server.url, path)
130 expect(res.text).to.not.include('link rel="stylesheet" href="/plugins/global.css')
131 }
125 }) 132 })
126 133
127 it('Should install a plugin and a theme', async function () { 134 it('Should install a plugin and a theme', async function () {
@@ -141,9 +148,15 @@ describe('Test plugins', function () {
141 }) 148 })
142 149
143 it('Should have the correct global css', async function () { 150 it('Should have the correct global css', async function () {
144 const res = await getPluginsCSS(server.url) 151 {
152 const res = await getPluginsCSS(server.url)
153 expect(res.text).to.contain('background-color: red')
154 }
145 155
146 expect(res.text).to.contain('background-color: red') 156 for (const path of [ '/', '/videos/embed/1', '/video-playlists/embed/1' ]) {
157 const res = await makeHTMLRequest(server.url, path)
158 expect(res.text).to.include('link rel="stylesheet" href="/plugins/global.css')
159 }
147 }) 160 })
148 161
149 it('Should have the plugin loaded in the configuration', async function () { 162 it('Should have the plugin loaded in the configuration', async function () {
@@ -388,9 +401,15 @@ describe('Test plugins', function () {
388 }) 401 })
389 402
390 it('Should have an empty global css', async function () { 403 it('Should have an empty global css', async function () {
391 const res = await getPluginsCSS(server.url) 404 {
405 const res = await getPluginsCSS(server.url)
406 expect(res.text).to.be.empty
407 }
392 408
393 expect(res.text).to.be.empty 409 for (const path of [ '/', '/videos/embed/1', '/video-playlists/embed/1' ]) {
410 const res = await makeHTMLRequest(server.url, path)
411 expect(res.text).to.not.include('link rel="stylesheet" href="/plugins/global.css')
412 }
394 }) 413 })
395 414
396 it('Should list uninstalled plugins', async function () { 415 it('Should list uninstalled plugins', async function () {