Adding test case for searching sample data.

This commit is contained in:
mike12345567 2024-07-05 16:20:27 +01:00
parent 34d073bcb7
commit 39523685d6
2 changed files with 24 additions and 0 deletions

View File

@ -30,6 +30,8 @@ import { encodeJSBinding } from "@budibase/string-templates"
import { dataFilters } from "@budibase/shared-core"
import { Knex } from "knex"
import { structures } from "@budibase/backend-core/tests"
import { DEFAULT_EMPLOYEE_TABLE_SCHEMA } from "../../../db/defaultData/datasource_bb_default"
import { employeeImport } from "../../../db/defaultData/employeeImport"
describe.each([
["in-memory", undefined],
@ -2167,6 +2169,24 @@ describe.each([
}
)
isInternal &&
describe("sample data", () => {
beforeAll(async () => {
await config.api.application.addSampleData(config.appId!)
table = DEFAULT_EMPLOYEE_TABLE_SCHEMA
})
it("should be able to search sample data", async () => {
await expectSearch({
query: {},
}).toContain([
{
"First Name": "Mandy",
},
])
})
})
describe.each([
"名前", // Japanese for "name"
"Benutzer-ID", // German for "user ID", includes a hyphen

View File

@ -149,4 +149,8 @@ export class ApplicationAPI extends TestAPI {
query: { status },
})
}
addSampleData = async (appId: string): Promise<void> => {
await this._post(`/api/applications/${appId}/sample`)
}
}