Skip to content

Commit bdf5731

Browse files
committedMar 21, 2025
fix(api): set difficulty on skill instead of level, weird different naming keep consistancy with existing thing
1 parent e57b6db commit bdf5731

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export class TargetProfileSkill {
2-
constructor({ id, level }) {
2+
constructor({ id, difficulty }) {
33
this.id = id;
4-
this.level = level;
4+
this.difficulty = difficulty;
55
}
66
}

Diff for: ‎api/tests/prescription/target-profile/unit/application/api/target-profile-api_test.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { TargetProfileForSpecifier } from '../../../../../../src/prescription/ta
55
import { usecases } from '../../../../../../src/prescription/target-profile/domain/usecases/index.js';
66
import { catchErr, expect, sinon } from '../../../../../test-helper.js';
77
import { domainBuilder } from '../../../../../tooling/domain-builder/domain-builder.js';
8-
import { buildSkill } from '../../../../../tooling/learning-content-builder/build-skill.js';
98

109
describe('Unit | API | TargetProfile', function () {
1110
describe('#getById', function () {
@@ -106,7 +105,7 @@ describe('Unit | API | TargetProfile', function () {
106105
findSkillsByTargetProfileIdsStub.rejects();
107106
findSkillsByTargetProfileIdsStub
108107
.withArgs({ targetProfileIds: ['targetProfileId'] })
109-
.resolves([buildSkill({ id: 'monSkillId', level: 18 })]);
108+
.resolves([domainBuilder.buildSkill({ id: 'monSkillId', difficulty: 18 })]);
110109

111110
// when
112111
const result = await targetProfileApi.findSkillsByTargetProfileIds(['targetProfileId']);
@@ -115,7 +114,7 @@ describe('Unit | API | TargetProfile', function () {
115114
expect(result).to.have.lengthOf(1);
116115
expect(result[0]).instanceOf(TargetProfileSkill);
117116
expect(result[0].id).equals('monSkillId');
118-
expect(result[0].level).equals(18);
117+
expect(result[0].difficulty).equals(18);
119118
});
120119
});
121120
});

0 commit comments

Comments
 (0)