Skip to content

Commit 7bfd71c

Browse files
feat(orga): display simplifiedAccess info on campaign settings
1 parent f13c171 commit 7bfd71c

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

orga/app/components/campaign/settings/target-profile-tooltip.gjs

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import TargetProfileDetails from '../target-profile-details';
2323
@hasBadges={{@hasBadges}}
2424
@targetProfileTubesCount={{@targetProfileTubesCount}}
2525
@targetProfileThematicResultCount={{@targetProfileThematicResultCount}}
26+
@simplifiedAccess={{@simplifiedAccess}}
2627
/>
2728
</:tooltip>
2829
</PixTooltip>

orga/app/components/campaign/settings/view.gjs

+1
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ export default class CampaignView extends Component {
172172
@hasBadges={{@campaign.hasBadges}}
173173
@targetProfileTubesCount={{@campaign.targetProfileTubesCount}}
174174
@targetProfileThematicResultCount={{@campaign.targetProfileThematicResultCount}}
175+
@simplifiedAccess={{@campaign.targetProfile.isSimplifiedAccess}}
175176
/>
176177
</dd>
177178
</div>

orga/tests/integration/components/campaign/settings/view-test.js

+32
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,38 @@ module('Integration | Component | Campaign::Settings::View', function (hooks) {
119119
.exists();
120120
});
121121

122+
test('it should display with account when simplified access is false', async function (assert) {
123+
// given
124+
this.campaign = store.createRecord('campaign', {
125+
type: 'ASSESSMENT',
126+
targetProfile: store.createRecord('target-profile', {
127+
isSimplifiedAccess: false,
128+
}),
129+
});
130+
131+
// when
132+
const screen = await render(hbs`<Campaign::Settings::View @campaign={{this.campaign}} />`);
133+
134+
// then
135+
assert.ok(screen.getByText(t('common.target-profile-details.simplified-access.with-account')));
136+
});
137+
138+
test('it should display without account when simplified access is true', async function (assert) {
139+
// given
140+
this.campaign = store.createRecord('campaign', {
141+
type: 'ASSESSMENT',
142+
targetProfile: store.createRecord('target-profile', {
143+
isSimplifiedAccess: true,
144+
}),
145+
});
146+
147+
// when
148+
const screen = await render(hbs`<Campaign::Settings::View @campaign={{this.campaign}} />`);
149+
150+
// then
151+
assert.ok(screen.getByText(t('common.target-profile-details.simplified-access.without-account')));
152+
});
153+
122154
module('Badge context', function () {
123155
test('it should not display target profile thematic result when empty related to campaign', async function (assert) {
124156
// given

0 commit comments

Comments
 (0)