Skip to content

Commit

Permalink
🐛 api: remove locale use to get the certification challenges
Browse files Browse the repository at this point in the history
Co-authored-by: Alexandre Coin <[email protected]>

Co-authored-by: Guillaume LAGORCE <[email protected]>
  • Loading branch information
P-Jeremy and HEYGUL authored Nov 14, 2024
1 parent 465ae56 commit 94a45b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const getNextChallenge = async function ({

const activeFlashCompatibleChallenges = await challengeRepository.findActiveFlashCompatible({ locale });

const alreadyAnsweredChallenges = await challengeRepository.getMany(alreadyAnsweredChallengeIds, locale);
const alreadyAnsweredChallenges = await challengeRepository.getMany(alreadyAnsweredChallengeIds);
const challenges = [...new Set([...alreadyAnsweredChallenges, ...activeFlashCompatibleChallenges])];
const algorithmConfiguration = await flashAlgorithmConfigurationRepository.getMostRecentBeforeDate(
certificationCourse.getStartDate(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('Unit | Domain | Use Cases | get-next-challenge', function () {
challengeRepository.get.resolves();

challengeRepository.findActiveFlashCompatible.withArgs({ locale }).resolves([nextChallengeToAnswer]);
challengeRepository.getMany.withArgs([], locale).resolves([]);
challengeRepository.getMany.withArgs([]).resolves([]);

flashAlgorithmService.getCapacityAndErrorRate
.withArgs({
Expand Down Expand Up @@ -183,7 +183,7 @@ describe('Unit | Domain | Use Cases | get-next-challenge', function () {
.resolves(null);

challengeRepository.findActiveFlashCompatible.withArgs({ locale }).resolves(allChallenges);
challengeRepository.getMany.withArgs([], locale).resolves([]);
challengeRepository.getMany.withArgs([]).resolves([]);

flashAlgorithmService.getCapacityAndErrorRate
.withArgs({
Expand Down Expand Up @@ -340,7 +340,7 @@ describe('Unit | Domain | Use Cases | get-next-challenge', function () {
.resolves([alreadyAnsweredChallenge, nextChallengeToAnswer]);

challengeRepository.getMany
.withArgs([alreadyAnsweredChallenge.id, outdatedChallenge.id], locale)
.withArgs([alreadyAnsweredChallenge.id, outdatedChallenge.id])
.resolves([alreadyAnsweredChallenge, outdatedChallenge]);

flashAlgorithmService.getCapacityAndErrorRate
Expand Down Expand Up @@ -420,7 +420,7 @@ describe('Unit | Domain | Use Cases | get-next-challenge', function () {

answerRepository.findByAssessment.withArgs(assessment.id).resolves([]);
challengeRepository.findActiveFlashCompatible.withArgs({ locale }).resolves([nextChallenge, lastSeenChallenge]);
challengeRepository.getMany.withArgs([], locale).resolves([]);
challengeRepository.getMany.withArgs([]).resolves([]);

flashAlgorithmService.getCapacityAndErrorRate
.withArgs({
Expand Down Expand Up @@ -518,7 +518,7 @@ describe('Unit | Domain | Use Cases | get-next-challenge', function () {
challengeRepository.findActiveFlashCompatible
.withArgs()
.resolves([challengeWithLiveAlert, challengeWithOtherSkill, challengeWithLiveAlertedSkill]);
challengeRepository.getMany.withArgs([], locale).resolves([]);
challengeRepository.getMany.withArgs([]).resolves([]);

flashAlgorithmService.getCapacityAndErrorRate
.withArgs({
Expand Down Expand Up @@ -614,7 +614,7 @@ describe('Unit | Domain | Use Cases | get-next-challenge', function () {
challengeRepository.get.resolves();

challengeRepository.findActiveFlashCompatible.withArgs({ locale }).resolves([answeredChallenge]);
challengeRepository.getMany.withArgs([answeredChallenge.id], locale).resolves([answeredChallenge]);
challengeRepository.getMany.withArgs([answeredChallenge.id]).resolves([answeredChallenge]);

// when
const error = await catchErr(getNextChallenge)({
Expand Down Expand Up @@ -693,7 +693,7 @@ describe('Unit | Domain | Use Cases | get-next-challenge', function () {
challengeRepository.get.resolves();

challengeRepository.findActiveFlashCompatible.withArgs({ locale }).resolves([nextChallengeToAnswer]);
challengeRepository.getMany.withArgs([], locale).resolves([]);
challengeRepository.getMany.withArgs([]).resolves([]);

flashAlgorithmService.getCapacityAndErrorRate
.withArgs({
Expand Down

0 comments on commit 94a45b2

Please sign in to comment.