Skip to content

Commit

Permalink
refactor(api): add getter for adjustment need
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrecoin committed Oct 9, 2024
1 parent f006df8 commit ad2f3b4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ class CertificationCourse {
this._isAdjustedForAccessibility = !!isAdjustmentNeeded;
}

isAdjustementNeeded() {
return this._isAdjustedForAccessibility;
}

abort(reason) {
const { error } = Joi.string()
.valid(...Object.values(ABORT_REASONS))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ describe('Integration | Repository | Certification Course', function () {

// then
expect(actualCertificationCourse.getNumberOfChallenges()).to.equal(maximumAssessmentLength);
expect(actualCertificationCourse._isAdjustedForAccessibility).to.equal(
expect(actualCertificationCourse.isAdjustementNeeded()).to.equal(
certificationCandidate.accessibilityAdjustmentNeeded,
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ describe('Unit | Domain | Models | CertificationCourse', function () {
certificationCourse.adjustForAccessibility(isAdjustmentNeeded);

// then
expect(certificationCourse._isAdjustedForAccessibility).to.be.true;
expect(certificationCourse.isAdjustementNeeded()).to.be.true;
});
});

Expand All @@ -411,7 +411,7 @@ describe('Unit | Domain | Models | CertificationCourse', function () {
certificationCourse.adjustForAccessibility(isAdjustmentNeeded);

// then
expect(certificationCourse._isAdjustedForAccessibility).to.be.false;
expect(certificationCourse.isAdjustementNeeded()).to.be.false;
});
});
});
Expand Down

0 comments on commit ad2f3b4

Please sign in to comment.