aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/search/search-index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/search/search-index.ts')
-rw-r--r--server/tests/api/search/search-index.ts24
1 files changed, 8 insertions, 16 deletions
diff --git a/server/tests/api/search/search-index.ts b/server/tests/api/search/search-index.ts
index e4c5f5796..306f84c3a 100644
--- a/server/tests/api/search/search-index.ts
+++ b/server/tests/api/search/search-index.ts
@@ -2,16 +2,8 @@
2 2
3import 'mocha' 3import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { 5import { cleanupTests, flushAndRunServer, SearchCommand, ServerInfo, setAccessTokensToServers, uploadVideo } from '@shared/extra-utils'
6 cleanupTests, 6import { BooleanBothQuery, VideoPlaylistPrivacy, VideoPlaylistType, VideosSearchQuery } from '@shared/models'
7 flushAndRunServer,
8 immutableAssign,
9 SearchCommand,
10 ServerInfo,
11 setAccessTokensToServers,
12 uploadVideo
13} from '@shared/extra-utils'
14import { VideoPlaylistPrivacy, VideoPlaylistType, VideosSearchQuery } from '@shared/models'
15 7
16const expect = chai.expect 8const expect = chai.expect
17 9
@@ -174,32 +166,32 @@ describe('Test videos search', function () {
174 } 166 }
175 167
176 { 168 {
177 const search = immutableAssign(baseSearch, { startDate: '2018-10-01T10:54:46.396Z' }) 169 const search = { ...baseSearch, startDate: '2018-10-01T10:54:46.396Z' }
178 await check(search, false) 170 await check(search, false)
179 } 171 }
180 172
181 { 173 {
182 const search = immutableAssign(baseSearch, { tagsAllOf: [ 'toto', 'framasoft' ] }) 174 const search = { ...baseSearch, tagsAllOf: [ 'toto', 'framasoft' ] }
183 await check(search, false) 175 await check(search, false)
184 } 176 }
185 177
186 { 178 {
187 const search = immutableAssign(baseSearch, { durationMin: 2000 }) 179 const search = { ...baseSearch, durationMin: 2000 }
188 await check(search, false) 180 await check(search, false)
189 } 181 }
190 182
191 { 183 {
192 const search = immutableAssign(baseSearch, { nsfw: 'true' }) 184 const search = { ...baseSearch, nsfw: 'true' as BooleanBothQuery }
193 await check(search, false) 185 await check(search, false)
194 } 186 }
195 187
196 { 188 {
197 const search = immutableAssign(baseSearch, { nsfw: 'false' }) 189 const search = { ...baseSearch, nsfw: 'false' as BooleanBothQuery }
198 await check(search, true) 190 await check(search, true)
199 } 191 }
200 192
201 { 193 {
202 const search = immutableAssign(baseSearch, { nsfw: 'both' }) 194 const search = { ...baseSearch, nsfw: 'both' as BooleanBothQuery }
203 await check(search, true) 195 await check(search, true)
204 } 196 }
205 }) 197 })