feat: update tests

feat: update tests

feat: update tests
This commit is contained in:
2023-05-30 16:12:00 +02:00
parent d6d4f6e5c4
commit 0d60b8bfad
87 changed files with 1021 additions and 823 deletions

View File

@@ -16,7 +16,6 @@
import {SCConfigFile, SCSearchQuery, SCSearchResponse, SCThings, SCThingType, SCUuid} from '@openstapps/core';
import {Express} from 'express';
import moment from 'moment';
import {getIndexUID} from '../src/storage/elasticsearch/util.js';
import {configureApp} from '../src/app.js';
import express from 'express';
import http from 'http';
@@ -26,6 +25,7 @@ import getPort from 'get-port';
import {Database} from '../src/storage/database.js';
import {v4} from 'uuid';
import {backendConfig} from '../src/config.js';
import {getIndexUID} from '../src/storage/elasticsearch/util/index.js';
/**
* Adds routers and configures an (express) app

View File

@@ -31,8 +31,8 @@ import {buildQuery} from '../../../src/storage/elasticsearch/query/query.js';
import {buildSort} from '../../../src/storage/elasticsearch/query/sort.js';
import {ElasticsearchConfig} from '../../../src/storage/elasticsearch/types/elasticsearch-config.js';
import {QueryDslSpecificQueryContainer} from '../../../src/storage/elasticsearch/types/util.js';
import {configFile} from '../../../src/common.js';
import {SortCombinations} from '@elastic/elasticsearch/lib/api/types';
import {backendConfig} from '../../../src/config.js';
describe('Query', function () {
describe('buildBooleanFilter', function () {
@@ -363,9 +363,7 @@ describe('Query', function () {
const filter = buildFilter(rawFilter) as QueryDslSpecificQueryContainer<'range'>;
expect(filter).to.deep.equal(expectedFilter);
for (const bound of ['g', 'l']) {
// @ts-expect-error implicit any
const inclusiveExists = typeof filter.range.price[`${bound}t`] !== 'undefined';
// @ts-expect-error implicit any
const exclusiveExists = typeof filter.range.price[`${bound}te`] !== 'undefined';
// only one should exist at the same time