1
0
Fork 0
mirror of synced 2024-09-10 14:35:47 +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, 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",

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