Legacy views tests
This commit is contained in:
parent
93e9b1b8b4
commit
9e799c6b93
|
@ -710,9 +710,11 @@ describe.each([
|
|||
})
|
||||
})
|
||||
|
||||
// Legacy views are not available for external
|
||||
isInternal &&
|
||||
describe("fetchView", () => {
|
||||
it("should be able to fetch tables contents via 'view'", async () => {
|
||||
const row = await config.createRow()
|
||||
const row = await createRow()
|
||||
const rowUsage = await getRowUsage()
|
||||
const queryUsage = await getQueryUsage()
|
||||
|
||||
|
@ -741,8 +743,13 @@ describe.each([
|
|||
})
|
||||
|
||||
it("should be able to run on a view", async () => {
|
||||
const view = await config.createLegacyView()
|
||||
const row = await config.createRow()
|
||||
const view = await config.createLegacyView({
|
||||
tableId: table._id!,
|
||||
name: "ViewTest",
|
||||
filters: [],
|
||||
schema: {},
|
||||
})
|
||||
const row = await createRow()
|
||||
const rowUsage = await getRowUsage()
|
||||
const queryUsage = await getQueryUsage()
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ import {
|
|||
SearchFilters,
|
||||
UserRoles,
|
||||
Automation,
|
||||
View,
|
||||
} from "@budibase/types"
|
||||
|
||||
import API from "./api"
|
||||
|
@ -629,12 +630,12 @@ class TestConfiguration {
|
|||
|
||||
// VIEW
|
||||
|
||||
async createLegacyView(config?: any) {
|
||||
if (!this.table) {
|
||||
async createLegacyView(config?: View) {
|
||||
if (!this.table && !config) {
|
||||
throw "Test requires table to be configured."
|
||||
}
|
||||
const view = config || {
|
||||
tableId: this.table._id,
|
||||
tableId: this.table!._id,
|
||||
name: "ViewTest",
|
||||
}
|
||||
return this._req(view, null, controllers.view.v1.save)
|
||||
|
|
Loading…
Reference in New Issue