-
+
{{t "pages.missions.introduction-page.start-mission"}}
-
diff --git a/junior/public/images/icons/oralization-start.svg b/junior/public/images/icons/oralization-start.svg
new file mode 100644
index 00000000000..848c75032cb
--- /dev/null
+++ b/junior/public/images/icons/oralization-start.svg
@@ -0,0 +1,7 @@
+
diff --git a/junior/public/images/icons/oralization-stop.svg b/junior/public/images/icons/oralization-stop.svg
new file mode 100644
index 00000000000..ce80f8ab63d
--- /dev/null
+++ b/junior/public/images/icons/oralization-stop.svg
@@ -0,0 +1,9 @@
+
diff --git a/junior/tests/acceptance/display-challenge-test.js b/junior/tests/acceptance/display-challenge-test.js
index 8c6698e7c06..0b24c47b013 100644
--- a/junior/tests/acceptance/display-challenge-test.js
+++ b/junior/tests/acceptance/display-challenge-test.js
@@ -2,6 +2,7 @@ import { visit } from '@1024pix/ember-testing-library';
import { module, test } from 'qunit';
import { setupApplicationTest, t } from '../helpers';
+import identifyLearner from '../helpers/identify-learner';
module('Acceptance | Challenge', function (hooks) {
setupApplicationTest(hooks);
@@ -28,6 +29,23 @@ module('Acceptance | Challenge', function (hooks) {
assert.dom(screen.getByRole('button', { name: t('pages.challenge.actions.check') })).exists();
});
+ test('Should display the oralization button if learner has feature enabled', async function (assert) {
+ const oragnizationLearner = this.server.create('organization-learner', {
+ features: ['ORALIZATION'],
+ });
+ const assessment = this.server.create('assessment');
+ this.server.create('challenge', { instruction: ['1ère instruction', '2ème instruction'] });
+ this.server.create('activity', { assessmentId: assessment.id });
+
+ identifyLearner(this.owner, oragnizationLearner);
+
+ // when
+ const screen = await visit(`/assessments/${assessment.id}/challenges`);
+
+ // then
+ assert.strictEqual(screen.getAllByRole('button', { name: t('components.oralization-button.label') }).length, 2);
+ });
+
test('do not display skip button when activity level is TUTORIAL', async function (assert) {
const assessment = this.server.create('assessment');
const challenge = this.server.create('challenge', 'withInstruction');
diff --git a/junior/tests/acceptance/lesson-workflow-test.js b/junior/tests/acceptance/lesson-workflow-test.js
index 1b0f704a215..6074d151406 100644
--- a/junior/tests/acceptance/lesson-workflow-test.js
+++ b/junior/tests/acceptance/lesson-workflow-test.js
@@ -1,5 +1,4 @@
import { visit } from '@1024pix/ember-testing-library';
-// import { click } from '@ember/test-helpers';
import { module, test } from 'qunit';
import { setupApplicationTest, t } from '../helpers';
diff --git a/junior/tests/integration/bubble_test.gjs b/junior/tests/integration/bubble_test.gjs
index 352756e5baf..ed38ffff170 100644
--- a/junior/tests/integration/bubble_test.gjs
+++ b/junior/tests/integration/bubble_test.gjs
@@ -15,4 +15,14 @@ module('Integration | Component | Bubble', function (hooks) {
await render(
);
assert.dom('.bubble--success').exists();
});
+
+ test('displays bubble with oralization button', async function (assert) {
+ await render(
);
+ assert.dom('.oralization-container').exists();
+ });
+
+ test('displays bubble without oralization button', async function (assert) {
+ await render(
);
+ assert.dom('.oralization-container').doesNotExist();
+ });
});
diff --git a/junior/tests/integration/challenge_test.js b/junior/tests/integration/challenge_test.js
new file mode 100644
index 00000000000..7e0f3bb5097
--- /dev/null
+++ b/junior/tests/integration/challenge_test.js
@@ -0,0 +1,32 @@
+import { render } from '@1024pix/ember-testing-library';
+import { hbs } from 'ember-cli-htmlbars';
+import { t } from 'ember-intl/test-support';
+import { setupRenderingTest } from 'junior/helpers/tests';
+import { module, test } from 'qunit';
+
+module('Integration | Component | Challenge', function (hooks) {
+ setupRenderingTest(hooks);
+
+ module('if learner has oralization feature', function () {
+ test('should display oralization buttons on instruction bubbles', async function (assert) {
+ this.set('challenge', { instruction: ['1ère instruction', '2ème instruction'] });
+ const screen = await render(hbs`
+
+`);
+
+ assert.strictEqual(screen.getAllByText(t('components.oralization-button.play')).length, 2);
+ });
+ });
+ module('if learner has not oralization feature', function () {
+ test('should not display oralization buttons', async function (assert) {
+ const store = this.owner.lookup('service:store');
+ this.set('organizationLearner', store.createRecord('organization-learner', { features: [] }));
+ this.set('challenge', { instruction: ['1ère instruction', '2ème instruction'] });
+ const screen = await render(hbs`
+
+`);
+
+ assert.dom(screen.queryByText(t('components.oralization-button.play'))).doesNotExist();
+ });
+ });
+});
diff --git a/junior/translations/fr.json b/junior/translations/fr.json
index ad682feafb0..0e770f64a3f 100644
--- a/junior/translations/fr.json
+++ b/junior/translations/fr.json
@@ -8,6 +8,13 @@
"student-data-protection-policy-url": "https://pix.fr/politique-protection-donnees-personnelles-app-eleves"
}
},
+ "components": {
+ "oralization-button": {
+ "play": "J'écoute",
+ "stop": "Stop",
+ "label": "Lire la consigne à haute voix"
+ }
+ },
"pages": {
"pix-junior": "Pix Junior",
"challenge": {