Skip to content

Commit

Permalink
fix(orga): translate text for use in component
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre-Monney authored Mar 6, 2025
1 parent 0387888 commit aa65217
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions orga/app/components/campaign/create-form.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand All @@ -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', {
Expand All @@ -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')));
Expand Down

0 comments on commit aa65217

Please sign in to comment.