Browse Source

test: avoid expecting array for created & lastModified

pull/7373/head
mertmit 12 months ago
parent
commit
42a602c800
  1. 16
      packages/nocodb/tests/unit/model/tests/baseModelSql.test.ts
  2. 8
      packages/nocodb/tests/unit/rest/tests/columnTypeSpecific.test.ts

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

@ -176,10 +176,18 @@ function baseModelSqlTests() {
const insertedRows: any[] = await baseModelSql.list();
await baseModelSql.bulkUpdate(
insertedRows.map(({ CreatedAt: _, UpdatedAt: __, ...row }) => ({
...row,
Title: `new-${row['Title']}`,
})),
insertedRows.map(
({
CreatedAt: _,
UpdatedAt: __,
CreatedBy: ___,
UpdatedBy: ____,
...row
}) => ({
...row,
Title: `new-${row['Title']}`,
}),
),
{ cookie: request },
);

8
packages/nocodb/tests/unit/rest/tests/columnTypeSpecific.test.ts

@ -209,7 +209,7 @@ function columnTypeSpecificTests() {
}
});
it('New record: verify system fields', async () => {
it.only('New record: verify system fields', async () => {
// created-at is filled with current dateTime, last-modified-at is null
// created-by is filled with current user, last-modified-by is null
@ -224,10 +224,10 @@ function columnTypeSpecificTests() {
expect(unfilteredRecords[0].UpdatedAt).to.equal(null);
expect(unfilteredRecords[0].CreatedBy).to.not.equal(null);
expect(unfilteredRecords[0].CreatedBy[0].email).to.equal(
'test@example.com',
expect(unfilteredRecords[0].CreatedBy.email).to.equal(
context.user.email,
);
expect(unfilteredRecords[0].CreatedBy[0].display_name).to.equal(null);
expect(unfilteredRecords[0].CreatedBy.display_name).to.equal(null);
expect(unfilteredRecords[0].UpdatedBy).to.equal(null);
});

Loading…
Cancel
Save