diff --git a/tests/playwright/tests/db/projectOperations.spec.ts b/tests/playwright/tests/db/projectOperations.spec.ts index 5b0f83b73d..dda92cb7ed 100644 --- a/tests/playwright/tests/db/projectOperations.spec.ts +++ b/tests/playwright/tests/db/projectOperations.spec.ts @@ -107,9 +107,9 @@ test.describe('Project operations', () => { const testProjectId = await projectList.list.find((p: any) => p.title === testProjectName); const dupeProjectId = await projectList.list.find((p: any) => p.title === dupeProjectName); const projectInfoOp: ProjectInfoApiUtil = new ProjectInfoApiUtil(context.token); - const orginal: Promise = projectInfoOp.extractProjectInfo(testProjectId.id); + const original: Promise = projectInfoOp.extractProjectInfo(testProjectId.id); const duplicate: Promise = projectInfoOp.extractProjectInfo(dupeProjectId.id); - await Promise.all([orginal, duplicate]).then(async arr => { + await Promise.all([original, duplicate]).then(arr => { const ignoredFields: Set = new Set([ 'id', 'prefix', @@ -149,9 +149,7 @@ test.describe('Project operations', () => { ]); const orginalProjectInfo: ProjectInfo = arr[0]; const duplicateProjectInfo: ProjectInfo = arr[1]; - await expect( - await deepCompare(orginalProjectInfo, duplicateProjectInfo, ignoredFields, ignoredKeys) - ).toBeTruthy(); + expect(deepCompare(orginalProjectInfo, duplicateProjectInfo, ignoredFields, ignoredKeys)).toBeTruthy(); }); // cleanup test-data diff --git a/tests/playwright/tests/utils/objectCompareUtil.ts b/tests/playwright/tests/utils/objectCompareUtil.ts index f7f2e2ac43..e6eb072499 100644 --- a/tests/playwright/tests/utils/objectCompareUtil.ts +++ b/tests/playwright/tests/utils/objectCompareUtil.ts @@ -15,14 +15,14 @@ * @param breakAtFirstMismatch : default true. returns false on first field mismatch * @returns */ -export async function deepCompare( +export function deepCompare( obj1: any, obj2: any, ignoredFields?: Set, ignoredKeys?: Set, keyId = '', breakAtFirstMismatch = true -): Promise { +): boolean { if (ignoredKeys !== undefined && ignoredKeys.has(keyId)) { return true; } @@ -56,7 +56,7 @@ export async function deepCompare( // console.log(`${keyId} ignored in comparison`) } else { keyId = keyId + '.' + key; - if (!(await deepCompare(obj1[key], obj2[key], ignoredFields, ignoredKeys, keyId, breakAtFirstMismatch))) { + if (!deepCompare(obj1[key], obj2[key], ignoredFields, ignoredKeys, keyId, breakAtFirstMismatch)) { return !breakAtFirstMismatch; // return false; }