Skip to content

Commit

Permalink
[FEATURE] Ajouter un feature toggle pour la nouvelle page de présenta…
Browse files Browse the repository at this point in the history
…tion des campagnes (PIX-14946).

 #10375
  • Loading branch information
pix-service-auto-merge authored Oct 23, 2024
2 parents f029da4 + f87b0fd commit 4e0b4b2
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
9 changes: 8 additions & 1 deletion api/sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,14 @@ TEST_REDIS_URL=redis://localhost:6379
# default: false
# FT_ENABLE_NEED_TO_ADJUST_CERTIFICATION_ACCESSIBILITY=false

# Display the new result page
# Display the new campaign presentation page
#
# presence: optional
# type: boolean
# default: false
# FT_SHOW_NEW_CAMPAIGN_PRESENTATION_PAGE=false

# Display the new campaign result page
#
# presence: optional
# type: boolean
Expand Down
1 change: 1 addition & 0 deletions api/src/shared/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ const configuration = (function () {
isPixPlusLowerLeverEnabled: toBoolean(process.env.FT_ENABLE_PIX_PLUS_LOWER_LEVEL),
isTextToSpeechButtonEnabled: toBoolean(process.env.FT_ENABLE_TEXT_TO_SPEECH_BUTTON),
showExperimentalMissions: toBoolean(process.env.FT_SHOW_EXPERIMENTAL_MISSIONS),
showNewCampaignPresentationPage: toBoolean(process.env.FT_SHOW_NEW_CAMPAIGN_PRESENTATION_PAGE),
showNewResultPage: toBoolean(process.env.FT_SHOW_NEW_RESULT_PAGE),
isPixCompanionEnabled: toBoolean(process.env.FT_PIX_COMPANION_ENABLED),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ describe('Acceptance | Shared | Application | Controller | feature-toggle', func
'is-pix-plus-lower-lever-enabled': false,
'is-need-to-adjust-certification-accessibility-enabled': false,
'is-text-to-speech-button-enabled': false,
'show-new-campaign-presentation-page': false,
'show-new-result-page': false,
'show-experimental-missions': false,
'is-pix-companion-enabled': false,
Expand Down
1 change: 1 addition & 0 deletions mon-pix/app/models/feature-toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Model, { attr } from '@ember-data/model';
export default class FeatureToggle extends Model {
@attr('boolean') isNewAuthenticationDesignEnabled;
@attr('boolean') isTextToSpeechButtonEnabled;
@attr('boolean') showNewCampaignPresentationPage;
@attr('boolean') showNewResultPage;
@attr('boolean') isPixCompanionEnabled;
}
13 changes: 13 additions & 0 deletions mon-pix/tests/unit/services/feature-toggles-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module('Unit | Service | feature-toggles', function (hooks) {
isTextToSpeechButtonEnabled: false,
isNewAuthenticationDesignEnabled: false,
isPixCompanionEnabled: false,
showNewCampaignPresentationPage: false,
});

let storeStub;
Expand Down Expand Up @@ -69,5 +70,17 @@ module('Unit | Service | feature-toggles', function (hooks) {
// then
assert.false(featureToggleService.featureToggles.isPixCompanionEnabled);
});

test('it initializes the feature toggle showNewCampaignPresentationPage to false', async function (assert) {
// given
const featureToggleService = this.owner.lookup('service:featureToggles');
featureToggleService.set('store', storeStub);

// when
await featureToggleService.load();

// then
assert.false(featureToggleService.featureToggles.showNewCampaignPresentationPage);
});
});
});

0 comments on commit 4e0b4b2

Please sign in to comment.