mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-22 09:32:41 +00:00
Resolve "Transition to ESLint"
This commit is contained in:
committed by
Rainer Killinger
parent
ca1d2444e0
commit
418ba67d15
@@ -18,7 +18,7 @@ import {
|
||||
SCMultiSearchRoute,
|
||||
SCSearchRoute,
|
||||
SCSyntaxErrorResponse,
|
||||
SCTooManyRequestsErrorResponse
|
||||
SCTooManyRequestsErrorResponse,
|
||||
} from '@openstapps/core';
|
||||
import {expect} from 'chai';
|
||||
import {configFile} from '../../src/common';
|
||||
@@ -37,33 +37,24 @@ describe('Search route', async function () {
|
||||
|
||||
it('should reject GET, PUT with a valid search query', async function () {
|
||||
// const expectedParams = JSON.parse(JSON.stringify(defaultParams));
|
||||
const {status} = await testApp
|
||||
.get('/search')
|
||||
.set('Accept', 'application/json')
|
||||
.send({
|
||||
query: 'Some search terms'
|
||||
});
|
||||
const {status} = await testApp.get('/search').set('Accept', 'application/json').send({
|
||||
query: 'Some search terms',
|
||||
});
|
||||
|
||||
expect(status).to.equal(methodNotAllowedError.statusCode);
|
||||
});
|
||||
|
||||
describe('Basic POST /search', async function() {
|
||||
describe('Basic POST /search', async function () {
|
||||
it('should accept empty JSON object', async function () {
|
||||
const {status} = await testApp
|
||||
.post(searchRoute.urlPath)
|
||||
.set('Accept', 'application/json')
|
||||
.send({});
|
||||
const {status} = await testApp.post(searchRoute.urlPath).set('Accept', 'application/json').send({});
|
||||
|
||||
expect(status).to.equal(searchRoute.statusCodeSuccess);
|
||||
});
|
||||
|
||||
it('should accept valid search request', async function () {
|
||||
const {status} = await testApp
|
||||
.post(searchRoute.urlPath)
|
||||
.set('Accept', 'application/json')
|
||||
.send({
|
||||
query: 'Some search terms'
|
||||
});
|
||||
const {status} = await testApp.post(searchRoute.urlPath).set('Accept', 'application/json').send({
|
||||
query: 'Some search terms',
|
||||
});
|
||||
|
||||
expect(status).to.equal(searchRoute.statusCodeSuccess);
|
||||
});
|
||||
@@ -74,14 +65,14 @@ describe('Search route', async function () {
|
||||
.set('Content-Type', 'application/json')
|
||||
.set('Accept', 'application/json')
|
||||
.send({
|
||||
some: {invalid: 'search'}
|
||||
some: {invalid: 'search'},
|
||||
});
|
||||
|
||||
expect(status).to.equal(syntaxError.statusCode);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Basic POST /multi/search', async function() {
|
||||
describe('Basic POST /multi/search', async function () {
|
||||
it('should respond with bad request on invalid search request (empty JSON object as body)', async function () {
|
||||
const {status} = await testApp
|
||||
.post(multiSearchRoute.urlPath)
|
||||
@@ -96,8 +87,8 @@ describe('Search route', async function () {
|
||||
.post(multiSearchRoute.urlPath)
|
||||
.set('Accept', 'application/json')
|
||||
.send({
|
||||
one: { query: 'Some search terms for one search'},
|
||||
two: { query: 'Some search terms for another search'}
|
||||
one: {query: 'Some search terms for one search'},
|
||||
two: {query: 'Some search terms for another search'},
|
||||
});
|
||||
|
||||
expect(status).to.equal(multiSearchRoute.statusCodeSuccess);
|
||||
|
||||
Reference in New Issue
Block a user