Skip to content

Commit

Permalink
[BUGFIX] Ne pas tenir compte de la locale lors de la séléction du pro…
Browse files Browse the repository at this point in the history
…chain challenge de certification (PIX-15008)

 #10538
  • Loading branch information
pix-service-auto-merge authored Nov 14, 2024
2 parents c6a14ac + cdc579b commit 43e8e3f
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 43e8e3f

Please sign in to comment.