Skip to content

Commit 5cbfaf6

Browse files
committed
feat(api): add createdAt attribute in knowledgeElements API
1 parent d47fd11 commit 5cbfaf6

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export class KnowledgeElementDTO {
2-
constructor({ status, skillId }) {
2+
constructor({ status, skillId, createdAt }) {
33
this.status = status;
44
this.skillId = skillId;
5+
this.createdAt = createdAt;
56
}
67
}

api/tests/evaluation/unit/application/api/knowlegde-elements-api_test.js api/tests/evaluation/unit/application/api/knowledge-elements-api_test.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ describe('Evaluation | Unit | Application | API | knowledge-elements-api', funct
1010
// given
1111
const userId = Symbol('userId');
1212
const skillIds = Symbol('skillIds');
13-
const knowledgeElement = domainBuilder.buildKnowledgeElement({ status: KnowledgeElement.StatusType.VALIDATED });
13+
const knowledgeElement = domainBuilder.buildKnowledgeElement({
14+
status: KnowledgeElement.StatusType.VALIDATED,
15+
createdAt: new Date('2024-10-27'),
16+
skillId: 'recSkill1',
17+
});
1418

1519
sinon.stub(evaluationUsecases, 'findFilteredMostRecentKnowledgeElementsByUser');
1620
evaluationUsecases.findFilteredMostRecentKnowledgeElementsByUser
@@ -22,7 +26,9 @@ describe('Evaluation | Unit | Application | API | knowledge-elements-api', funct
2226

2327
// then
2428
expect(result).to.be.instanceOf(KnowledgeElementDTO);
29+
expect(result.skillId).to.equal(knowledgeElement.skillId);
2530
expect(result.status).to.equal(KnowledgeElement.StatusType.VALIDATED);
31+
expect(result.createdAt).to.equal(knowledgeElement.createdAt);
2632
});
2733
});
2834
});

0 commit comments

Comments
 (0)