diff --git a/mon-pix/app/components/account-recovery/confirmation-step.hbs b/mon-pix/app/components/account-recovery/confirmation-step.hbs index 2ef71af67fa..419ec5c4855 100644 --- a/mon-pix/app/components/account-recovery/confirmation-step.hbs +++ b/mon-pix/app/components/account-recovery/confirmation-step.hbs @@ -44,8 +44,10 @@ - - {{t "pages.account-recovery.find-sco-record.confirmation-step.certify-account"}} + + <:label> + {{t "pages.account-recovery.find-sco-record.confirmation-step.certify-account"}} +
diff --git a/mon-pix/app/components/account-recovery/update-sco-record-form.hbs b/mon-pix/app/components/account-recovery/update-sco-record-form.hbs index 388e3ca69f4..cdc9204900e 100644 --- a/mon-pix/app/components/account-recovery/update-sco-record-form.hbs +++ b/mon-pix/app/components/account-recovery/update-sco-record-form.hbs @@ -29,7 +29,14 @@
- {{t "common.cgu.message" cguUrl=this.cguUrl dataProtectionPolicyUrl=this.dataProtectionPolicyUrl htmlSafe=true}} + <:label> + {{t + "common.cgu.message" + cguUrl=this.cguUrl + dataProtectionPolicyUrl=this.dataProtectionPolicyUrl + htmlSafe=true + }} +
diff --git a/mon-pix/app/components/authentication/login-or-register-oidc.hbs b/mon-pix/app/components/authentication/login-or-register-oidc.hbs index 86919f74536..52c03ccd4d4 100644 --- a/mon-pix/app/components/authentication/login-or-register-oidc.hbs +++ b/mon-pix/app/components/authentication/login-or-register-oidc.hbs @@ -17,7 +17,12 @@
- {{t "common.cgu.message" cguUrl=this.cguUrl dataProtectionPolicyUrl=this.dataProtectionPolicyUrl htmlSafe=true}} + <:label>{{t + "common.cgu.message" + cguUrl=this.cguUrl + dataProtectionPolicyUrl=this.dataProtectionPolicyUrl + htmlSafe=true + }}
@@ -42,26 +47,30 @@
- + - {{/if}} {{else if (eq block.type "select")}} @@ -34,12 +36,13 @@ + > + <:label>{{block.ariaLabel}} + {{/if}} {{/each}} diff --git a/mon-pix/app/styles/components/_certification-joiner.scss b/mon-pix/app/styles/components/_certification-joiner.scss index 8d8d65fa895..a223e9f24fe 100644 --- a/mon-pix/app/styles/components/_certification-joiner.scss +++ b/mon-pix/app/styles/components/_certification-joiner.scss @@ -106,8 +106,6 @@ &__label { margin-bottom: 4px; - color: $pix-neutral-70; - font-size: 0.875rem; } .certification-course-page { diff --git a/mon-pix/app/styles/components/_challenge-item.scss b/mon-pix/app/styles/components/_challenge-item.scss index 86893b401b2..a3fdddf4e35 100644 --- a/mon-pix/app/styles/components/_challenge-item.scss +++ b/mon-pix/app/styles/components/_challenge-item.scss @@ -72,7 +72,7 @@ } &--input { - margin: $pix-spacing-xs; + margin: $pix-spacing-s $pix-spacing-xs; } } diff --git a/mon-pix/app/styles/components/_qrocm-proposals.scss b/mon-pix/app/styles/components/_qrocm-proposals.scss index 931175cf8f6..66019d295bc 100644 --- a/mon-pix/app/styles/components/_qrocm-proposals.scss +++ b/mon-pix/app/styles/components/_qrocm-proposals.scss @@ -3,10 +3,6 @@ display: inline; } - .challenge-response__proposal--input { - display: inline-flex; - } - &__input:first-of-type { .challenge-response__proposal--input { margin-top: 0; diff --git a/mon-pix/app/styles/components/authentication/_login-or-register-oidc.scss b/mon-pix/app/styles/components/authentication/_login-or-register-oidc.scss index 06169d9792e..0a624d86c5b 100644 --- a/mon-pix/app/styles/components/authentication/_login-or-register-oidc.scss +++ b/mon-pix/app/styles/components/authentication/_login-or-register-oidc.scss @@ -125,10 +125,13 @@ text-align: center; } - &__password-container { + &__input-container { display: flex; flex-direction: column; - padding: 20px 0; + + &--password { + padding: var(--pix-spacing-4x) 0; + } } &__forgotten-password-link { diff --git a/mon-pix/app/templates/terms-of-service.hbs b/mon-pix/app/templates/terms-of-service.hbs index fe9a87b32d1..1bf9766fa76 100644 --- a/mon-pix/app/templates/terms-of-service.hbs +++ b/mon-pix/app/templates/terms-of-service.hbs @@ -15,7 +15,9 @@ - {{t "pages.terms-of-service.cgu" htmlSafe=true}} + <:label> + {{t "pages.terms-of-service.cgu" htmlSafe=true}} + {{#if this.showErrorTermsOfServiceNotSelected}} diff --git a/mon-pix/app/utils/proposals-as-blocks.js b/mon-pix/app/utils/proposals-as-blocks.js index 66c995ec96e..ccfac5f6f9b 100644 --- a/mon-pix/app/utils/proposals-as-blocks.js +++ b/mon-pix/app/utils/proposals-as-blocks.js @@ -17,7 +17,9 @@ export default function proposalsAsBlocks(proposals) { const blocks = proposals.split(BLOCK).filter((line) => !isEmpty(line)); blocks.forEach((block) => { - buildLineFrom(block, challengeResponseTemplate); + if(!isEmpty(block.trim())) { + buildLineFrom(block, challengeResponseTemplate); + } }); challengeResponseTemplate.updateBlockDetails(); diff --git a/mon-pix/package-lock.json b/mon-pix/package-lock.json index 9df113909ff..d3fd250e6db 100644 --- a/mon-pix/package-lock.json +++ b/mon-pix/package-lock.json @@ -13,7 +13,7 @@ "@1024pix/ember-matomo-tag-manager": "^2.4.3", "@1024pix/ember-testing-library": "^1.1.0", "@1024pix/eslint-config": "^1.2.5", - "@1024pix/pix-ui": "^42.0.4", + "@1024pix/pix-ui": "^45.0.1", "@1024pix/stylelint-config": "^5.1.8", "@babel/eslint-parser": "^7.19.1", "@babel/plugin-proposal-decorators": "^7.20.2", @@ -153,9 +153,9 @@ "dev": true }, "node_modules/@1024pix/pix-ui": { - "version": "42.0.4", - "resolved": "https://registry.npmjs.org/@1024pix/pix-ui/-/pix-ui-42.0.4.tgz", - "integrity": "sha512-Qjz0ahnlqGS6My/+uk0b+OnOT2cAPnF2HTTnuVbLcxPA97+K+7NEaySGgPlFPUfZxU3YqlFT4VrlN7mkD/vrNA==", + "version": "45.0.1", + "resolved": "https://registry.npmjs.org/@1024pix/pix-ui/-/pix-ui-45.0.1.tgz", + "integrity": "sha512-WxDQPguTf8xf8DsEQY9sMWI6wQ087zpEtyndSzCUd2DqXlKVYGwrJhaJjjZ0enk/g0k3MjtvNEd36J0oNeF2jg==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -165,12 +165,12 @@ "ember-cli-htmlbars": "^6.1.1", "ember-cli-sass": "^11.0.1", "ember-click-outside": "^6.0.1", + "ember-lifeline": "^7.0.0", "ember-popperjs": "^3.0.0", - "ember-truth-helpers": "^4.0.0", - "lodash.debounce": "^4.0.8" + "ember-truth-helpers": "^4.0.0" }, "engines": { - "node": "^20.10.0" + "node": "^20.11.1" } }, "node_modules/@1024pix/stylelint-config": { diff --git a/mon-pix/package.json b/mon-pix/package.json index 052141faba1..cfa6097656b 100644 --- a/mon-pix/package.json +++ b/mon-pix/package.json @@ -45,7 +45,7 @@ "@1024pix/ember-matomo-tag-manager": "^2.4.3", "@1024pix/ember-testing-library": "^1.1.0", "@1024pix/eslint-config": "^1.2.5", - "@1024pix/pix-ui": "^42.0.4", + "@1024pix/pix-ui": "^45.0.1", "@1024pix/stylelint-config": "^5.1.8", "@babel/eslint-parser": "^7.19.1", "@babel/plugin-proposal-decorators": "^7.20.2", diff --git a/mon-pix/tests/acceptance/authentication/login_test.js b/mon-pix/tests/acceptance/authentication/login_test.js index 83ef363a6c2..bdef7b94f1e 100644 --- a/mon-pix/tests/acceptance/authentication/login_test.js +++ b/mon-pix/tests/acceptance/authentication/login_test.js @@ -20,14 +20,14 @@ module('Acceptance | Login', function (hooks) { // then assert.strictEqual(currentURL(), '/connexion'); assert.dom(screen.getByRole('heading', { name: this.intl.t('pages.sign-in.first-title'), level: 1 })).exists(); - assert.dom(screen.getByRole('button', { name: 'Français' })).exists(); + assert.dom(screen.getByRole('button', { name: 'Sélectionnez une langue' })).exists(); }); module('when the user select "English" as his language', function () { test('displays the login page with "English" as selected language', async function (assert) { // when const screen = await visit('/connexion'); - await click(screen.getByRole('button', { name: 'Français' })); + await click(screen.getByRole('button', { name: 'Sélectionnez une langue' })); await screen.findByRole('listbox'); await click(screen.getByRole('option', { name: 'English' })); @@ -36,7 +36,7 @@ module('Acceptance | Login', function (hooks) { assert .dom(screen.getByRole('heading', { name: this.intl.t('pages.sign-in.first-title'), level: 1 })) .exists(); - assert.dom(screen.getByRole('button', { name: 'English' })).exists(); + assert.dom(screen.getByRole('button', { name: 'Select a language' })).exists(); }); }); }); @@ -49,14 +49,14 @@ module('Acceptance | Login', function (hooks) { // then assert.strictEqual(currentURL(), '/connexion?lang=en'); assert.dom(screen.getByRole('heading', { name: this.intl.t('pages.sign-in.first-title'), level: 1 })).exists(); - assert.dom(screen.getByRole('button', { name: 'English' })).exists(); + assert.dom(screen.getByRole('button', { name: 'Select a language' })).exists(); }); module('when the user select "Français" as his language', function () { test('displays the login page with "Français" as selected language', async function (assert) { // given & when const screen = await visit('/connexion?lang=en'); - await click(screen.getByRole('button', { name: 'English' })); + await click(screen.getByRole('button', { name: 'Select a language' })); await screen.findByRole('listbox'); await click(screen.getByRole('option', { name: 'Français' })); @@ -65,7 +65,7 @@ module('Acceptance | Login', function (hooks) { assert .dom(screen.getByRole('heading', { name: this.intl.t('pages.sign-in.first-title'), level: 1 })) .exists(); - assert.dom(screen.getByRole('button', { name: 'Français' })).exists(); + assert.dom(screen.getByRole('button', { name: 'Sélectionnez une langue' })).exists(); }); }); }); diff --git a/mon-pix/tests/acceptance/campaigns/campaign-landing-page_test.js b/mon-pix/tests/acceptance/campaigns/campaign-landing-page_test.js index e8f8dabaf4c..fff44af4748 100644 --- a/mon-pix/tests/acceptance/campaigns/campaign-landing-page_test.js +++ b/mon-pix/tests/acceptance/campaigns/campaign-landing-page_test.js @@ -53,7 +53,7 @@ module('Acceptance | Campaigns | campaign-landing-page', function (hooks) { test('displays the fill in campaign code page with "English" as selected language', async function (assert) { // given & when const screen = await visit(`/campagnes/${campaign.code}`); - await click(screen.getByRole('button', { name: 'Français' })); + await click(screen.getByRole('button', { name: 'Sélectionnez une langue' })); await screen.findByRole('listbox'); await click(screen.getByRole('option', { name: 'English' })); @@ -78,7 +78,7 @@ module('Acceptance | Campaigns | campaign-landing-page', function (hooks) { test('displays the fill in campaign code page with "Français" as selected language', async function (assert) { // given & when const screen = await visit(`/campagnes/${campaign.code}?lang=en`); - await click(screen.getByRole('button', { name: 'English' })); + await click(screen.getByRole('button', { name: 'Select a language' })); await screen.findByRole('listbox'); await click(screen.getByRole('option', { name: 'Français' })); diff --git a/mon-pix/tests/acceptance/challenge-item-qcu_test.js b/mon-pix/tests/acceptance/challenge-item-qcu_test.js index 5595c1eaebc..3c46e00ebe0 100644 --- a/mon-pix/tests/acceptance/challenge-item-qcu_test.js +++ b/mon-pix/tests/acceptance/challenge-item-qcu_test.js @@ -38,21 +38,25 @@ module('Acceptance | Displaying a QCU challenge', function (hooks) { assert.ok(screen.getByText(qcuChallenge.instruction)); assert.strictEqual(screen.getAllByRole('radio', { name: /possibilite/ }).length, 4); - assert.strictEqual( - screen.getByRole('radio', { name: '1ere possibilite' }).nextElementSibling.innerHTML.trim(), - expectedProposals[0], + assert.true( + screen + .getByRole('radio', { name: '1ere possibilite' }) + .nextElementSibling.innerHTML.includes(expectedProposals[0]), ); - assert.strictEqual( - screen.getByRole('radio', { name: '2eme possibilite' }).nextElementSibling.innerHTML.trim(), - expectedProposals[1], + assert.true( + screen + .getByRole('radio', { name: '2eme possibilite' }) + .nextElementSibling.innerHTML.includes(expectedProposals[1]), ); - assert.strictEqual( - screen.getByRole('radio', { name: '3eme possibilite' }).nextElementSibling.innerHTML.trim(), - expectedProposals[2], + assert.true( + screen + .getByRole('radio', { name: '3eme possibilite' }) + .nextElementSibling.innerHTML.includes(expectedProposals[2]), ); - assert.strictEqual( - screen.getByRole('radio', { name: '4eme possibilite' }).nextElementSibling.innerHTML.trim(), - expectedProposals[3], + assert.true( + screen + .getByRole('radio', { name: '4eme possibilite' }) + .nextElementSibling.innerHTML.includes(expectedProposals[3]), ); assert.dom('.challenge-reponse__alert').doesNotExist(); }); diff --git a/mon-pix/tests/acceptance/challenge-item-qrocm_test.js b/mon-pix/tests/acceptance/challenge-item-qrocm_test.js index 0034645ffb9..747a9f44654 100644 --- a/mon-pix/tests/acceptance/challenge-item-qrocm_test.js +++ b/mon-pix/tests/acceptance/challenge-item-qrocm_test.js @@ -38,8 +38,8 @@ module('Acceptance | Displaying a QROCM challenge', function (hooks) { assert.dom('.challenge-response__proposal').exists({ count: 2 }); assert.false(findAll('.challenge-response__proposal input')[0].disabled); assert.false(findAll('.challenge-response__proposal input')[1].disabled); - assert.ok(screen.getByLabelText(/Station 1/)); - assert.ok(screen.getByLabelText(/Station 2/)); + assert.ok(screen.getByLabelText('Réponse 1')); + assert.ok(screen.getByLabelText('Réponse 2')); assert.dom('.challenge-response__alert').doesNotExist(); }); @@ -147,8 +147,8 @@ module('Acceptance | Displaying a QROCM challenge', function (hooks) { test('should set the input text with previous answers and propose to continue', async function (assert) { // then - const input1 = screen.getByLabelText(/Station 1/); - const input2 = screen.getByLabelText(/Station 2/); + const input1 = screen.getByLabelText('Réponse 1'); + const input2 = screen.getByLabelText('Réponse 2'); assert.strictEqual(input1.value, 'Republique'); assert.true(input1.disabled); assert.strictEqual(input2.value, 'Chatelet'); diff --git a/mon-pix/tests/acceptance/fill-in-campaign-code_test.js b/mon-pix/tests/acceptance/fill-in-campaign-code_test.js index 55e80bc374b..e5500a66657 100644 --- a/mon-pix/tests/acceptance/fill-in-campaign-code_test.js +++ b/mon-pix/tests/acceptance/fill-in-campaign-code_test.js @@ -164,7 +164,7 @@ module('Acceptance | Fill in campaign code page', function (hooks) { test('displays the fill in campaign code page with "English" as selected language', async function (assert) { // given & when const screen = await visit('/campagnes'); - await click(screen.getByRole('button', { name: 'Français' })); + await click(screen.getByRole('button', { name: 'Sélectionnez une langue' })); await screen.findByRole('listbox'); await click(screen.getByRole('option', { name: 'English' })); @@ -189,7 +189,7 @@ module('Acceptance | Fill in campaign code page', function (hooks) { test('displays the fill in campaign code page with "Français" as selected language', async function (assert) { // given & when const screen = await visit('/campagnes?lang=en'); - await click(screen.getByRole('button', { name: 'English' })); + await click(screen.getByRole('button', { name: 'Select a language' })); await screen.findByRole('listbox'); await click(screen.getByRole('option', { name: 'Français' })); diff --git a/mon-pix/tests/acceptance/inscription_test.js b/mon-pix/tests/acceptance/inscription_test.js index c1fec38b287..e9fa4cebea5 100644 --- a/mon-pix/tests/acceptance/inscription_test.js +++ b/mon-pix/tests/acceptance/inscription_test.js @@ -20,21 +20,21 @@ module('Acceptance | Inscription', function (hooks) { // then assert.strictEqual(currentURL(), '/inscription'); assert.dom(screen.getByRole('heading', { name: 'Inscrivez-vous', level: 1 })).exists(); - assert.dom(screen.getByRole('button', { name: 'Français' })).exists(); + assert.dom(screen.getByRole('button', { name: 'Sélectionnez une langue' })).exists(); }); module('when the user select "English" as his language', function () { test('displays the inscription page with "English" as selected language', async function (assert) { // given & when const screen = await visit('/inscription'); - await click(screen.getByRole('button', { name: 'Français' })); + await click(screen.getByRole('button', { name: 'Sélectionnez une langue' })); await screen.findByRole('listbox'); await click(screen.getByRole('option', { name: 'English' })); // then assert.strictEqual(currentURL(), '/inscription'); assert.dom(screen.getByRole('heading', { name: 'Sign up', level: 1 })).exists(); - assert.dom(screen.getByRole('button', { name: 'English' })).exists(); + assert.dom(screen.getByRole('button', { name: 'Select a language' })).exists(); }); }); }); @@ -47,21 +47,21 @@ module('Acceptance | Inscription', function (hooks) { // then assert.strictEqual(currentURL(), '/inscription?lang=en'); assert.dom(screen.getByRole('heading', { name: 'Sign up', level: 1 })).exists(); - assert.dom(screen.getByRole('button', { name: 'English' })).exists(); + assert.dom(screen.getByRole('button', { name: 'Select a language' })).exists(); }); module('when the user select "Français" as his language', function () { test('displays the inscription page with "Français" as selected language', async function (assert) { // given & when const screen = await visit('/inscription?lang=en'); - await click(screen.getByRole('button', { name: 'English' })); + await click(screen.getByRole('button', { name: 'Select a language' })); await screen.findByRole('listbox'); await click(screen.getByRole('option', { name: 'Français' })); // then assert.strictEqual(currentURL(), '/inscription'); assert.dom(screen.getByRole('heading', { name: 'Inscrivez-vous', level: 1 })).exists(); - assert.dom(screen.getByRole('button', { name: 'Français' })).exists(); + assert.dom(screen.getByRole('button', { name: 'Sélectionnez une langue' })).exists(); }); }); }); diff --git a/mon-pix/tests/acceptance/user-account_test.js b/mon-pix/tests/acceptance/user-account_test.js index 65603554a8e..2e1e8c4409e 100644 --- a/mon-pix/tests/acceptance/user-account_test.js +++ b/mon-pix/tests/acceptance/user-account_test.js @@ -101,9 +101,7 @@ module('Acceptance | User account page', function (hooks) { await click(screen.getByRole('link', { name: this.intl.t('pages.user-account.language.menu-link-title') })); // then - const languageSwitcherGeneric = screen.getByRole('generic', { - name: this.intl.t('pages.inscription.choose-language-aria-label'), - }); + const languageSwitcherGeneric = screen.getByRole('button', { name: 'Sélectionnez une langue' }); assert.strictEqual(currentURL(), '/mon-compte/langue'); assert.dom(languageSwitcherGeneric).exists(); diff --git a/mon-pix/tests/integration/components/certification-joiner_test.js b/mon-pix/tests/integration/components/certification-joiner_test.js index fa0d60d6fdc..bb09adfbe02 100644 --- a/mon-pix/tests/integration/components/certification-joiner_test.js +++ b/mon-pix/tests/integration/components/certification-joiner_test.js @@ -296,7 +296,9 @@ module('Integration | Component | certification-joiner', function (hooks) { this.set('onStepChange', sinon.stub()); const screen = await render(hbs``); const birthDayInput = screen.getByRole('spinbutton', { - name: this.intl.t('pages.certification-joiner.form.fields.birth-day'), + name: `${this.intl.t('pages.certification-joiner.form.fields.birth-date')} ${this.intl.t( + 'pages.certification-joiner.form.fields.birth-day', + )}`, }); // when @@ -354,7 +356,11 @@ module('Integration | Component | certification-joiner', function (hooks) { ' ' + 'de Pix', ); await fillIn( - screen.getByRole('spinbutton', { name: intl.t('pages.certification-joiner.form.fields.birth-day') }), + screen.getByRole('spinbutton', { + name: `${intl.t('pages.certification-joiner.form.fields.birth-date')} ${intl.t( + 'pages.certification-joiner.form.fields.birth-day', + )}`, + }), '02', ); await fillIn( diff --git a/mon-pix/tests/integration/components/language-switcher_test.js b/mon-pix/tests/integration/components/language-switcher_test.js index a67ef670d5a..69ac9cdadae 100644 --- a/mon-pix/tests/integration/components/language-switcher_test.js +++ b/mon-pix/tests/integration/components/language-switcher_test.js @@ -15,7 +15,7 @@ module('Integration | Component | Language Switcher', function (hooks) { const screen = await render(hbs``); // then - assert.dom(screen.getByRole('button', { name: 'English' })).exists(); + assert.dom(screen.getByRole('button', { name: 'Sélectionnez une langue' })).exists(); }); }); @@ -25,7 +25,7 @@ module('Integration | Component | Language Switcher', function (hooks) { const screen = await render(hbs``); // when - await click(screen.getByRole('button', { name: 'English' })); + await click(screen.getByRole('button', { name: 'Sélectionnez une langue' })); await screen.findByRole('listbox'); // then @@ -49,7 +49,7 @@ module('Integration | Component | Language Switcher', function (hooks) { />`); // when - await click(screen.getByRole('button', { name: 'English' })); + await click(screen.getByRole('button', { name: 'Sélectionnez une langue' })); await screen.findByRole('listbox'); await click(screen.getByRole('option', { name: 'Français' })); diff --git a/mon-pix/tests/integration/components/proposals/qrocm-proposal_test.js b/mon-pix/tests/integration/components/proposals/qrocm-proposal_test.js index 790392f3cae..da80d104a05 100644 --- a/mon-pix/tests/integration/components/proposals/qrocm-proposal_test.js +++ b/mon-pix/tests/integration/components/proposals/qrocm-proposal_test.js @@ -151,8 +151,8 @@ module('Integration | Component | QROCm proposal', function (hooks) { ); // then - assert.dom(screen.getByRole('textbox', { name: 'texte :' })).exists(); - assert.dom(screen.getByRole('textbox', { name: 'autre texte :' })).exists(); + assert.dom(screen.getByRole('textbox', { name: 'Réponse 1' })).exists(); + assert.dom(screen.getByRole('textbox', { name: 'Réponse 2' })).exists(); }); }); }); diff --git a/mon-pix/tests/integration/components/solution-panel/qroc-solution-panel_test.js b/mon-pix/tests/integration/components/solution-panel/qroc-solution-panel_test.js index e620b54376e..dc99035898b 100644 --- a/mon-pix/tests/integration/components/solution-panel/qroc-solution-panel_test.js +++ b/mon-pix/tests/integration/components/solution-panel/qroc-solution-panel_test.js @@ -26,10 +26,7 @@ module('Integration | Component | QROC solution panel', function (hooks) { assert.dom('input').doesNotExist(); assert.dom('textarea.correction-qroc-box-answer--paragraph').hasAttribute('disabled'); assert.strictEqual(find('textarea.correction-qroc-box-answer--paragraph').getAttribute('rows'), '5'); - assert.strictEqual( - find('textarea.correction-qroc-box-answer--paragraph').getAttribute('aria-label'), - 'Question passée', - ); + assert.dom(screen.getByLabelText('Question passée')); }); }); diff --git a/mon-pix/tests/integration/components/solution-panel/qrocm-dep-solution-panel_test.js b/mon-pix/tests/integration/components/solution-panel/qrocm-dep-solution-panel_test.js index 651f17be03d..01baaed73b1 100644 --- a/mon-pix/tests/integration/components/solution-panel/qrocm-dep-solution-panel_test.js +++ b/mon-pix/tests/integration/components/solution-panel/qrocm-dep-solution-panel_test.js @@ -200,12 +200,12 @@ module('Integration | Component | QROCm dep solution panel', function (hooks) { // Given this.setProperties(buildComponentArguments(FORMATS[2].format)); // When - await renderComponent(); + const screen = await renderComponent(); // Then assert.dom(INPUT).doesNotExist(); assert.dom(SENTENCE).doesNotExist(); assert.strictEqual(find(PARAGRAPH).tagName, 'TEXTAREA'); - assert.strictEqual(find(PARAGRAPH).getAttribute('aria-label'), 'La réponse donnée est valide'); + assert.ok(await screen.findAllByLabelText('La réponse donnée est valide')); assert.true(find(PARAGRAPH).hasAttribute('disabled')); }); }); @@ -215,12 +215,12 @@ module('Integration | Component | QROCm dep solution panel', function (hooks) { // Given this.setProperties(buildComponentArguments(FORMATS[1].format)); // When - await renderComponent(); + const screen = await renderComponent(); // Then assert.dom(INPUT).doesNotExist(); assert.dom(PARAGRAPH).doesNotExist(); assert.strictEqual(find(SENTENCE).tagName, 'INPUT'); - assert.strictEqual(find(SENTENCE).getAttribute('aria-label'), 'La réponse donnée est valide'); + assert.ok(await screen.findAllByLabelText('La réponse donnée est valide')); assert.true(find(SENTENCE).hasAttribute('disabled')); }); }); @@ -230,13 +230,13 @@ module('Integration | Component | QROCm dep solution panel', function (hooks) { // Given this.setProperties(buildComponentArguments(FORMATS[3].format)); // When - await renderComponent(); + const screen = await renderComponent(); // Then assert.dom(PARAGRAPH).doesNotExist(); assert.dom(SENTENCE).doesNotExist(); assert.strictEqual(find(INPUT).tagName, 'INPUT'); assert.strictEqual(find(INPUT).getAttribute('size'), '12'); - assert.strictEqual(find(INPUT).getAttribute('aria-label'), 'La réponse donnée est valide'); + assert.ok(await screen.findAllByLabelText('La réponse donnée est valide')); assert.true(find(INPUT).hasAttribute('disabled')); }); }); diff --git a/mon-pix/tests/integration/components/solution-panel/qrocm-ind-solution-panel_test.js b/mon-pix/tests/integration/components/solution-panel/qrocm-ind-solution-panel_test.js index dac8bf6ebf2..f2a4cd8e3d6 100644 --- a/mon-pix/tests/integration/components/solution-panel/qrocm-ind-solution-panel_test.js +++ b/mon-pix/tests/integration/components/solution-panel/qrocm-ind-solution-panel_test.js @@ -61,10 +61,10 @@ module('Integration | Component | QROCm ind solution panel', function (hooks) { test('should display the labels', function (assert) { const labels = screen.getAllByText((_, element) => element.tagName.toLowerCase() === 'label'); - assert.strictEqual(labels.length, 3); + assert.strictEqual(labels.length, 6); assert.strictEqual(labels[0].innerHTML.trim(), 'blabla :'); - assert.strictEqual(labels[1].innerHTML.trim(), '
Carte mémoire (SD) :'); - assert.strictEqual(labels[2].innerHTML.trim(), '
answer :'); + assert.strictEqual(labels[2].innerHTML.trim(), '
Carte mémoire (SD) :'); + assert.strictEqual(labels[4].innerHTML.trim(), '
answer :'); }); module('When the answer is correct', function () { @@ -161,7 +161,7 @@ module('Integration | Component | QROCm ind solution panel', function (hooks) { assert.strictEqual(find(INPUT).tagName, 'INPUT'); assert.strictEqual(find(INPUT).value, EMPTY_DEFAULT_MESSAGE); assert.strictEqual(find(INPUT).getAttribute('size'), EMPTY_DEFAULT_MESSAGE.length.toString()); - assert.strictEqual(find(INPUT).getAttribute('aria-label'), 'Question passée'); + assert.ok(screen.getByLabelText('Question passée')); assert.true(find(INPUT).hasAttribute('disabled')); }); }); @@ -184,7 +184,7 @@ module('Integration | Component | QROCm ind solution panel', function (hooks) { assert.dom(INPUT).doesNotExist(); assert.dom(SENTENCE).doesNotExist(); assert.strictEqual(find(PARAGRAPH).tagName, 'TEXTAREA'); - assert.strictEqual(find(PARAGRAPH).getAttribute('aria-label'), 'Question passée'); + assert.ok(screen.getByLabelText('Question passée')); assert.true(find(PARAGRAPH).hasAttribute('disabled')); }); }); @@ -207,7 +207,7 @@ module('Integration | Component | QROCm ind solution panel', function (hooks) { assert.dom(INPUT).doesNotExist(); assert.dom(PARAGRAPH).doesNotExist(); assert.strictEqual(find(SENTENCE).tagName, 'INPUT'); - assert.strictEqual(find(SENTENCE).getAttribute('aria-label'), 'Question passée'); + assert.ok(screen.getByLabelText('Question passée')); assert.true(find(SENTENCE).hasAttribute('disabled')); }); });