From 5fd87e5b37ce24c45d5b1c536692f3f93d089330 Mon Sep 17 00:00:00 2001 From: Etienne Noel Date: Sun, 8 Sep 2024 07:22:56 -0700 Subject: [PATCH] - Fixes unit tests. --- packages/mysql/src/clients/mysql.client.spec.ts | 4 ++-- packages/mysql/src/clients/mysql.client.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/mysql/src/clients/mysql.client.spec.ts b/packages/mysql/src/clients/mysql.client.spec.ts index 0f32a9df..0f3aa5f9 100644 --- a/packages/mysql/src/clients/mysql.client.spec.ts +++ b/packages/mysql/src/clients/mysql.client.spec.ts @@ -87,8 +87,8 @@ describe('MySQL Client', () => { expect(uniqueIdColumnMetadata.name).toBeUndefined() expect(uniqueIdColumnMetadata.isPrimaryKey).toBeTruthy() - expect(mysqlClient.getColumnMetadata(User, "firstName")).toStrictEqual({"isSearchable": true, "isJsonBlob": true}); - expect(mysqlClient.getColumnMetadata(User, "lastName")).toStrictEqual({"isSearchable": true, "isJsonBlob": true}); + expect(mysqlClient.getColumnMetadata(User, "firstName")).toStrictEqual({"isSearchable": true, "isJsonBlob": false}); + expect(mysqlClient.getColumnMetadata(User, "lastName")).toStrictEqual({"isSearchable": true, "isJsonBlob": false}); }) it("should retrieve the primary key column name", () => { diff --git a/packages/mysql/src/clients/mysql.client.ts b/packages/mysql/src/clients/mysql.client.ts index aa230497..c5d4f511 100644 --- a/packages/mysql/src/clients/mysql.client.ts +++ b/packages/mysql/src/clients/mysql.client.ts @@ -339,7 +339,7 @@ export class MysqlClient implements MysqlClientInterface { const propertyNames = Object.keys(columns).filter(column => column !== primaryKeyPropertyName); const columnNames = propertyNames.map(column => this.getColumnName(element.constructor as { new(): T; }, column)); - const columnValues = Object.keys(columns).map(column => { + const columnValues = propertyNames.map(column => { const columnMetadata = this.getColumnMetadata(element.constructor as { new(): T; }, column); const columnValue = element[column];