From 65e6e2602c0d5521f3a6740f7469bb92830ecb53 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 7 Jul 2021 11:51:09 +0200 Subject: Introduce config command --- server/tests/api/check-params/search.ts | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'server/tests/api/check-params/search.ts') diff --git a/server/tests/api/check-params/search.ts b/server/tests/api/check-params/search.ts index 20ad46cff..4a2fc1197 100644 --- a/server/tests/api/check-params/search.ts +++ b/server/tests/api/check-params/search.ts @@ -1,28 +1,27 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import 'mocha' +import { HttpStatusCode } from '@shared/core-utils' import { + checkBadCountPagination, + checkBadSortPagination, + checkBadStartPagination, cleanupTests, flushAndRunServer, immutableAssign, makeGetRequest, ServerInfo, - updateCustomSubConfig, setAccessTokensToServers -} from '../../../../shared/extra-utils' -import { - checkBadCountPagination, - checkBadSortPagination, - checkBadStartPagination -} from '../../../../shared/extra-utils/requests/check-api-params' -import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' +} from '@shared/extra-utils' function updateSearchIndex (server: ServerInfo, enabled: boolean, disableLocalSearch = false) { - return updateCustomSubConfig(server.url, server.accessToken, { - search: { - searchIndex: { - enabled, - disableLocalSearch + return server.configCommand.updateCustomSubConfig({ + newConfig: { + search: { + searchIndex: { + enabled, + disableLocalSearch + } } } }) -- cgit v1.2.3 From 6c5065a011b099618681a37bd77eaa7bd3db752e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 13 Jul 2021 09:43:59 +0200 Subject: Introduce server commands --- server/tests/api/check-params/search.ts | 55 ++++++++++++++++----------------- 1 file changed, 27 insertions(+), 28 deletions(-) (limited to 'server/tests/api/check-params/search.ts') diff --git a/server/tests/api/check-params/search.ts b/server/tests/api/check-params/search.ts index 4a2fc1197..7973c112f 100644 --- a/server/tests/api/check-params/search.ts +++ b/server/tests/api/check-params/search.ts @@ -8,7 +8,6 @@ import { checkBadStartPagination, cleanupTests, flushAndRunServer, - immutableAssign, makeGetRequest, ServerInfo, setAccessTokensToServers @@ -63,78 +62,78 @@ describe('Test videos API validator', function () { }) it('Should fail with an invalid category', async function () { - const customQuery1 = immutableAssign(query, { categoryOneOf: [ 'aa', 'b' ] }) + const customQuery1 = { ...query, categoryOneOf: [ 'aa', 'b' ] } await makeGetRequest({ url: server.url, path, query: customQuery1, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) - const customQuery2 = immutableAssign(query, { categoryOneOf: 'a' }) + const customQuery2 = { ...query, categoryOneOf: 'a' } await makeGetRequest({ url: server.url, path, query: customQuery2, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) }) it('Should succeed with a valid category', async function () { - const customQuery1 = immutableAssign(query, { categoryOneOf: [ 1, 7 ] }) + const customQuery1 = { ...query, categoryOneOf: [ 1, 7 ] } await makeGetRequest({ url: server.url, path, query: customQuery1, statusCodeExpected: HttpStatusCode.OK_200 }) - const customQuery2 = immutableAssign(query, { categoryOneOf: 1 }) + const customQuery2 = { ...query, categoryOneOf: 1 } await makeGetRequest({ url: server.url, path, query: customQuery2, statusCodeExpected: HttpStatusCode.OK_200 }) }) it('Should fail with an invalid licence', async function () { - const customQuery1 = immutableAssign(query, { licenceOneOf: [ 'aa', 'b' ] }) + const customQuery1 = { ...query, licenceOneOf: [ 'aa', 'b' ] } await makeGetRequest({ url: server.url, path, query: customQuery1, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) - const customQuery2 = immutableAssign(query, { licenceOneOf: 'a' }) + const customQuery2 = { ...query, licenceOneOf: 'a' } await makeGetRequest({ url: server.url, path, query: customQuery2, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) }) it('Should succeed with a valid licence', async function () { - const customQuery1 = immutableAssign(query, { licenceOneOf: [ 1, 2 ] }) + const customQuery1 = { ...query, licenceOneOf: [ 1, 2 ] } await makeGetRequest({ url: server.url, path, query: customQuery1, statusCodeExpected: HttpStatusCode.OK_200 }) - const customQuery2 = immutableAssign(query, { licenceOneOf: 1 }) + const customQuery2 = { ...query, licenceOneOf: 1 } await makeGetRequest({ url: server.url, path, query: customQuery2, statusCodeExpected: HttpStatusCode.OK_200 }) }) it('Should succeed with a valid language', async function () { - const customQuery1 = immutableAssign(query, { languageOneOf: [ 'fr', 'en' ] }) + const customQuery1 = { ...query, languageOneOf: [ 'fr', 'en' ] } await makeGetRequest({ url: server.url, path, query: customQuery1, statusCodeExpected: HttpStatusCode.OK_200 }) - const customQuery2 = immutableAssign(query, { languageOneOf: 'fr' }) + const customQuery2 = { ...query, languageOneOf: 'fr' } await makeGetRequest({ url: server.url, path, query: customQuery2, statusCodeExpected: HttpStatusCode.OK_200 }) }) it('Should succeed with valid tags', async function () { - const customQuery1 = immutableAssign(query, { tagsOneOf: [ 'tag1', 'tag2' ] }) + const customQuery1 = { ...query, tagsOneOf: [ 'tag1', 'tag2' ] } await makeGetRequest({ url: server.url, path, query: customQuery1, statusCodeExpected: HttpStatusCode.OK_200 }) - const customQuery2 = immutableAssign(query, { tagsOneOf: 'tag1' }) + const customQuery2 = { ...query, tagsOneOf: 'tag1' } await makeGetRequest({ url: server.url, path, query: customQuery2, statusCodeExpected: HttpStatusCode.OK_200 }) - const customQuery3 = immutableAssign(query, { tagsAllOf: [ 'tag1', 'tag2' ] }) + const customQuery3 = { ...query, tagsAllOf: [ 'tag1', 'tag2' ] } await makeGetRequest({ url: server.url, path, query: customQuery3, statusCodeExpected: HttpStatusCode.OK_200 }) - const customQuery4 = immutableAssign(query, { tagsAllOf: 'tag1' }) + const customQuery4 = { ...query, tagsAllOf: 'tag1' } await makeGetRequest({ url: server.url, path, query: customQuery4, statusCodeExpected: HttpStatusCode.OK_200 }) }) it('Should fail with invalid durations', async function () { - const customQuery1 = immutableAssign(query, { durationMin: 'hello' }) + const customQuery1 = { ...query, durationMin: 'hello' } await makeGetRequest({ url: server.url, path, query: customQuery1, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) - const customQuery2 = immutableAssign(query, { durationMax: 'hello' }) + const customQuery2 = { ...query, durationMax: 'hello' } await makeGetRequest({ url: server.url, path, query: customQuery2, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) }) it('Should fail with invalid dates', async function () { - const customQuery1 = immutableAssign(query, { startDate: 'hello' }) + const customQuery1 = { ...query, startDate: 'hello' } await makeGetRequest({ url: server.url, path, query: customQuery1, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) - const customQuery2 = immutableAssign(query, { endDate: 'hello' }) + const customQuery2 = { ...query, endDate: 'hello' } await makeGetRequest({ url: server.url, path, query: customQuery2, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) - const customQuery3 = immutableAssign(query, { originallyPublishedStartDate: 'hello' }) + const customQuery3 = { ...query, originallyPublishedStartDate: 'hello' } await makeGetRequest({ url: server.url, path, query: customQuery3, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) - const customQuery4 = immutableAssign(query, { originallyPublishedEndDate: 'hello' }) + const customQuery4 = { ...query, originallyPublishedEndDate: 'hello' } await makeGetRequest({ url: server.url, path, query: customQuery4, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) }) }) @@ -201,41 +200,41 @@ describe('Test videos API validator', function () { for (const path of paths) { { - const customQuery = immutableAssign(query, { searchTarget: 'hello' }) + const customQuery = { ...query, searchTarget: 'hello' } await makeGetRequest({ url: server.url, path, query: customQuery, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) } { - const customQuery = immutableAssign(query, { searchTarget: undefined }) + const customQuery = { ...query, searchTarget: undefined } await makeGetRequest({ url: server.url, path, query: customQuery, statusCodeExpected: HttpStatusCode.OK_200 }) } { - const customQuery = immutableAssign(query, { searchTarget: 'local' }) + const customQuery = { ...query, searchTarget: 'local' } await makeGetRequest({ url: server.url, path, query: customQuery, statusCodeExpected: HttpStatusCode.OK_200 }) } { - const customQuery = immutableAssign(query, { searchTarget: 'search-index' }) + const customQuery = { ...query, searchTarget: 'search-index' } await makeGetRequest({ url: server.url, path, query: customQuery, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) } await updateSearchIndex(server, true, true) { - const customQuery = immutableAssign(query, { searchTarget: 'local' }) + const customQuery = { ...query, searchTarget: 'local' } await makeGetRequest({ url: server.url, path, query: customQuery, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) } { - const customQuery = immutableAssign(query, { searchTarget: 'search-index' }) + const customQuery = { ...query, searchTarget: 'search-index' } await makeGetRequest({ url: server.url, path, query: customQuery, statusCodeExpected: HttpStatusCode.OK_200 }) } await updateSearchIndex(server, true, false) { - const customQuery = immutableAssign(query, { searchTarget: 'local' }) + const customQuery = { ...query, searchTarget: 'local' } await makeGetRequest({ url: server.url, path, query: customQuery, statusCodeExpected: HttpStatusCode.OK_200 }) } -- cgit v1.2.3 From 89d241a79c262b9775c233b73cff080043ebb5e6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Jul 2021 09:04:35 +0200 Subject: Shorter server command names --- server/tests/api/check-params/search.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'server/tests/api/check-params/search.ts') diff --git a/server/tests/api/check-params/search.ts b/server/tests/api/check-params/search.ts index 7973c112f..1acfa0922 100644 --- a/server/tests/api/check-params/search.ts +++ b/server/tests/api/check-params/search.ts @@ -14,7 +14,7 @@ import { } from '@shared/extra-utils' function updateSearchIndex (server: ServerInfo, enabled: boolean, disableLocalSearch = false) { - return server.configCommand.updateCustomSubConfig({ + return server.config.updateCustomSubConfig({ newConfig: { search: { searchIndex: { -- cgit v1.2.3 From 254d3579f5338f5fd775c17d15cdfc37078bcfb4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Jul 2021 09:47:51 +0200 Subject: Use an object to represent a server --- server/tests/api/check-params/search.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'server/tests/api/check-params/search.ts') diff --git a/server/tests/api/check-params/search.ts b/server/tests/api/check-params/search.ts index 1acfa0922..43cd81af9 100644 --- a/server/tests/api/check-params/search.ts +++ b/server/tests/api/check-params/search.ts @@ -7,13 +7,13 @@ import { checkBadSortPagination, checkBadStartPagination, cleanupTests, - flushAndRunServer, + createSingleServer, makeGetRequest, - ServerInfo, + PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' -function updateSearchIndex (server: ServerInfo, enabled: boolean, disableLocalSearch = false) { +function updateSearchIndex (server: PeerTubeServer, enabled: boolean, disableLocalSearch = false) { return server.config.updateCustomSubConfig({ newConfig: { search: { @@ -27,14 +27,14 @@ function updateSearchIndex (server: ServerInfo, enabled: boolean, disableLocalSe } describe('Test videos API validator', function () { - let server: ServerInfo + let server: PeerTubeServer // --------------------------------------------------------------- before(async function () { this.timeout(30000) - server = await flushAndRunServer(1) + server = await createSingleServer(1) await setAccessTokensToServers([ server ]) }) -- cgit v1.2.3 From c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Jul 2021 10:42:24 +0200 Subject: Refactor requests --- server/tests/api/check-params/search.ts | 62 ++++++++++++++++----------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'server/tests/api/check-params/search.ts') diff --git a/server/tests/api/check-params/search.ts b/server/tests/api/check-params/search.ts index 43cd81af9..b49169e38 100644 --- a/server/tests/api/check-params/search.ts +++ b/server/tests/api/check-params/search.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import 'mocha' -import { HttpStatusCode } from '@shared/core-utils' +import { HttpStatusCode } from '@shared/models' import { checkBadCountPagination, checkBadSortPagination, @@ -58,83 +58,83 @@ describe('Test videos API validator', function () { }) it('Should success with the correct parameters', async function () { - await makeGetRequest({ url: server.url, path, query, statusCodeExpected: HttpStatusCode.OK_200 }) + await makeGetRequest({ url: server.url, path, query, expectedStatus: HttpStatusCode.OK_200 }) }) it('Should fail with an invalid category', async function () { const customQuery1 = { ...query, categoryOneOf: [ 'aa', 'b' ] } - await makeGetRequest({ url: server.url, path, query: customQuery1, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) + await makeGetRequest({ url: server.url, path, query: customQuery1, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) const customQuery2 = { ...query, categoryOneOf: 'a' } - await makeGetRequest({ url: server.url, path, query: customQuery2, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) + await makeGetRequest({ url: server.url, path, query: customQuery2, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) }) it('Should succeed with a valid category', async function () { const customQuery1 = { ...query, categoryOneOf: [ 1, 7 ] } - await makeGetRequest({ url: server.url, path, query: customQuery1, statusCodeExpected: HttpStatusCode.OK_200 }) + await makeGetRequest({ url: server.url, path, query: customQuery1, expectedStatus: HttpStatusCode.OK_200 }) const customQuery2 = { ...query, categoryOneOf: 1 } - await makeGetRequest({ url: server.url, path, query: customQuery2, statusCodeExpected: HttpStatusCode.OK_200 }) + await makeGetRequest({ url: server.url, path, query: customQuery2, expectedStatus: HttpStatusCode.OK_200 }) }) it('Should fail with an invalid licence', async function () { const customQuery1 = { ...query, licenceOneOf: [ 'aa', 'b' ] } - await makeGetRequest({ url: server.url, path, query: customQuery1, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) + await makeGetRequest({ url: server.url, path, query: customQuery1, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) const customQuery2 = { ...query, licenceOneOf: 'a' } - await makeGetRequest({ url: server.url, path, query: customQuery2, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) + await makeGetRequest({ url: server.url, path, query: customQuery2, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) }) it('Should succeed with a valid licence', async function () { const customQuery1 = { ...query, licenceOneOf: [ 1, 2 ] } - await makeGetRequest({ url: server.url, path, query: customQuery1, statusCodeExpected: HttpStatusCode.OK_200 }) + await makeGetRequest({ url: server.url, path, query: customQuery1, expectedStatus: HttpStatusCode.OK_200 }) const customQuery2 = { ...query, licenceOneOf: 1 } - await makeGetRequest({ url: server.url, path, query: customQuery2, statusCodeExpected: HttpStatusCode.OK_200 }) + await makeGetRequest({ url: server.url, path, query: customQuery2, expectedStatus: HttpStatusCode.OK_200 }) }) it('Should succeed with a valid language', async function () { const customQuery1 = { ...query, languageOneOf: [ 'fr', 'en' ] } - await makeGetRequest({ url: server.url, path, query: customQuery1, statusCodeExpected: HttpStatusCode.OK_200 }) + await makeGetRequest({ url: server.url, path, query: customQuery1, expectedStatus: HttpStatusCode.OK_200 }) const customQuery2 = { ...query, languageOneOf: 'fr' } - await makeGetRequest({ url: server.url, path, query: customQuery2, statusCodeExpected: HttpStatusCode.OK_200 }) + await makeGetRequest({ url: server.url, path, query: customQuery2, expectedStatus: HttpStatusCode.OK_200 }) }) it('Should succeed with valid tags', async function () { const customQuery1 = { ...query, tagsOneOf: [ 'tag1', 'tag2' ] } - await makeGetRequest({ url: server.url, path, query: customQuery1, statusCodeExpected: HttpStatusCode.OK_200 }) + await makeGetRequest({ url: server.url, path, query: customQuery1, expectedStatus: HttpStatusCode.OK_200 }) const customQuery2 = { ...query, tagsOneOf: 'tag1' } - await makeGetRequest({ url: server.url, path, query: customQuery2, statusCodeExpected: HttpStatusCode.OK_200 }) + await makeGetRequest({ url: server.url, path, query: customQuery2, expectedStatus: HttpStatusCode.OK_200 }) const customQuery3 = { ...query, tagsAllOf: [ 'tag1', 'tag2' ] } - await makeGetRequest({ url: server.url, path, query: customQuery3, statusCodeExpected: HttpStatusCode.OK_200 }) + await makeGetRequest({ url: server.url, path, query: customQuery3, expectedStatus: HttpStatusCode.OK_200 }) const customQuery4 = { ...query, tagsAllOf: 'tag1' } - await makeGetRequest({ url: server.url, path, query: customQuery4, statusCodeExpected: HttpStatusCode.OK_200 }) + await makeGetRequest({ url: server.url, path, query: customQuery4, expectedStatus: HttpStatusCode.OK_200 }) }) it('Should fail with invalid durations', async function () { const customQuery1 = { ...query, durationMin: 'hello' } - await makeGetRequest({ url: server.url, path, query: customQuery1, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) + await makeGetRequest({ url: server.url, path, query: customQuery1, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) const customQuery2 = { ...query, durationMax: 'hello' } - await makeGetRequest({ url: server.url, path, query: customQuery2, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) + await makeGetRequest({ url: server.url, path, query: customQuery2, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) }) it('Should fail with invalid dates', async function () { const customQuery1 = { ...query, startDate: 'hello' } - await makeGetRequest({ url: server.url, path, query: customQuery1, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) + await makeGetRequest({ url: server.url, path, query: customQuery1, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) const customQuery2 = { ...query, endDate: 'hello' } - await makeGetRequest({ url: server.url, path, query: customQuery2, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) + await makeGetRequest({ url: server.url, path, query: customQuery2, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) const customQuery3 = { ...query, originallyPublishedStartDate: 'hello' } - await makeGetRequest({ url: server.url, path, query: customQuery3, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) + await makeGetRequest({ url: server.url, path, query: customQuery3, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) const customQuery4 = { ...query, originallyPublishedEndDate: 'hello' } - await makeGetRequest({ url: server.url, path, query: customQuery4, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) + await makeGetRequest({ url: server.url, path, query: customQuery4, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) }) }) @@ -158,7 +158,7 @@ describe('Test videos API validator', function () { }) it('Should success with the correct parameters', async function () { - await makeGetRequest({ url: server.url, path, query, statusCodeExpected: HttpStatusCode.OK_200 }) + await makeGetRequest({ url: server.url, path, query, expectedStatus: HttpStatusCode.OK_200 }) }) }) @@ -182,7 +182,7 @@ describe('Test videos API validator', function () { }) it('Should success with the correct parameters', async function () { - await makeGetRequest({ url: server.url, path, query, statusCodeExpected: HttpStatusCode.OK_200 }) + await makeGetRequest({ url: server.url, path, query, expectedStatus: HttpStatusCode.OK_200 }) }) }) @@ -201,41 +201,41 @@ describe('Test videos API validator', function () { for (const path of paths) { { const customQuery = { ...query, searchTarget: 'hello' } - await makeGetRequest({ url: server.url, path, query: customQuery, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) + await makeGetRequest({ url: server.url, path, query: customQuery, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) } { const customQuery = { ...query, searchTarget: undefined } - await makeGetRequest({ url: server.url, path, query: customQuery, statusCodeExpected: HttpStatusCode.OK_200 }) + await makeGetRequest({ url: server.url, path, query: customQuery, expectedStatus: HttpStatusCode.OK_200 }) } { const customQuery = { ...query, searchTarget: 'local' } - await makeGetRequest({ url: server.url, path, query: customQuery, statusCodeExpected: HttpStatusCode.OK_200 }) + await makeGetRequest({ url: server.url, path, query: customQuery, expectedStatus: HttpStatusCode.OK_200 }) } { const customQuery = { ...query, searchTarget: 'search-index' } - await makeGetRequest({ url: server.url, path, query: customQuery, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) + await makeGetRequest({ url: server.url, path, query: customQuery, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) } await updateSearchIndex(server, true, true) { const customQuery = { ...query, searchTarget: 'local' } - await makeGetRequest({ url: server.url, path, query: customQuery, statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 }) + await makeGetRequest({ url: server.url, path, query: customQuery, expectedStatus: HttpStatusCode.BAD_REQUEST_400 }) } { const customQuery = { ...query, searchTarget: 'search-index' } - await makeGetRequest({ url: server.url, path, query: customQuery, statusCodeExpected: HttpStatusCode.OK_200 }) + await makeGetRequest({ url: server.url, path, query: customQuery, expectedStatus: HttpStatusCode.OK_200 }) } await updateSearchIndex(server, true, false) { const customQuery = { ...query, searchTarget: 'local' } - await makeGetRequest({ url: server.url, path, query: customQuery, statusCodeExpected: HttpStatusCode.OK_200 }) + await makeGetRequest({ url: server.url, path, query: customQuery, expectedStatus: HttpStatusCode.OK_200 }) } await updateSearchIndex(server, false, false) -- cgit v1.2.3 From 4c7e60bc17ee5830399bac4aa273356903421b4c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Jul 2021 14:27:30 +0200 Subject: Reorganize imports --- server/tests/api/check-params/search.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'server/tests/api/check-params/search.ts') diff --git a/server/tests/api/check-params/search.ts b/server/tests/api/check-params/search.ts index b49169e38..a3da54e1f 100644 --- a/server/tests/api/check-params/search.ts +++ b/server/tests/api/check-params/search.ts @@ -1,7 +1,6 @@ /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ import 'mocha' -import { HttpStatusCode } from '@shared/models' import { checkBadCountPagination, checkBadSortPagination, @@ -12,6 +11,7 @@ import { PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils' +import { HttpStatusCode } from '@shared/models' function updateSearchIndex (server: PeerTubeServer, enabled: boolean, disableLocalSearch = false) { return server.config.updateCustomSubConfig({ -- cgit v1.2.3