diff --git a/certif/app/components/session-supervising/header.hbs b/certif/app/components/session-supervising/header.hbs index ab77caaae0f..2d27e47e86f 100644 --- a/certif/app/components/session-supervising/header.hbs +++ b/certif/app/components/session-supervising/header.hbs @@ -55,6 +55,21 @@ + {{#if this.isPixCompanionExtensionEnabled}} + + {{t "pages.session-supervising.header.companion.message"}} + + {{t "pages.session-supervising.header.companion.link"}} + + + + {{/if}} + `); + + // then + assert + .dom(screen.getByText('L’extension Pix Companion est désormais obligatoire pour tous les candidats.')) + .exists(); + assert + .dom(screen.getByRole('link', { name: 'Lien vers la documentation d’installation/activation' })) + .hasAttribute('href', 'https://cloud.pix.fr/s/fpeEyDpYEkMeqRX'); + }); + }); + + module('when the FT_PIX_COMPANION_ENABLED feature toggle is disabled', function () { + test('should not display a companion information with documentation url', async function (assert) { + // given + class FeatureTogglesStub extends Service { + featureToggles = { isPixCompanionEnabled: false }; + } + this.owner.register('service:featureToggles', FeatureTogglesStub); + const sessionForSupervising = store.createRecord('session-for-supervising', { + id: '12345', + date: '2020-01-01', + time: '12:00:00', + room: 'Salle 12', + examiner: 'Star Lord', + certificationCandidates: [], + }); + this.set('sessionForSupervising', sessionForSupervising); + + // when + const screen = await renderScreen(hbs``); + + // then + assert + .dom(screen.queryByText('L’extension Pix Companion est désormais obligatoire pour tous les candidats.')) + .doesNotExist(); + assert + .dom(screen.queryByRole('link', { name: 'Lien vers la documentation d’installation/activation' })) + .doesNotExist(); + }); + }); }); diff --git a/certif/tests/unit/services/url-test.js b/certif/tests/unit/services/url-test.js index 648318f1f93..35ed0dc7551 100644 --- a/certif/tests/unit/services/url-test.js +++ b/certif/tests/unit/services/url-test.js @@ -283,4 +283,17 @@ module('Unit | Service | url', function (hooks) { }); }); }); + + module('#pixCompanionDocumentationUrl', function () { + test('should return the pix companion documentation url', function (assert) { + // given + const service = this.owner.lookup('service:url'); + + // when + const pixCompanionDocumentationUrl = service.pixCompanionDocumentationUrl; + + // then + assert.strictEqual(pixCompanionDocumentationUrl, 'https://cloud.pix.fr/s/fpeEyDpYEkMeqRX'); + }); + }); }); diff --git a/certif/translations/en.json b/certif/translations/en.json index a660836db59..366d00716ba 100644 --- a/certif/translations/en.json +++ b/certif/translations/en.json @@ -537,6 +537,10 @@ "exit-extra-information": "Exit the session’s invigilation {sessionId}" }, "address": "Location name", + "companion": { + "link": "Link to installation/activation documentation", + "message": "The Pix Companion extension is now mandatory for all candidates." + }, "information": "Warning, make sure that all the candidates have finished their exam before exiting the invigilation. To resume the invigilation of this session, you will have to enter again it’s session number and it’s password.", "invigilator": "Invigilator(s)", "room": "Room", diff --git a/certif/translations/fr.json b/certif/translations/fr.json index 71b86294acf..fdd2a17ee0e 100644 --- a/certif/translations/fr.json +++ b/certif/translations/fr.json @@ -537,6 +537,10 @@ "exit-extra-information": "Quitter la surveillance de la session {sessionId}" }, "address": "Nom du site", + "companion": { + "link": "Lien vers la documentation d’installation/activation", + "message": "L’extension Pix Companion est désormais obligatoire pour tous les candidats." + }, "information": "Attention, assurez-vous que tous les candidats aient terminé leur test avant de quitter la surveillance. Pour reprendre la surveillance de cette session, vous devrez entrer à nouveau son numéro de session et son mot de passe.", "invigilator": "Surveillant(s)", "room": "Salle",