1
0
Fork 0
mirror of synced 2024-10-05 04:25:21 +13:00

Run view tests

This commit is contained in:
Adria Navarro 2024-10-02 12:37:40 +02:00
parent e08c3b8574
commit 470ad95208

View file

@ -34,6 +34,7 @@ import {
Table, Table,
TableSchema, TableSchema,
User, User,
ViewFieldMetadata,
} from "@budibase/types" } from "@budibase/types"
import _ from "lodash" import _ from "lodash"
import tk from "timekeeper" import tk from "timekeeper"
@ -154,29 +155,33 @@ describe.each([
describe.each([ describe.each([
["table", createTable], ["table", createTable],
// [ [
// "view", "view",
// async (schema: TableSchema, name?: string) => { async (schema: TableSchema, name?: string) => {
// const tableId = await createTable(schema, name) const tableId = await createTable(schema, name)
// const view = await config.api.viewV2.create({ const view = await config.api.viewV2.create({
// tableId: tableId, tableId: tableId,
// name: generator.guid(), name: generator.guid(),
// schema: Object.keys(schema).reduce<Record<string, ViewFieldMetadata>>( schema: Object.keys(schema).reduce<Record<string, ViewFieldMetadata>>(
// (viewSchema, fieldName) => { (viewSchema, fieldName) => {
// const field = schema[fieldName] const field = schema[fieldName]
// viewSchema[fieldName] = { viewSchema[fieldName] = {
// visible: field.visible ?? true, visible: field.visible ?? true,
// readonly: false, readonly: false,
// } }
// return viewSchema return viewSchema
// }, },
// {} {}
// ), ),
// }) })
// return view.id return view.id
// }, },
// ], ],
])("from %s", (__, createSource) => { ])("from %s", (tableOrView, createSource) => {
if (isInMemory && tableOrView === "view") {
return
}
class SearchAssertion { class SearchAssertion {
constructor(private readonly query: SearchRowRequest) {} constructor(private readonly query: SearchRowRequest) {}