From 8847a5b1461ac93436d02a8a58001f42e15a3582 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 20 Aug 2024 13:19:58 +0100 Subject: [PATCH] Disabling for old/in-memory search. --- .../src/api/routes/tests/search.spec.ts | 89 ++++++++++--------- 1 file changed, 45 insertions(+), 44 deletions(-) diff --git a/packages/server/src/api/routes/tests/search.spec.ts b/packages/server/src/api/routes/tests/search.spec.ts index be7b29bb86..bac9b6f774 100644 --- a/packages/server/src/api/routes/tests/search.spec.ts +++ b/packages/server/src/api/routes/tests/search.spec.ts @@ -2762,55 +2762,56 @@ describe.each([ }) }) - describe("primaryDisplay", () => { - beforeAll(async () => { - let toRelateTable = await createTable({ - name: { - name: "name", - type: FieldType.STRING, - }, - }) - table = await config.api.table.save( - tableForDatasource(datasource, { - schema: { - name: { - name: "name", - type: FieldType.STRING, - }, - link: { - name: "link", - type: FieldType.LINK, - relationshipType: RelationshipType.MANY_TO_ONE, - tableId: toRelateTable._id!, - fieldName: "link", - }, + isSql && + describe("primaryDisplay", () => { + beforeAll(async () => { + let toRelateTable = await createTable({ + name: { + name: "name", + type: FieldType.STRING, }, }) - ) - toRelateTable = await config.api.table.get(toRelateTable._id!) - await config.api.table.save({ - ...toRelateTable, - primaryDisplay: "link", + table = await config.api.table.save( + tableForDatasource(datasource, { + schema: { + name: { + name: "name", + type: FieldType.STRING, + }, + link: { + name: "link", + type: FieldType.LINK, + relationshipType: RelationshipType.MANY_TO_ONE, + tableId: toRelateTable._id!, + fieldName: "link", + }, + }, + }) + ) + toRelateTable = await config.api.table.get(toRelateTable._id!) + await config.api.table.save({ + ...toRelateTable, + primaryDisplay: "link", + }) + const relatedRows = await Promise.all([ + config.api.row.save(toRelateTable._id!, { name: "test" }), + ]) + await Promise.all([ + config.api.row.save(table._id!, { + name: "test", + link: relatedRows.map(row => row._id), + }), + ]) }) - const relatedRows = await Promise.all([ - config.api.row.save(toRelateTable._id!, { name: "test" }), - ]) - await Promise.all([ - config.api.row.save(table._id!, { - name: "test", - link: relatedRows.map(row => row._id), - }), - ]) - }) - it("should be able to query, primary display on related table shouldn't be used", async () => { - // this test makes sure that if a relationship has been specified as the primary display on a table - // it is ignored and another column is used instead - await expectQuery({}).toContain([ - { name: "test", link: [{ primaryDisplay: "test" }] }, - ]) + it("should be able to query, primary display on related table shouldn't be used", async () => { + // this test makes sure that if a relationship has been specified as the primary display on a table + // it is ignored and another column is used instead + await expectQuery({}).toContain([ + { name: "test", link: [{ primaryDisplay: "test" }] }, + ]) + }) }) - }) !isLucene && describe("$and", () => {