diff --git a/packages/nocodb/tests/unit/rest/tests/tableRow.test.ts b/packages/nocodb/tests/unit/rest/tests/tableRow.test.ts index bffdeb77b8..230b2031bc 100644 --- a/packages/nocodb/tests/unit/rest/tests/tableRow.test.ts +++ b/packages/nocodb/tests/unit/rest/tests/tableRow.test.ts @@ -1422,20 +1422,14 @@ function tableTest() { rowId: row['Id'], }); - const response = await request(context.app) + await request(context.app) .delete(`/api/v1/db/data/noco/${project.id}/${table.id}/${row['Id']}`) .set('xc-auth', context.token) - .expect(400); + .expect(200); const deleteRow = await getRow(context, { project, table, id: row['Id'] }); - if (!deleteRow) { - throw new Error('Should not delete'); - } - - if ( - !(response.body.msg as string).includes('is a LinkToAnotherRecord of') - ) { - throw new Error('Should give LTAR foreign key error'); + if (deleteRow !== undefined) { + throw new Error('Record should have been deleted!'); } }); diff --git a/packages/nocodb/tests/unit/rest/tests/viewRow.test.ts b/packages/nocodb/tests/unit/rest/tests/viewRow.test.ts index 191426403a..f0d474f95d 100644 --- a/packages/nocodb/tests/unit/rest/tests/viewRow.test.ts +++ b/packages/nocodb/tests/unit/rest/tests/viewRow.test.ts @@ -1368,22 +1368,16 @@ function viewRowTests() { rowId: row['Id'], }); - const response = await request(context.app) + await request(context.app) .delete( `/api/v1/db/data/noco/${project.id}/${table.id}/views/${view.id}/${row['Id']}`, ) .set('xc-auth', context.token) - .expect(400); + .expect(200); const deleteRow = await getRow(context, { project, table, id: row['Id'] }); - if (!deleteRow) { - throw new Error('Should not delete'); - } - - if ( - !(response.body.msg as string).includes('is a LinkToAnotherRecord of') - ) { - throw new Error('Should give ltar foreign key error'); + if (deleteRow !== undefined) { + throw new Error('Record should have been deleted!'); } };