Fix tests
This commit is contained in:
parent
c530d5fa34
commit
142fb18c17
|
@ -10,6 +10,7 @@ import {
|
||||||
MonthlyQuotaName,
|
MonthlyQuotaName,
|
||||||
PermissionLevel,
|
PermissionLevel,
|
||||||
QuotaUsageType,
|
QuotaUsageType,
|
||||||
|
RelationshipType,
|
||||||
Row,
|
Row,
|
||||||
SaveTableRequest,
|
SaveTableRequest,
|
||||||
SortOrder,
|
SortOrder,
|
||||||
|
@ -737,22 +738,26 @@ describe.each([
|
||||||
const { linkedTable, firstRow, secondRow } = await tenancy.doInTenant(
|
const { linkedTable, firstRow, secondRow } = await tenancy.doInTenant(
|
||||||
config.getTenantId(),
|
config.getTenantId(),
|
||||||
async () => {
|
async () => {
|
||||||
const linkedTable = await config.createLinkedTable({
|
const linkedTable = await config.createLinkedTable(
|
||||||
name: generator.word(),
|
RelationshipType.ONE_TO_MANY,
|
||||||
type: "table",
|
["link"],
|
||||||
primary: ["id"],
|
{
|
||||||
primaryDisplay: "id",
|
name: generator.word(),
|
||||||
schema: {
|
type: "table",
|
||||||
id: {
|
primary: ["id"],
|
||||||
type: FieldType.AUTO,
|
primaryDisplay: "id",
|
||||||
name: "id",
|
schema: {
|
||||||
autocolumn: true,
|
id: {
|
||||||
constraints: {
|
type: FieldType.AUTO,
|
||||||
presence: true,
|
name: "id",
|
||||||
|
autocolumn: true,
|
||||||
|
constraints: {
|
||||||
|
presence: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
})
|
)
|
||||||
const firstRow = await config.createRow({
|
const firstRow = await config.createRow({
|
||||||
name: "Test Contact",
|
name: "Test Contact",
|
||||||
description: "original description",
|
description: "original description",
|
||||||
|
|
|
@ -6,7 +6,7 @@ const { RelationshipType } = require("../../constants")
|
||||||
const { cloneDeep } = require("lodash/fp")
|
const { cloneDeep } = require("lodash/fp")
|
||||||
|
|
||||||
describe("test the link controller", () => {
|
describe("test the link controller", () => {
|
||||||
let config = new TestConfig(false)
|
let config = new TestConfig()
|
||||||
let table1, table2, appId
|
let table1, table2, appId
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
|
|
|
@ -563,9 +563,9 @@ class TestConfiguration {
|
||||||
}
|
}
|
||||||
|
|
||||||
async createLinkedTable(
|
async createLinkedTable(
|
||||||
config?: Table,
|
|
||||||
relationshipType = RelationshipType.ONE_TO_MANY,
|
relationshipType = RelationshipType.ONE_TO_MANY,
|
||||||
links: any = ["link"]
|
links: any = ["link"],
|
||||||
|
config?: Table
|
||||||
) {
|
) {
|
||||||
if (!this.table) {
|
if (!this.table) {
|
||||||
throw "Must have created a table first."
|
throw "Must have created a table first."
|
||||||
|
|
Loading…
Reference in New Issue