|
|
@ -1368,22 +1368,16 @@ function viewRowTests() { |
|
|
|
rowId: row['Id'], |
|
|
|
rowId: row['Id'], |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const response = await request(context.app) |
|
|
|
await request(context.app) |
|
|
|
.delete( |
|
|
|
.delete( |
|
|
|
`/api/v1/db/data/noco/${project.id}/${table.id}/views/${view.id}/${row['Id']}`, |
|
|
|
`/api/v1/db/data/noco/${project.id}/${table.id}/views/${view.id}/${row['Id']}`, |
|
|
|
) |
|
|
|
) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.set('xc-auth', context.token) |
|
|
|
.expect(400); |
|
|
|
.expect(200); |
|
|
|
|
|
|
|
|
|
|
|
const deleteRow = await getRow(context, { project, table, id: row['Id'] }); |
|
|
|
const deleteRow = await getRow(context, { project, table, id: row['Id'] }); |
|
|
|
if (!deleteRow) { |
|
|
|
if (deleteRow !== undefined) { |
|
|
|
throw new Error('Should not delete'); |
|
|
|
throw new Error('Record should have been deleted!'); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
|
|
!(response.body.msg as string).includes('is a LinkToAnotherRecord of') |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
throw new Error('Should give ltar foreign key error'); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|