Skip to content

Commit

Permalink
refactor(certif): rename get-next-challenge-for-v3-certification as…
Browse files Browse the repository at this point in the history
… v3 is the standard now
  • Loading branch information
HEYGUL committed Sep 23, 2024
1 parent 1d686eb commit ea5ad87
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const debugGetNextChallengeForV3Certification = Debug('pix:certif:v3:get-next-ch
* @param {CertificationCandidateRepository} params.certificationCandidateRepository
* @param {CertificationCandidate.id} params.certificationCandidateId
*/
const getNextChallengeForV3Certification = async function ({
const getNextChallenge = async function ({
assessment,
answerRepository,
certificationChallengeRepository,
Expand Down Expand Up @@ -152,4 +152,4 @@ const _getValidatedLiveAlertChallengeIds = async ({ assessmentId, certificationC
return certificationChallengeLiveAlertRepository.getLiveAlertValidatedChallengeIdsByAssessmentId({ assessmentId });
};

export { getNextChallengeForV3Certification };
export { getNextChallenge };
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ async function _getChallengeByAssessmentType({ assessment, request, dependencies
});

if (CertificationVersion.isV3(certificationCourseVersion)) {
return certificationEvaluationUsecases.getNextChallengeForV3Certification({
return certificationEvaluationUsecases.getNextChallenge({
assessment,
locale,
certificationCandidateId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { getNextChallengeForV3Certification } from '../../../../../../src/certification/evaluation/domain/usecases/get-next-challenge-for-v3-certification.js';
import { getNextChallenge } from '../../../../../../src/certification/evaluation/domain/usecases/get-next-challenge.js';
import { CERTIFICATION_VERSIONS } from '../../../../../../src/certification/shared/domain/models/CertificationVersion.js';
import { config } from '../../../../../../src/shared/config.js';
import { AssessmentEndedError } from '../../../../../../src/shared/domain/errors.js';
import { catchErr, domainBuilder, expect, sinon } from '../../../../../test-helper.js';

describe('Unit | Domain | Use Cases | get-next-challenge-for-v3-certification', function () {
describe('#getNextChallengeForV3Certification', function () {
describe('Unit | Domain | Use Cases | get-next-challenge', function () {
describe('#getNextChallenge', function () {
let answerRepository,
challengeRepository,
certificationCourseRepository,
Expand Down Expand Up @@ -121,7 +121,7 @@ describe('Unit | Domain | Use Cases | get-next-challenge-for-v3-certification',
pickChallengeService.chooseNextChallenge.withArgs().returns(chooseNextChallengeImpl);

// when
const challenge = await getNextChallengeForV3Certification({
const challenge = await getNextChallenge({
answerRepository,
assessment,
certificationChallengeRepository,
Expand Down Expand Up @@ -220,7 +220,7 @@ describe('Unit | Domain | Use Cases | get-next-challenge-for-v3-certification',
.resolves(candidateNeedingAccessibilityAdjustment);

// when
const challenge = await getNextChallengeForV3Certification({
const challenge = await getNextChallenge({
answerRepository,
assessment,
certificationChallengeRepository,
Expand Down Expand Up @@ -271,7 +271,7 @@ describe('Unit | Domain | Use Cases | get-next-challenge-for-v3-certification',
challengeRepository.get.withArgs(nonAnsweredCertificationChallenge.challengeId).resolves(lastSeenChallenge);

// when
const challenge = await getNextChallengeForV3Certification({
const challenge = await getNextChallenge({
answerRepository,
assessment,
certificationChallengeRepository,
Expand Down Expand Up @@ -363,7 +363,7 @@ describe('Unit | Domain | Use Cases | get-next-challenge-for-v3-certification',
pickChallengeService.chooseNextChallenge.withArgs().returns(chooseNextChallengeImpl);

// when
const challenge = await getNextChallengeForV3Certification({
const challenge = await getNextChallenge({
answerRepository,
assessment,
certificationChallengeRepository,
Expand Down Expand Up @@ -461,7 +461,7 @@ describe('Unit | Domain | Use Cases | get-next-challenge-for-v3-certification',
pickChallengeService.chooseNextChallenge.withArgs().returns(chooseNextChallengeImpl);

// when
const challenge = await getNextChallengeForV3Certification({
const challenge = await getNextChallenge({
answerRepository,
assessment,
certificationChallengeRepository,
Expand Down Expand Up @@ -519,7 +519,7 @@ describe('Unit | Domain | Use Cases | get-next-challenge-for-v3-certification',
challengeRepository.findActiveFlashCompatible.withArgs({ locale }).resolves([answeredChallenge]);

// when
const error = await catchErr(getNextChallengeForV3Certification)({
const error = await catchErr(getNextChallenge)({
answerRepository,
assessment,
certificationChallengeRepository,
Expand Down Expand Up @@ -625,7 +625,7 @@ describe('Unit | Domain | Use Cases | get-next-challenge-for-v3-certification',
pickChallengeService.chooseNextChallenge.withArgs().returns(chooseNextChallengeImpl);

// when
const challenge = await getNextChallengeForV3Certification({
const challenge = await getNextChallenge({
answerRepository,
assessment,
certificationChallengeRepository,
Expand Down

0 comments on commit ea5ad87

Please sign in to comment.