Skip to content

Commit

Permalink
fix tests in replication (attributes added when we worked on the rele…
Browse files Browse the repository at this point in the history
…ase few commits ago btw)
  • Loading branch information
laura-bergoens committed Oct 10, 2024
1 parent d5454dd commit 21e1056
Showing 1 changed file with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ async function mockCurrentContent() {

delete expectedThematic.airtableId;

const expectedPrimaryQualityAttributes = {
requireGafamWebsiteAccess: true,
isIncompatibleIpadCertif: true,
deafAndHardOfHearing: LocalizedChallenge.DEAF_AND_HARD_OF_HEARING_VALUES.OK,
isAwarenessChallenge: true,
toRephrase: true,
};

const expectedChallenge = {
...challenge,
geography: 'Brésil',
Expand All @@ -74,10 +82,11 @@ async function mockCurrentContent() {
'https://example.com/',
'https://pix.org/nl-be',
],
...expectedPrimaryQualityAttributes,
};
delete expectedChallenge.localizedChallenges;

const expectedChallengeNl = { ...challengeNl, illustrationAlt: 'alt_nl', geography: 'Neutre', area: 'Neutre' };
const expectedChallengeNl = { ...challengeNl, ...expectedPrimaryQualityAttributes, illustrationAlt: 'alt_nl', geography: 'Neutre', area: 'Neutre' };
delete expectedChallengeNl.localizedChallenges;

const expectedCompetence = domainBuilder.buildCompetence({
Expand Down Expand Up @@ -176,13 +185,23 @@ async function mockCurrentContent() {
'https://example.com/',
'https://pix.org/nl-be',
],
requireGafamWebsiteAccess: true,
isIncompatibleIpadCertif: true,
deafAndHardOfHearing: LocalizedChallenge.DEAF_AND_HARD_OF_HEARING_VALUES.OK,
isAwarenessChallenge: true,
toRephrase: true,
});
databaseBuilder.factory.buildLocalizedChallenge({
id: 'localized-challenge-id',
challengeId: challenge.id,
locale: 'nl',
status: LocalizedChallenge.STATUSES.PLAY,
geography: null,
requireGafamWebsiteAccess: false,
isIncompatibleIpadCertif: false,
deafAndHardOfHearing: LocalizedChallenge.DEAF_AND_HARD_OF_HEARING_VALUES.KO,
isAwarenessChallenge: false,
toRephrase: false,
});
databaseBuilder.factory.buildTranslation({
key: `challenge.${challenge.id}.instruction`,
Expand Down Expand Up @@ -317,7 +336,7 @@ describe('Acceptance | Controller | replication-data-controller', () => {
});

describe('GET /api/replication-data', function() {
it.fails('should return data for replication', async function() {
it('should return data for replication', async function() {
const expectedCurrentContent = await mockCurrentContent();

const server = await createServer();
Expand Down

0 comments on commit 21e1056

Please sign in to comment.