|
|
@ -107,9 +107,9 @@ test.describe('Project operations', () => { |
|
|
|
const testProjectId = await projectList.list.find((p: any) => p.title === testProjectName); |
|
|
|
const testProjectId = await projectList.list.find((p: any) => p.title === testProjectName); |
|
|
|
const dupeProjectId = await projectList.list.find((p: any) => p.title === dupeProjectName); |
|
|
|
const dupeProjectId = await projectList.list.find((p: any) => p.title === dupeProjectName); |
|
|
|
const projectInfoOp: ProjectInfoApiUtil = new ProjectInfoApiUtil(context.token); |
|
|
|
const projectInfoOp: ProjectInfoApiUtil = new ProjectInfoApiUtil(context.token); |
|
|
|
const original: Promise<ProjectInfo> = projectInfoOp.extractProjectInfo(testProjectId.id); |
|
|
|
const orginal: Promise<ProjectInfo> = projectInfoOp.extractProjectInfo(testProjectId.id); |
|
|
|
const duplicate: Promise<ProjectInfo> = projectInfoOp.extractProjectInfo(dupeProjectId.id); |
|
|
|
const duplicate: Promise<ProjectInfo> = projectInfoOp.extractProjectInfo(dupeProjectId.id); |
|
|
|
await Promise.all([original, duplicate]).then(arr => { |
|
|
|
await Promise.all([orginal, duplicate]).then(arr => { |
|
|
|
const ignoredFields: Set<string> = new Set([ |
|
|
|
const ignoredFields: Set<string> = new Set([ |
|
|
|
'id', |
|
|
|
'id', |
|
|
|
'prefix', |
|
|
|
'prefix', |
|
|
@ -126,30 +126,31 @@ test.describe('Project operations', () => { |
|
|
|
'updated_at', |
|
|
|
'updated_at', |
|
|
|
]); |
|
|
|
]); |
|
|
|
const ignoredKeys: Set<string> = new Set([ |
|
|
|
const ignoredKeys: Set<string> = new Set([ |
|
|
|
'.project.is_meta.id', |
|
|
|
'.project.id', |
|
|
|
'.project.is_meta.title', |
|
|
|
'.project.title', |
|
|
|
'.project.tables.0.table.id', |
|
|
|
'.project.tables.0.id', |
|
|
|
'.project.tables.0.table.id.base_id', |
|
|
|
'.project.tables.0.base_id', |
|
|
|
|
|
|
|
|
|
|
|
// below are potential bugs
|
|
|
|
// below are potential bugs
|
|
|
|
'.project.is_meta.title.status', |
|
|
|
'.project.status', |
|
|
|
'.project.tables.0.table.shares.views.0.view._ptn.ptype.tn', |
|
|
|
'.tables.0.views.0.view.tn', |
|
|
|
'.project.tables.0.table.shares.views.0.view._ptn.ptype.tn._tn', |
|
|
|
'.tables.0.views.0.view.tn._tn', |
|
|
|
'.project.tables.0.table.shares.views.0.view._ptn.ptype.tn._tn.table_meta.title', |
|
|
|
'.tables.0.views.0.view.title', |
|
|
|
'.project.tables.0.1.table.shares.views.0.view._ptn.ptype.tn', |
|
|
|
'.tables.0.views.0.view._tn', |
|
|
|
'.project.tables.0.1.table.shares.views.0.view._ptn.ptype.tn._tn', |
|
|
|
'.tables.1.views.0.view.title', |
|
|
|
'.project.tables.0.1.table.shares.views.0.view._ptn.ptype.tn._tn.table_meta.title', |
|
|
|
'.tables.1.views.0.view.tn', |
|
|
|
'.project.tables.0.1.2.table.shares.views.0.view._ptn.ptype.tn', |
|
|
|
'.tables.1.views.0.view._tn', |
|
|
|
'.project.tables.0.1.2.table.shares.views.0.view._ptn.ptype.tn._tn', |
|
|
|
'.tables.1.views.0.view.tn._tn', |
|
|
|
'.project.tables.0.1.2.table.shares.views.0.view._ptn.ptype.tn._tn.table_meta.title', |
|
|
|
'.tables.2.views.0.view.tn', |
|
|
|
'.project.tables.bases.0.alias.config', |
|
|
|
'.tables.2.views.0.view._tn', |
|
|
|
'.project.tables.bases.users.0.1.email.invite_token.main_roles.roles', |
|
|
|
'.tables.2.views.0.view.title', |
|
|
|
'.project.tables.bases.users.0.1.2.email.invite_token.main_roles.roles', |
|
|
|
'.bases.0.config', |
|
|
|
'.project.tables.bases.users.0.1.2.3.email.invite_token.main_roles.roles', |
|
|
|
'.users.1.roles', |
|
|
|
|
|
|
|
'.users.2.roles', |
|
|
|
]); |
|
|
|
]); |
|
|
|
const orginalProjectInfo: ProjectInfo = arr[0]; |
|
|
|
const orginalProjectInfo: ProjectInfo = arr[0]; |
|
|
|
const duplicateProjectInfo: ProjectInfo = arr[1]; |
|
|
|
const duplicateProjectInfo: ProjectInfo = arr[1]; |
|
|
|
expect(deepCompare(orginalProjectInfo, duplicateProjectInfo, ignoredFields, ignoredKeys)).toBeTruthy(); |
|
|
|
expect(deepCompare(orginalProjectInfo, duplicateProjectInfo, ignoredFields, ignoredKeys, '', false)).toBeTruthy(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// cleanup test-data
|
|
|
|
// cleanup test-data
|
|
|
|