]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/api/search/search-index.ts
Allow admins to disable two factor auth
[github/Chocobozzz/PeerTube.git] / server / tests / api / search / search-index.ts
index ae933449faea87568fa61a9bad22de8c9d00abae..c61ac441da0f05a4d79aa96971378f69f1532a78 100644 (file)
@@ -1,8 +1,6 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
-import * as chai from 'chai'
-import { cleanupTests, createSingleServer, PeerTubeServer, SearchCommand, setAccessTokensToServers } from '@shared/server-commands'
+import { expect } from 'chai'
 import {
   BooleanBothQuery,
   VideoChannelsSearchQuery,
@@ -11,8 +9,7 @@ import {
   VideoPlaylistType,
   VideosSearchQuery
 } from '@shared/models'
-
-const expect = chai.expect
+import { cleanupTests, createSingleServer, PeerTubeServer, SearchCommand, setAccessTokensToServers } from '@shared/server-commands'
 
 describe('Test index search', function () {
   const localVideoName = 'local video' + new Date().toISOString()
@@ -136,14 +133,14 @@ describe('Test index search', function () {
       expect(video.account.url).to.equal('https://framatube.org/accounts/framasoft')
       // TODO: remove, deprecated in 4.2
       expect(video.account.avatar).to.exist
-      expect(video.account.avatars.length).to.equal(1, 'Account should have one avatar image')
+      expect(video.account.avatars.length).to.equal(2, 'Account should have one avatar image')
 
       expect(video.channel.host).to.equal('framatube.org')
       expect(video.channel.name).to.equal('joinpeertube')
       expect(video.channel.url).to.equal('https://framatube.org/video-channels/joinpeertube')
       // TODO: remove, deprecated in 4.2
       expect(video.channel.avatar).to.exist
-      expect(video.channel.avatars.length).to.equal(1, 'Channel should have one avatar image')
+      expect(video.channel.avatars.length).to.equal(2, 'Channel should have one avatar image')
     }
 
     const baseSearch: VideosSearchQuery = {
@@ -322,7 +319,7 @@ describe('Test index search', function () {
       expect(videoChannel.host).to.equal('framatube.org')
       // TODO: remove, deprecated in 4.2
       expect(videoChannel.avatar).to.exist
-      expect(videoChannel.avatars.length).to.equal(1, 'Channel should have two avatar images')
+      expect(videoChannel.avatars.length).to.equal(2, 'Channel should have two avatar images')
       expect(videoChannel.displayName).to.exist
 
       expect(videoChannel.ownerAccount.url).to.equal('https://framatube.org/accounts/framasoft')
@@ -330,7 +327,7 @@ describe('Test index search', function () {
       expect(videoChannel.ownerAccount.host).to.equal('framatube.org')
       // TODO: remove, deprecated in 4.2
       expect(videoChannel.ownerAccount.avatar).to.exist
-      expect(videoChannel.ownerAccount.avatars.length).to.equal(1, 'Account should have two avatar images')
+      expect(videoChannel.ownerAccount.avatars.length).to.equal(2, 'Account should have two avatar images')
     }
 
     it('Should make a simple search and not have results', async function () {
@@ -345,8 +342,8 @@ describe('Test index search', function () {
     })
 
     it('Should make host search and have appropriate results', async function () {
-      await check({ search: 'Framasoft', host: 'example.com' }, false)
-      await check({ search: 'Framasoft', host: 'framatube.org' }, true)
+      await check({ search: 'Framasoft videos', host: 'example.com' }, false)
+      await check({ search: 'Framasoft videos', host: 'framatube.org' }, true)
     })
 
     it('Should make handles search and have appropriate results', async function () {
@@ -398,14 +395,14 @@ describe('Test index search', function () {
       expect(videoPlaylist.ownerAccount.host).to.equal('peertube2.cpy.re')
       // TODO: remove, deprecated in 4.2
       expect(videoPlaylist.ownerAccount.avatar).to.exist
-      expect(videoPlaylist.ownerAccount.avatars.length).to.equal(1, 'Account should have two avatar images')
+      expect(videoPlaylist.ownerAccount.avatars.length).to.equal(2, 'Account should have two avatar images')
 
       expect(videoPlaylist.videoChannel.url).to.equal('https://peertube2.cpy.re/video-channels/chocobozzz_channel')
       expect(videoPlaylist.videoChannel.name).to.equal('chocobozzz_channel')
       expect(videoPlaylist.videoChannel.host).to.equal('peertube2.cpy.re')
       // TODO: remove, deprecated in 4.2
       expect(videoPlaylist.videoChannel.avatar).to.exist
-      expect(videoPlaylist.videoChannel.avatars.length).to.equal(1, 'Channel should have two avatar images')
+      expect(videoPlaylist.videoChannel.avatars.length).to.equal(2, 'Channel should have two avatar images')
     }
 
     it('Should make a simple search and not have results', async function () {