1
0
Fork 0
mirror of synced 2024-08-09 15:17:57 +12:00

Fix tests

This commit is contained in:
Adria Navarro 2023-09-13 14:09:48 +02:00
parent c530d5fa34
commit 142fb18c17
3 changed files with 22 additions and 17 deletions

View file

@ -10,6 +10,7 @@ import {
MonthlyQuotaName,
PermissionLevel,
QuotaUsageType,
RelationshipType,
Row,
SaveTableRequest,
SortOrder,
@ -737,22 +738,26 @@ describe.each([
const { linkedTable, firstRow, secondRow } = await tenancy.doInTenant(
config.getTenantId(),
async () => {
const linkedTable = await config.createLinkedTable({
name: generator.word(),
type: "table",
primary: ["id"],
primaryDisplay: "id",
schema: {
id: {
type: FieldType.AUTO,
name: "id",
autocolumn: true,
constraints: {
presence: true,
const linkedTable = await config.createLinkedTable(
RelationshipType.ONE_TO_MANY,
["link"],
{
name: generator.word(),
type: "table",
primary: ["id"],
primaryDisplay: "id",
schema: {
id: {
type: FieldType.AUTO,
name: "id",
autocolumn: true,
constraints: {
presence: true,
},
},
},
},
})
}
)
const firstRow = await config.createRow({
name: "Test Contact",
description: "original description",

View file

@ -6,7 +6,7 @@ const { RelationshipType } = require("../../constants")
const { cloneDeep } = require("lodash/fp")
describe("test the link controller", () => {
let config = new TestConfig(false)
let config = new TestConfig()
let table1, table2, appId
beforeAll(async () => {

View file

@ -563,9 +563,9 @@ class TestConfiguration {
}
async createLinkedTable(
config?: Table,
relationshipType = RelationshipType.ONE_TO_MANY,
links: any = ["link"]
links: any = ["link"],
config?: Table
) {
if (!this.table) {
throw "Must have created a table first."