From 44ca4fb939f5a74e4d888aa83a8e7020f6302e1c Mon Sep 17 00:00:00 2001 From: charles shin Date: Mon, 28 Nov 2022 10:52:52 -0800 Subject: [PATCH] fix: unmatching schema in hasMany integ test --- .../integration-test-templates/src/CreateFormTests.tsx | 2 +- .../integration-test-templates/src/models/schema.js | 4 ++-- packages/test-generator/lib/models/schema.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/test-generator/integration-test-templates/src/CreateFormTests.tsx b/packages/test-generator/integration-test-templates/src/CreateFormTests.tsx index 03028e3a6..b5cbd9d6d 100644 --- a/packages/test-generator/integration-test-templates/src/CreateFormTests.tsx +++ b/packages/test-generator/integration-test-templates/src/CreateFormTests.tsx @@ -103,8 +103,8 @@ export default function CreateFormTests() { JSON.stringify({ ...record, HasOneUser: await record.HasOneUser, - HasManyStudents: record.HasManyStudents, BelongsToOwner: await record.BelongsToOwner, + HasManyStudents: await record.HasManyStudents?.toArray(), }), ); }} diff --git a/packages/test-generator/integration-test-templates/src/models/schema.js b/packages/test-generator/integration-test-templates/src/models/schema.js index fb5b19b0c..6bf916ad2 100644 --- a/packages/test-generator/integration-test-templates/src/models/schema.js +++ b/packages/test-generator/integration-test-templates/src/models/schema.js @@ -766,8 +766,8 @@ export const schema = { targetName: 'allSupportedFormFieldsOwnerId', }, }, - HasManyStudent: { - name: 'HasManyStudent', + HasManyStudents: { + name: 'HasManyStudents', isArray: true, type: { model: 'Student', diff --git a/packages/test-generator/lib/models/schema.ts b/packages/test-generator/lib/models/schema.ts index 4ec4a24f7..c35d2917d 100644 --- a/packages/test-generator/lib/models/schema.ts +++ b/packages/test-generator/lib/models/schema.ts @@ -779,7 +779,7 @@ export default { isArrayNullable: true, association: { connectionType: 'HAS_MANY', - associatedWith: 'allSupportedFormFieldsHasManyStudentsId', + associatedWith: 'allSupportedFormFieldsID', }, }, ManyToManyTags: {