From 7cdba3e8af0734e346a0469fbd51afa3adac7bd5 Mon Sep 17 00:00:00 2001 From: Iulia Grumaz Date: Tue, 30 Jan 2024 11:06:14 +0200 Subject: [PATCH] test: fix updatedAt test In some cases, the test failed with assertion error, because it compared expected with passed updatedAt on a new record (no id), whereas for new records a updatedAt is generated in the constructor. ``` AssertionError: expected '2024-01-18T16:23:59.276Z' to equal '2024-01-18T16:23:59.275Z' ``` --- .../spacecat-shared-data-access/test/unit/models/base.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/spacecat-shared-data-access/test/unit/models/base.test.js b/packages/spacecat-shared-data-access/test/unit/models/base.test.js index 5e3ca0f4..b279ab7e 100644 --- a/packages/spacecat-shared-data-access/test/unit/models/base.test.js +++ b/packages/spacecat-shared-data-access/test/unit/models/base.test.js @@ -41,7 +41,7 @@ describe('Base Model Tests', () => { it('correctly returns the updatedAt date if provided', () => { const updatedAt = new Date().toISOString(); - const baseEntity = Base({ updatedAt }); + const baseEntity = Base({ id: 'test-id', updatedAt }); expect(baseEntity.getUpdatedAt()).to.equal(updatedAt); }); });