Helpers not changing state

This commit is contained in:
Adria Navarro 2024-10-01 13:24:38 +02:00
parent 97b70e1f5a
commit b88e63d490
1 changed files with 6 additions and 3 deletions

View File

@ -74,7 +74,7 @@ describe.each([
}, },
generator.guid().substring(0, 10) generator.guid().substring(0, 10)
) )
sourceId = await createTable( const tableId = await createTable(
{ {
name: { name: "name", type: FieldType.STRING }, name: { name: "name", type: FieldType.STRING },
//@ts-ignore - API accepts this structure, will build out rest of definition //@ts-ignore - API accepts this structure, will build out rest of definition
@ -93,6 +93,7 @@ describe.each([
) )
return { return {
relatedTable: await config.api.table.get(relatedTable), relatedTable: await config.api.table.get(relatedTable),
tableId,
} }
} }
@ -2246,9 +2247,10 @@ describe.each([
let productCategoryTable: Table, productCatRows: Row[] let productCategoryTable: Table, productCatRows: Row[]
beforeAll(async () => { beforeAll(async () => {
const { relatedTable } = await basicRelationshipTables( const { relatedTable, tableId } = await basicRelationshipTables(
RelationshipType.ONE_TO_MANY RelationshipType.ONE_TO_MANY
) )
sourceId = tableId
productCategoryTable = relatedTable productCategoryTable = relatedTable
productCatRows = await Promise.all([ productCatRows = await Promise.all([
@ -2298,9 +2300,10 @@ describe.each([
isSql && isSql &&
describe("big relations", () => { describe("big relations", () => {
beforeAll(async () => { beforeAll(async () => {
const { relatedTable } = await basicRelationshipTables( const { relatedTable, tableId } = await basicRelationshipTables(
RelationshipType.MANY_TO_ONE RelationshipType.MANY_TO_ONE
) )
sourceId = tableId
const mainRow = await config.api.row.save(sourceId, { const mainRow = await config.api.row.save(sourceId, {
name: "foo", name: "foo",
}) })