Skip to content

Commit

Permalink
Make code work for when downloading from phrase
Browse files Browse the repository at this point in the history
Co-authored-by: Iris Benoît <[email protected]>
  • Loading branch information
laura-bergoens and Eithliu committed Oct 10, 2024
1 parent 9e93b59 commit f2896ac
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
5 changes: 5 additions & 0 deletions api/lib/domain/models/LocalizedChallenge.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ export class LocalizedChallenge {
fileIds: [],
geography: null,
urlsToConsult: null,
requireGafamWebsiteAccess: false,
isIncompatibleIpadCertif: false,
deafAndHardOfHearing: LocalizedChallenge.DEAF_AND_HARD_OF_HEARING_VALUES.RAS,
isAwarenessChallenge: false,
toRephrase: false,
});
}

Expand Down
9 changes: 7 additions & 2 deletions api/tests/acceptance/application/phrase_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import nock from 'nock';
import { databaseBuilder, generateAuthorizationHeader, knex, streamToPromiseArray } from '../../test-helper';
import { createServer } from '../../../server';
import { ChallengeForRelease, SkillForRelease } from '../../../lib/domain/models/release/index.js';
import { Area } from '../../../lib/domain/models/index.js';
import { Area, LocalizedChallenge } from '../../../lib/domain/models/index.js';

describe('Acceptance | Controller | phrase-controller', () => {

Expand Down Expand Up @@ -396,7 +396,7 @@ describe('Acceptance | Controller | phrase-controller', () => {
});

describe('POST /phrase/download', () => {
it.fails('should download the translations from phrase', async () => {
it('should download the translations from phrase', async () => {
const user = databaseBuilder.factory.buildAdminUser();
await databaseBuilder.commit();

Expand Down Expand Up @@ -465,6 +465,11 @@ describe('Acceptance | Controller | phrase-controller', () => {
embedUrl: null,
urlsToConsult: null,
status: ChallengeForRelease.STATUSES.PROPOSE,
requireGafamWebsiteAccess: false,
isIncompatibleIpadCertif: false,
deafAndHardOfHearing: LocalizedChallenge.DEAF_AND_HARD_OF_HEARING_VALUES.RAS,
isAwarenessChallenge: false,
toRephrase: false,
}]);
});
});
Expand Down
7 changes: 6 additions & 1 deletion api/tests/unit/domain/models/LocalizedChallenge_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe('Unit | Domain | LocalizedChallenge', () => {
});

describe('static buildAlternativeFromTranslation', function() {
it.fails('should build an alternative localized challenge', function() {
it('should build an alternative localized challenge', function() {
// given
const translation = domainBuilder.buildTranslation({
key: 'challenge.idDuChallenge.field',
Expand All @@ -121,6 +121,11 @@ describe('Unit | Domain | LocalizedChallenge', () => {
fileIds: [],
geography: null,
urlsToConsult: null,
requireGafamWebsiteAccess: false,
isIncompatibleIpadCertif: false,
deafAndHardOfHearing: LocalizedChallenge.DEAF_AND_HARD_OF_HEARING_VALUES.RAS,
isAwarenessChallenge: false,
toRephrase: false,
});
});
});
Expand Down
10 changes: 10 additions & 0 deletions api/tests/unit/domain/usecases/import-translations_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ describe('Unit | Domain | Usecases | import-translations', function() {
fileIds: [],
geography: null,
urlsToConsult: null,
requireGafamWebsiteAccess: false,
isIncompatibleIpadCertif: false,
deafAndHardOfHearing: LocalizedChallenge.DEAF_AND_HARD_OF_HEARING_VALUES.RAS,
isAwarenessChallenge: false,
toRephrase: false,
}),
new LocalizedChallenge({
id: null,
Expand All @@ -111,6 +116,11 @@ describe('Unit | Domain | Usecases | import-translations', function() {
fileIds: [],
geography: null,
urlsToConsult: null,
requireGafamWebsiteAccess: false,
isIncompatibleIpadCertif: false,
deafAndHardOfHearing: LocalizedChallenge.DEAF_AND_HARD_OF_HEARING_VALUES.RAS,
isAwarenessChallenge: false,
toRephrase: false,
}),
] });
});
Expand Down

0 comments on commit f2896ac

Please sign in to comment.