Run tests for all

This commit is contained in:
Adria Navarro 2024-10-16 12:38:38 +02:00
parent 83ffee3194
commit 7266fb3c1b
2 changed files with 37 additions and 38 deletions

View File

@ -216,15 +216,15 @@ export async function search(ctx: Ctx<SearchRowRequest, SearchRowResponse>) {
await context.ensureSnippetContext(true)
let enrichedQuery: SearchFilters = await utils.enrichSearchContext(
{ ...ctx.request.body.query },
{
user: sdk.users.getUserContextBindings(ctx.user),
}
)
let { query } = ctx.request.body
if (!isPlainObject(query)) {
const allTables = await sdk.tables.getAllTables()
enrichedQuery = replaceTableNamesInFilters(tableId, enrichedQuery, allTables)
query = replaceTableNamesInFilters(tableId, query, allTables)
}
let enrichedQuery: SearchFilters = await utils.enrichSearchContext(query, {
user: sdk.users.getUserContextBindings(ctx.user),
})
const searchParams: RowSearchParams = {
...ctx.request.body,

View File

@ -2567,7 +2567,8 @@ describe.each([
expect(response.rows[0].productCat).toBeArrayOfSize(11)
})
})
;(isSqs || isLucene) &&
isSql &&
describe("relations to same table", () => {
let relatedTable: string, relatedRows: Row[]
@ -2637,7 +2638,6 @@ describe.each([
])
})
isSqs &&
it("should be able to filter via the first relation field with equal", async () => {
await expectSearch({
query: {
@ -2653,7 +2653,6 @@ describe.each([
])
})
isSqs &&
it("should be able to filter via the second relation field with not equal", async () => {
await expectSearch({
query: {