Fixing test case.
This commit is contained in:
parent
10fffef467
commit
7976772842
|
@ -16,6 +16,7 @@ jest.mock("../../sdk", () => ({
|
||||||
import sdk from "../../sdk"
|
import sdk from "../../sdk"
|
||||||
import { Next } from "koa"
|
import { Next } from "koa"
|
||||||
|
|
||||||
|
const tableId = utils.generateTableID()
|
||||||
const mockGetView = sdk.views.get as jest.MockedFunction<typeof sdk.views.get>
|
const mockGetView = sdk.views.get as jest.MockedFunction<typeof sdk.views.get>
|
||||||
const mockGetTable = sdk.tables.getTable as jest.MockedFunction<
|
const mockGetTable = sdk.tables.getTable as jest.MockedFunction<
|
||||||
typeof sdk.tables.getTable
|
typeof sdk.tables.getTable
|
||||||
|
@ -41,6 +42,7 @@ class TestConfiguration {
|
||||||
body: ctxRequestBody,
|
body: ctxRequestBody,
|
||||||
}
|
}
|
||||||
this.params.viewId = viewId
|
this.params.viewId = viewId
|
||||||
|
this.params.sourceId = tableId
|
||||||
return this.middleware(
|
return this.middleware(
|
||||||
{
|
{
|
||||||
request: this.request as any,
|
request: this.request as any,
|
||||||
|
@ -69,7 +71,7 @@ describe("trimViewRowInfo middleware", () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
const table: Table = {
|
const table: Table = {
|
||||||
_id: utils.generateTableID(),
|
_id: tableId,
|
||||||
name: generator.word(),
|
name: generator.word(),
|
||||||
type: "table",
|
type: "table",
|
||||||
schema: {
|
schema: {
|
||||||
|
|
Loading…
Reference in New Issue