Browse Source

test: skip value population for Created and LastModified

pull/7304/head
Pranav C 10 months ago
parent
commit
7212b7902f
  1. 9
      packages/nocodb/tests/unit/model/tests/baseModelSql.test.ts
  2. 11
      packages/nocodb/tests/unit/rest/tests/newDataApis.test.ts

9
packages/nocodb/tests/unit/model/tests/baseModelSql.test.ts

@ -98,8 +98,8 @@ function baseModelSqlTests() {
bulkData.forEach((inputData: any, index) => { bulkData.forEach((inputData: any, index) => {
if (isPg(context)) { if (isPg(context)) {
inputData.CreatedAt = insertedRows[index].CreatedAt inputData.CreatedAt = insertedRows[index].CreatedAt;
inputData.UpdatedAt = insertedRows[index].UpdatedAt inputData.UpdatedAt = insertedRows[index].UpdatedAt;
} }
expect(insertedRows[index]).to.include(inputData); expect(insertedRows[index]).to.include(inputData);
}); });
@ -172,7 +172,10 @@ function baseModelSqlTests() {
const insertedRows: any[] = await baseModelSql.list(); const insertedRows: any[] = await baseModelSql.list();
await baseModelSql.bulkUpdate( await baseModelSql.bulkUpdate(
insertedRows.map((row) => ({ ...row, Title: `new-${row['Title']}` })), insertedRows.map(({ CreatedAt: _, UpdatedAt: __, ...row }) => ({
...row,
Title: `new-${row['Title']}`,
})),
{ cookie: request }, { cookie: request },
); );

11
packages/nocodb/tests/unit/rest/tests/newDataApis.test.ts

@ -1624,7 +1624,12 @@ function dateBased() {
// insert 10 records // insert 10 records
// remove Id's from record array // remove Id's from record array
records.forEach((r) => delete r.Id); records.forEach((r) => {
delete r.Id;
delete r.CreatedAt;
delete r.UpdatedAt;
delete r.Id;
});
rsp = await ncAxiosPost({ rsp = await ncAxiosPost({
body: records, body: records,
}); });
@ -1996,7 +2001,7 @@ function linkBased() {
return Array.from({ length: count }, (_, index) => i + index); return Array.from({ length: count }, (_, index) => i + index);
} }
it('Create Many-Many ', async function () { it.only('Create Many-Many ', async function () {
await ncAxiosLinkAdd({ await ncAxiosLinkAdd({
urlParams: { urlParams: {
tableId: tblActor.id, tableId: tblActor.id,
@ -2731,7 +2736,7 @@ function linkBased() {
await nestedAddTests(validParams); await nestedAddTests(validParams);
}); });
it('Error handling : MM: Nested REMOVE', async function () { it.only('Error handling : MM: Nested REMOVE', async function () {
// Prepare data // Prepare data
await ncAxiosLinkAdd({ await ncAxiosLinkAdd({
urlParams: { urlParams: {

Loading…
Cancel
Save