Skip to content

Commit 7cdba3e

Browse files
authored
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' ```
1 parent 5222467 commit 7cdba3e

File tree

1 file changed

+1
-1
lines changed
  • packages/spacecat-shared-data-access/test/unit/models

1 file changed

+1
-1
lines changed

packages/spacecat-shared-data-access/test/unit/models/base.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('Base Model Tests', () => {
4141

4242
it('correctly returns the updatedAt date if provided', () => {
4343
const updatedAt = new Date().toISOString();
44-
const baseEntity = Base({ updatedAt });
44+
const baseEntity = Base({ id: 'test-id', updatedAt });
4545
expect(baseEntity.getUpdatedAt()).to.equal(updatedAt);
4646
});
4747
});

0 commit comments

Comments
 (0)