From aa652178cb48ad67fcd1029412cdc9783c97482b Mon Sep 17 00:00:00 2001 From: Alexandre Monney Date: Tue, 4 Mar 2025 18:02:45 +0100 Subject: [PATCH] fix(orga): translate text for use in component --- orga/app/components/campaign/create-form.gjs | 4 ++-- .../integration/components/campaign/create-form-test.js | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/orga/app/components/campaign/create-form.gjs b/orga/app/components/campaign/create-form.gjs index fef9c04a0b3..52a088f47f4 100644 --- a/orga/app/components/campaign/create-form.gjs +++ b/orga/app/components/campaign/create-form.gjs @@ -42,8 +42,8 @@ export default class CreateForm extends Component { category: this.intl.t(`pages.campaign-creation.tags.${targetProfile.category}`), icon: targetProfile.isSimplifiedAccess ? 'accountOff' : 'users', iconTitle: targetProfile.isSimplifiedAccess - ? 'common.target-profile-details.simplified-access.without-account' - : 'common.target-profile-details.simplified-access.with-account', + ? this.intl.t('common.target-profile-details.simplified-access.without-account') + : this.intl.t('common.target-profile-details.simplified-access.with-account'), order: 'OTHER' === targetProfile.category ? 1 : 0, }; }); diff --git a/orga/tests/integration/components/campaign/create-form-test.js b/orga/tests/integration/components/campaign/create-form-test.js index da665c09fe7..8146b277792 100644 --- a/orga/tests/integration/components/campaign/create-form-test.js +++ b/orga/tests/integration/components/campaign/create-form-test.js @@ -394,7 +394,7 @@ module('Integration | Component | Campaign::CreateForm', function (hooks) { }); module('simplified access', function () { - test('it should display with simplified access', async function (assert) { + test('it should display with simplified access label in options list', async function (assert) { // given this.targetProfiles = [ store.createRecord('target-profile', { @@ -421,13 +421,12 @@ module('Integration | Component | Campaign::CreateForm', function (hooks) { await click( screen.getByLabelText(t('pages.campaign-creation.target-profiles-list-label'), { exact: false }), ); - await click(await screen.findByRole('option', { description: 'targetProfile1' })); // then assert.ok(screen.getByText(t('common.target-profile-details.simplified-access.without-account'))); }); - test('it should display without simplified access', async function (assert) { + test('it should display without simplified access label in options list', async function (assert) { // given this.targetProfiles = [ store.createRecord('target-profile', { @@ -453,7 +452,6 @@ module('Integration | Component | Campaign::CreateForm', function (hooks) { await click( screen.getByLabelText(t('pages.campaign-creation.target-profiles-list-label'), { exact: false }), ); - await click(await screen.findByRole('option', { description: 'targetProfile1' })); // then assert.ok(screen.getByText(t('common.target-profile-details.simplified-access.with-account')));