From 7d78a0d3f1432d66a5770b7a67892b992d71499c Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Thu, 1 Sep 2022 19:47:00 +0530 Subject: [PATCH] refactor/Minor refactor --- .../src/__tests__/unit/rest/tests/tableRow.test.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/nocodb/src/__tests__/unit/rest/tests/tableRow.test.ts b/packages/nocodb/src/__tests__/unit/rest/tests/tableRow.test.ts index 29dfff2f31..d2b9308248 100644 --- a/packages/nocodb/src/__tests__/unit/rest/tests/tableRow.test.ts +++ b/packages/nocodb/src/__tests__/unit/rest/tests/tableRow.test.ts @@ -662,18 +662,20 @@ function tableTest() { }); it('Sorted Formula column on rollup customer table', async function () { + const rollupColumnTitle = 'Number of rentals'; const rollupColumn = await createRollupColumn(context, { project, - title: 'Number of rentals', + title: rollupColumnTitle, rollupFunction: 'count', table: customerTable, relatedTableName: 'rental', relatedTableColumnTitle: 'RentalDate', }); + const formulaColumnTitle = 'Formula'; const formulaColumn = await createColumn(context, customerTable, { uidt: UITypes.Formula, - title: 'Formula', + title: formulaColumnTitle, formula: `ADD({${rollupColumn.title}}, 10)`, }); @@ -690,19 +692,19 @@ function tableTest() { }) .expect(200); - if (response.body.list[0][formulaColumn.title] !== 22) + if (response.body.list[0][formulaColumnTitle] !== 22) throw new Error('Wrong sorting'); if ( (response.body.list as Array).every( - (row) => row['Formula'] !== row[rollupColumn.title] + 10 + (row) => row['Formula'] !== row[rollupColumnTitle] + 10 ) ) { throw new Error('Wrong formula'); } }); - // it.only('Get nested sorted filtered table with nested fields data list with a formula > lookup > rollup column in customer table', async function () { + // it('Get nested sorted filtered table with nested fields data list with a formula > lookup > rollup column in customer table', async function () { // const rentalTable = await Model.getByIdOrName({ // project_id: project.id, // base_id: project.bases[0].id, @@ -751,5 +753,5 @@ function tableTest() { } export default function () { - describe.only('TableRow', tableTest); + describe('TableRow', tableTest); }