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, MonthlyQuotaName,
PermissionLevel, PermissionLevel,
QuotaUsageType, QuotaUsageType,
RelationshipType,
Row, Row,
SaveTableRequest, SaveTableRequest,
SortOrder, SortOrder,
@ -737,7 +738,10 @@ 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(
RelationshipType.ONE_TO_MANY,
["link"],
{
name: generator.word(), name: generator.word(),
type: "table", type: "table",
primary: ["id"], primary: ["id"],
@ -752,7 +756,8 @@ describe.each([
}, },
}, },
}, },
}) }
)
const firstRow = await config.createRow({ const firstRow = await config.createRow({
name: "Test Contact", name: "Test Contact",
description: "original description", description: "original description",

View File

@ -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 () => {

View File

@ -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."