Merge pull request 'Fixed the test issue' (#18) from fix/search into develop

Reviewed-on: http://85.143.176.51:3000/free-land/backend/pulls/18
This commit is contained in:
moeidtopcoder 2022-11-09 10:44:01 +00:00
commit 3022eaa0a3
2 changed files with 9 additions and 8 deletions

View File

@ -1,7 +1,5 @@
import { ApiExtraModels, ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; import { ApiExtraModels, ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { IsArray, IsDefined, IsInt, IsObject, IsOptional } from "class-validator"; import { IsDefined, IsInt, IsObject, IsOptional } from "class-validator";
import { EsPit } from "../../interfaces/elastic/es-pit.interface";
import { EsQuery } from "../../interfaces/elastic/es-query.interface"
/** /**
* List of allowed properties in this DTO * List of allowed properties in this DTO

View File

@ -107,13 +107,16 @@ describe('Unit tests for SearchService', () => {
expect(httpGetSpy).toHaveBeenCalledWith<[string, object]>(expect.anything(), { expect(httpGetSpy).toHaveBeenCalledWith<[string, object]>(expect.anything(), {
data: { data: {
query: { query: {
query_string: { multi_match: {
query: 'keyword', query: query.query,
default_field: 'content', fields: [
'title',
'content'
]
} }
}, },
from: 32, from: query.offset,
size: 1, size: query.limit
}, },
headers: { 'Content-Type': 'application/json' } headers: { 'Content-Type': 'application/json' }
}); });