X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fclient.ts;h=9a20c2a10361b29b52264b423d30e7993df04c57;hb=47d883de2efbc2e8b5f6f94ae18c15224cbe982b;hp=f41129895e63b631d242b1baeae5f4826c26eb34;hpb=c6d20c84a75c77f50e19afa93aa318ad92edba90;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/client.ts b/server/tests/client.ts index f41129895..9a20c2a10 100644 --- a/server/tests/client.ts +++ b/server/tests/client.ts @@ -1,9 +1,16 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ -import 'mocha' -import * as chai from 'chai' -import { omit } from 'lodash' -import { Account, HTMLServerConfig, HttpStatusCode, ServerConfig, VideoPlaylistCreateResult, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models' +import { expect } from 'chai' +import { omit } from '@shared/core-utils' +import { + Account, + HTMLServerConfig, + HttpStatusCode, + ServerConfig, + VideoPlaylistCreateResult, + VideoPlaylistPrivacy, + VideoPrivacy +} from '@shared/models' import { cleanupTests, createMultipleServers, @@ -16,14 +23,12 @@ import { waitJobs } from '../../shared/server-commands' -const expect = chai.expect - function checkIndexTags (html: string, title: string, description: string, css: string, config: ServerConfig) { expect(html).to.contain('' + title + '') expect(html).to.contain('') expect(html).to.contain('') - const htmlConfig: HTMLServerConfig = omit(config, 'signup') + const htmlConfig: HTMLServerConfig = omit(config, [ 'signup' ]) const configObjectString = JSON.stringify(htmlConfig) const configEscapedString = JSON.stringify(configObjectString) @@ -129,11 +134,9 @@ describe('Test a client controllers', function () { expectedStatus: HttpStatusCode.OK_200 }) - const port = servers[0].port - - const expectedLink = '` + const expectedLink = `` expect(res.text).to.contain(expectedLink) } @@ -150,10 +153,8 @@ describe('Test a client controllers', function () { expectedStatus: HttpStatusCode.OK_200 }) - const port = servers[0].port - - const expectedLink = '` expect(res.text).to.contain(expectedLink) @@ -224,6 +225,14 @@ describe('Test a client controllers', function () { } }) + it('Should have valid Open Graph tags on the watch page with thread id Angular param', async function () { + for (const path of watchVideoBasePaths) { + for (const id of videoIds) { + await watchVideoPageTest(path + id + ';threadId=1') + } + } + }) + it('Should have valid Open Graph tags on the watch playlist page', async function () { for (const path of watchPlaylistBasePaths) { for (const id of playlistIds) { @@ -522,23 +531,6 @@ describe('Test a client controllers', function () { expect(res.text).to.contain('') } }) - - it('Should add noindex meta tag for remote accounts', async function () { - const handle = 'root_channel@' + servers[0].host - const paths = [ '/video-channels/', '/c/', '/@' ] - - for (const path of paths) { - { - const { text } = await makeHTMLRequest(servers[1].url, path + handle) - expect(text).to.contain('') - } - - { - const { text } = await makeHTMLRequest(servers[0].url, path + handle) - expect(text).to.not.contain('') - } - } - }) }) describe('Embed HTML', function () {