@coorpacademy/player-web 4.22.6 → 4.22.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/package.json +3 -4
  2. package/es/map-state-to-props/test/answer.js +0 -391
  3. package/es/map-state-to-props/test/answer.js.map +0 -1
  4. package/es/map-state-to-props/test/fixtures/player/clue.json +0 -131
  5. package/es/map-state-to-props/test/fixtures/player/loading-clue.json +0 -131
  6. package/es/map-state-to-props/test/fixtures/player/no-clue.json +0 -118
  7. package/es/map-state-to-props/test/fixtures/player/slide-no-lessons.json +0 -115
  8. package/es/map-state-to-props/test/fixtures/player/slide.json +0 -127
  9. package/es/map-state-to-props/test/fixtures/popin-correction/popin-extra-life.json +0 -139
  10. package/es/map-state-to-props/test/fixtures/popin-correction/popin-failure.json +0 -145
  11. package/es/map-state-to-props/test/fixtures/popin-correction/popin-next-level.json +0 -282
  12. package/es/map-state-to-props/test/fixtures/popin-correction/popin-revival.json +0 -140
  13. package/es/map-state-to-props/test/fixtures/popin-correction/popin-success-node.json +0 -154
  14. package/es/map-state-to-props/test/fixtures/popin-correction/popin-success.json +0 -268
  15. package/es/map-state-to-props/test/fixtures/popin-correction/state-fail-multiple-answers.json +0 -473
  16. package/es/map-state-to-props/test/fixtures/popin-end/fail.json +0 -205
  17. package/es/map-state-to-props/test/fixtures/popin-end/learner-adaptive-failure.json +0 -209
  18. package/es/map-state-to-props/test/fixtures/popin-end/learner-failure-with-redirection.json +0 -211
  19. package/es/map-state-to-props/test/fixtures/popin-end/learner-failure.json +0 -211
  20. package/es/map-state-to-props/test/fixtures/popin-end/learner-success-with-redirection.json +0 -278
  21. package/es/map-state-to-props/test/fixtures/popin-end/learner-success.json +0 -275
  22. package/es/map-state-to-props/test/fixtures/popin-end/success.json +0 -223
  23. package/es/map-state-to-props/test/fixtures/progression-learner.json +0 -102
  24. package/es/map-state-to-props/test/fixtures/progression-state.json +0 -45
  25. package/es/map-state-to-props/test/fixtures/slides/basic.json +0 -60
  26. package/es/map-state-to-props/test/fixtures/slides/plop.json +0 -56
  27. package/es/map-state-to-props/test/fixtures/slides/qcm-drag.json +0 -56
  28. package/es/map-state-to-props/test/fixtures/slides/qcm-graphic.json +0 -49
  29. package/es/map-state-to-props/test/fixtures/slides/qcm.json +0 -43
  30. package/es/map-state-to-props/test/fixtures/slides/slider.json +0 -57
  31. package/es/map-state-to-props/test/fixtures/slides/template.json +0 -49
  32. package/es/map-state-to-props/test/fixtures/slides/videos.json +0 -163
  33. package/es/map-state-to-props/test/fixtures/slides/with-context.json +0 -69
  34. package/es/map-state-to-props/test/header.js +0 -131
  35. package/es/map-state-to-props/test/header.js.map +0 -1
  36. package/es/map-state-to-props/test/index.js +0 -107
  37. package/es/map-state-to-props/test/index.js.map +0 -1
  38. package/es/map-state-to-props/test/player.js +0 -680
  39. package/es/map-state-to-props/test/player.js.map +0 -1
  40. package/es/map-state-to-props/test/popin-correction.create-header-cta.js +0 -301
  41. package/es/map-state-to-props/test/popin-correction.create-header-cta.js.map +0 -1
  42. package/es/map-state-to-props/test/popin-correction.js +0 -80
  43. package/es/map-state-to-props/test/popin-correction.js.map +0 -1
  44. package/es/map-state-to-props/test/popin-end.js +0 -313
  45. package/es/map-state-to-props/test/popin-end.js.map +0 -1
  46. package/es/map-state-to-props/test/popin-error.js +0 -77
  47. package/es/map-state-to-props/test/popin-error.js.map +0 -1
  48. package/es/map-state-to-props/test/resources.js +0 -31
  49. package/es/map-state-to-props/test/resources.js.map +0 -1
  50. package/es/test/add-timeout.js +0 -8
  51. package/es/test/add-timeout.js.map +0 -1
  52. package/es/test/helpers/css-register.js +0 -3
  53. package/es/test/helpers/css-register.js.map +0 -1
  54. package/es/test/helpers/macro.js +0 -6
  55. package/es/test/helpers/macro.js.map +0 -1
  56. package/es/test/index.js +0 -39
  57. package/es/test/index.js.map +0 -1
  58. package/es/test/init-reducers.js +0 -50
  59. package/es/test/init-reducers.js.map +0 -1
  60. package/es/test/locales.js +0 -8
  61. package/es/test/locales.js.map +0 -1
  62. package/es/test/run-app.js +0 -20
  63. package/es/test/run-app.js.map +0 -1
  64. package/es/test/store.js +0 -38
  65. package/es/test/store.js.map +0 -1
  66. package/es/views/test/helpers/render.js +0 -13
  67. package/es/views/test/helpers/render.js.map +0 -1
  68. package/es/views/test/helpers/state-to-vnode.js +0 -7
  69. package/es/views/test/helpers/state-to-vnode.js.map +0 -1
  70. package/es/views/test/loading.js +0 -15
  71. package/es/views/test/loading.js.map +0 -1
  72. package/es/views/test/popin-correction.js +0 -223
  73. package/es/views/test/popin-correction.js.map +0 -1
  74. package/es/views/test/popin-end.js +0 -93
  75. package/es/views/test/popin-end.js.map +0 -1
  76. package/es/views/test/router.js +0 -22
  77. package/es/views/test/router.js.map +0 -1
  78. package/es/views/test/slide.js +0 -339
  79. package/es/views/test/slide.js.map +0 -1
  80. package/lib/map-state-to-props/test/answer.js +0 -409
  81. package/lib/map-state-to-props/test/answer.js.map +0 -1
  82. package/lib/map-state-to-props/test/fixtures/player/clue.json +0 -131
  83. package/lib/map-state-to-props/test/fixtures/player/loading-clue.json +0 -131
  84. package/lib/map-state-to-props/test/fixtures/player/no-clue.json +0 -118
  85. package/lib/map-state-to-props/test/fixtures/player/slide-no-lessons.json +0 -115
  86. package/lib/map-state-to-props/test/fixtures/player/slide.json +0 -127
  87. package/lib/map-state-to-props/test/fixtures/popin-correction/popin-extra-life.json +0 -139
  88. package/lib/map-state-to-props/test/fixtures/popin-correction/popin-failure.json +0 -145
  89. package/lib/map-state-to-props/test/fixtures/popin-correction/popin-next-level.json +0 -282
  90. package/lib/map-state-to-props/test/fixtures/popin-correction/popin-revival.json +0 -140
  91. package/lib/map-state-to-props/test/fixtures/popin-correction/popin-success-node.json +0 -154
  92. package/lib/map-state-to-props/test/fixtures/popin-correction/popin-success.json +0 -268
  93. package/lib/map-state-to-props/test/fixtures/popin-correction/state-fail-multiple-answers.json +0 -473
  94. package/lib/map-state-to-props/test/fixtures/popin-end/fail.json +0 -205
  95. package/lib/map-state-to-props/test/fixtures/popin-end/learner-adaptive-failure.json +0 -209
  96. package/lib/map-state-to-props/test/fixtures/popin-end/learner-failure-with-redirection.json +0 -211
  97. package/lib/map-state-to-props/test/fixtures/popin-end/learner-failure.json +0 -211
  98. package/lib/map-state-to-props/test/fixtures/popin-end/learner-success-with-redirection.json +0 -278
  99. package/lib/map-state-to-props/test/fixtures/popin-end/learner-success.json +0 -275
  100. package/lib/map-state-to-props/test/fixtures/popin-end/success.json +0 -223
  101. package/lib/map-state-to-props/test/fixtures/progression-learner.json +0 -102
  102. package/lib/map-state-to-props/test/fixtures/progression-state.json +0 -45
  103. package/lib/map-state-to-props/test/fixtures/slides/basic.json +0 -60
  104. package/lib/map-state-to-props/test/fixtures/slides/plop.json +0 -56
  105. package/lib/map-state-to-props/test/fixtures/slides/qcm-drag.json +0 -56
  106. package/lib/map-state-to-props/test/fixtures/slides/qcm-graphic.json +0 -49
  107. package/lib/map-state-to-props/test/fixtures/slides/qcm.json +0 -43
  108. package/lib/map-state-to-props/test/fixtures/slides/slider.json +0 -57
  109. package/lib/map-state-to-props/test/fixtures/slides/template.json +0 -49
  110. package/lib/map-state-to-props/test/fixtures/slides/videos.json +0 -163
  111. package/lib/map-state-to-props/test/fixtures/slides/with-context.json +0 -69
  112. package/lib/map-state-to-props/test/header.js +0 -143
  113. package/lib/map-state-to-props/test/header.js.map +0 -1
  114. package/lib/map-state-to-props/test/index.js +0 -100
  115. package/lib/map-state-to-props/test/index.js.map +0 -1
  116. package/lib/map-state-to-props/test/player.js +0 -714
  117. package/lib/map-state-to-props/test/player.js.map +0 -1
  118. package/lib/map-state-to-props/test/popin-correction.create-header-cta.js +0 -315
  119. package/lib/map-state-to-props/test/popin-correction.create-header-cta.js.map +0 -1
  120. package/lib/map-state-to-props/test/popin-correction.js +0 -85
  121. package/lib/map-state-to-props/test/popin-correction.js.map +0 -1
  122. package/lib/map-state-to-props/test/popin-end.js +0 -328
  123. package/lib/map-state-to-props/test/popin-end.js.map +0 -1
  124. package/lib/map-state-to-props/test/popin-error.js +0 -85
  125. package/lib/map-state-to-props/test/popin-error.js.map +0 -1
  126. package/lib/map-state-to-props/test/resources.js +0 -42
  127. package/lib/map-state-to-props/test/resources.js.map +0 -1
  128. package/lib/test/add-timeout.js +0 -14
  129. package/lib/test/add-timeout.js.map +0 -1
  130. package/lib/test/helpers/css-register.js +0 -8
  131. package/lib/test/helpers/css-register.js.map +0 -1
  132. package/lib/test/helpers/macro.js +0 -12
  133. package/lib/test/helpers/macro.js.map +0 -1
  134. package/lib/test/index.js +0 -53
  135. package/lib/test/index.js.map +0 -1
  136. package/lib/test/init-reducers.js +0 -57
  137. package/lib/test/init-reducers.js.map +0 -1
  138. package/lib/test/locales.js +0 -18
  139. package/lib/test/locales.js.map +0 -1
  140. package/lib/test/run-app.js +0 -27
  141. package/lib/test/run-app.js.map +0 -1
  142. package/lib/test/store.js +0 -45
  143. package/lib/test/store.js.map +0 -1
  144. package/lib/views/test/helpers/render.js +0 -24
  145. package/lib/views/test/helpers/render.js.map +0 -1
  146. package/lib/views/test/helpers/state-to-vnode.js +0 -14
  147. package/lib/views/test/helpers/state-to-vnode.js.map +0 -1
  148. package/lib/views/test/loading.js +0 -22
  149. package/lib/views/test/loading.js.map +0 -1
  150. package/lib/views/test/popin-correction.js +0 -237
  151. package/lib/views/test/popin-correction.js.map +0 -1
  152. package/lib/views/test/popin-end.js +0 -105
  153. package/lib/views/test/popin-end.js.map +0 -1
  154. package/lib/views/test/router.js +0 -32
  155. package/lib/views/test/router.js.map +0 -1
  156. package/lib/views/test/slide.js +0 -363
  157. package/lib/views/test/slide.js.map +0 -1
@@ -1,409 +0,0 @@
1
- "use strict";
2
-
3
- var _pick2 = _interopRequireDefault(require("lodash/fp/pick"));
4
-
5
- var _map2 = _interopRequireDefault(require("lodash/fp/map"));
6
-
7
- var _pipe2 = _interopRequireDefault(require("lodash/fp/pipe"));
8
-
9
- var _sortBy2 = _interopRequireDefault(require("lodash/fp/sortBy"));
10
-
11
- var _identity2 = _interopRequireDefault(require("lodash/fp/identity"));
12
-
13
- var _isFunction2 = _interopRequireDefault(require("lodash/fp/isFunction"));
14
-
15
- var _omit2 = _interopRequireDefault(require("lodash/fp/omit"));
16
-
17
- var _ava = _interopRequireDefault(require("ava"));
18
-
19
- var _translate = require("@coorpacademy/translate");
20
-
21
- var _answer = require("../answer");
22
-
23
- var _basic = _interopRequireDefault(require("./fixtures/slides/basic"));
24
-
25
- var _qcm = _interopRequireDefault(require("./fixtures/slides/qcm"));
26
-
27
- var _qcmDrag = _interopRequireDefault(require("./fixtures/slides/qcm-drag"));
28
-
29
- var _qcmGraphic = _interopRequireDefault(require("./fixtures/slides/qcm-graphic"));
30
-
31
- var _template = _interopRequireDefault(require("./fixtures/slides/template"));
32
-
33
- var _slider = _interopRequireDefault(require("./fixtures/slides/slider"));
34
-
35
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
36
-
37
- const options = {
38
- translate: _translate.mockTranslate
39
- };
40
- const store = {
41
- dispatch: _identity2.default
42
- };
43
- const getAnswerProps = (0, _answer.createGetAnswerProps)(options, store);
44
- const getHelp = (0, _answer.createGetHelp)(options, store);
45
- (0, _ava.default)('should create initial qcm props', t => {
46
- t.plan(3);
47
- const state = {
48
- ui: {
49
- current: {
50
- progressionId: '1234'
51
- }
52
- }
53
- };
54
-
55
- const _getAnswerProps = (0, _answer.createGetAnswerProps)(options, {
56
- dispatch: thunk => {
57
- t.true((0, _isFunction2.default)(thunk));
58
- }
59
- });
60
-
61
- const props = _getAnswerProps(state, _qcm.default);
62
-
63
- t.is(props.type, 'qcm');
64
- t.true(props.answers.every(answer => answer.selected === false));
65
- props.answers[0].onClick();
66
- });
67
- (0, _ava.default)('should create edited qcm props', t => {
68
- const state = {
69
- ui: {
70
- answers: {
71
- 1234: {
72
- value: ['Case 1', 'Case 3']
73
- }
74
- },
75
- current: {
76
- progressionId: '1234'
77
- }
78
- }
79
- };
80
- const props = getAnswerProps(state, _qcm.default);
81
- t.is(props.type, 'qcm');
82
- t.is(props.answers.length, 4);
83
- t.is(props.answers[0].title, 'Case 1');
84
- t.true(props.answers[0].selected);
85
- t.is(props.answers[1].title, 'Case 2');
86
- t.false(props.answers[1].selected);
87
- t.is(props.answers[2].title, 'Case 3');
88
- t.true(props.answers[2].selected);
89
- t.is(props.answers[3].title, 'Case 4');
90
- t.false(props.answers[3].selected);
91
- t.true((0, _isFunction2.default)(props.answers[0].onClick));
92
- });
93
- (0, _ava.default)('should create edited template props', t => {
94
- t.plan(24);
95
- const state = {
96
- ui: {
97
- answers: {
98
- 1234: {
99
- value: ['foo', 'exclusive']
100
- }
101
- },
102
- current: {
103
- progressionId: '1234'
104
- }
105
- }
106
- };
107
-
108
- const _getAnswerProps = (0, _answer.createGetAnswerProps)(options, {
109
- dispatch: thunk => {
110
- t.true((0, _isFunction2.default)(thunk));
111
- }
112
- });
113
-
114
- const props = _getAnswerProps(state, _template.default);
115
-
116
- t.is(props.type, 'template');
117
- t.is(props.template, 'The answer is {{inp81438}} {{sel31191}}');
118
- t.true(Array.isArray(props.answers));
119
- t.is(props.answers.length, 2);
120
- t.is(props.answers[0].type, 'text');
121
- t.is(props.answers[0].name, 'inp81438');
122
- t.is(props.answers[0].placeholder, '__Type here');
123
- t.is(props.answers[0].value, 'foo');
124
- t.true((0, _isFunction2.default)(props.answers[0].onChange));
125
- t.is(props.answers[1].type, 'select');
126
- t.is(props.answers[1].name, 'sel31191');
127
- t.is(props.answers[1]['aria-label'], '__Select an answer');
128
- t.true((0, _isFunction2.default)(props.answers[1].onChange));
129
- const selectOptions = props.answers[1].options;
130
- t.true(Array.isArray(selectOptions));
131
- t.is(selectOptions.length, 2);
132
- t.is(selectOptions[0].name, 'temporary');
133
- t.is(selectOptions[0].value, 'temporary');
134
- t.false(selectOptions[0].selected);
135
- t.true(selectOptions[0].validOption);
136
- t.is(selectOptions[1].name, 'exclusive');
137
- t.is(selectOptions[1].value, 'exclusive');
138
- t.true(selectOptions[1].selected);
139
- t.true(selectOptions[1].validOption);
140
- props.answers[1].onChange();
141
- });
142
- (0, _ava.default)('should add an invalid `select an answer` choice for a select field in a template question if there are no answers for it', t => {
143
- t.plan(13);
144
- const state = {
145
- ui: {
146
- answers: {},
147
- current: {
148
- progressionId: '1234'
149
- }
150
- }
151
- };
152
-
153
- const _getAnswerProps = (0, _answer.createGetAnswerProps)(options, {
154
- dispatch: thunk => {
155
- t.true((0, _isFunction2.default)(thunk));
156
- }
157
- });
158
-
159
- const props = _getAnswerProps(state, _template.default);
160
-
161
- const selectOptions = props.answers[1].options;
162
- t.is(selectOptions.length, 3);
163
- t.is(selectOptions[0].name, '__Select an answer');
164
- t.true(selectOptions[0].selected);
165
- t.false(selectOptions[0].validOption);
166
- t.is(selectOptions[1].name, 'temporary');
167
- t.is(selectOptions[1].value, 'temporary');
168
- t.false(selectOptions[1].selected);
169
- t.true(selectOptions[1].validOption);
170
- t.is(selectOptions[2].name, 'exclusive');
171
- t.is(selectOptions[2].value, 'exclusive');
172
- t.false(selectOptions[2].selected);
173
- t.true(selectOptions[2].validOption);
174
- props.answers[1].onChange();
175
- });
176
- (0, _ava.default)('should create initial qcmGraphic props', t => {
177
- const state = {
178
- ui: {
179
- answers: {},
180
- current: {
181
- progressionId: '1234'
182
- }
183
- }
184
- };
185
- const props = getAnswerProps(state, _qcmGraphic.default);
186
- t.is(props.type, 'qcmGraphic');
187
- t.is(props.answers.length, 2);
188
- t.true(props.answers.every(answer => answer.selected === false));
189
- });
190
- (0, _ava.default)('should create edited qcmGraphic props', t => {
191
- t.plan(5);
192
- const state = {
193
- data: {
194
- configs: {
195
- entities: {
196
- 'learner@2': {
197
- version: '2',
198
- shuffleChoices: true
199
- }
200
- }
201
- },
202
- progressions: {
203
- entities: {
204
- 1234: {
205
- engine: {
206
- ref: 'learner',
207
- version: '2'
208
- }
209
- }
210
- }
211
- }
212
- },
213
- ui: {
214
- answers: {
215
- 1234: {
216
- value: ['Vrai']
217
- }
218
- },
219
- current: {
220
- progressionId: '1234'
221
- }
222
- }
223
- };
224
-
225
- const _getAnswerProps = (0, _answer.createGetAnswerProps)(options, {
226
- dispatch: thunk => {
227
- t.true((0, _isFunction2.default)(thunk));
228
- }
229
- });
230
-
231
- const props = _getAnswerProps(state, _qcmGraphic.default);
232
-
233
- t.is(props.type, 'qcmGraphic');
234
- t.is(props.answers.length, 2);
235
- const answers = (0, _pipe2.default)((0, _map2.default)((0, _pick2.default)(['title', 'selected'])), (0, _sortBy2.default)('title'))(props.answers);
236
- t.deepEqual(answers, [{
237
- title: 'Faux',
238
- selected: false
239
- }, {
240
- title: 'Vrai',
241
- selected: true
242
- }]);
243
- t.true((0, _isFunction2.default)(props.answers[0].onClick));
244
- props.answers[0].onClick();
245
- });
246
- (0, _ava.default)('should create initial qcmDrag props', t => {
247
- const state = {
248
- ui: {
249
- answers: {},
250
- current: {
251
- progressionId: '1234'
252
- }
253
- }
254
- };
255
- const props = getAnswerProps(state, _qcmDrag.default);
256
- t.is(props.type, 'qcmDrag');
257
- t.is(props.answers.length, 3);
258
- t.is(props.answers[0].title, "L'ordinateur");
259
- t.false(props.answers[0].selected);
260
- t.true((0, _isFunction2.default)(props.answers[0].onClick));
261
- t.is(props.answers[1].title, 'La tablette');
262
- t.false(props.answers[1].selected);
263
- t.true((0, _isFunction2.default)(props.answers[1].onClick));
264
- t.is(props.answers[2].title, 'Le smartphone');
265
- t.false(props.answers[2].selected);
266
- t.true((0, _isFunction2.default)(props.answers[2].onClick));
267
- });
268
- (0, _ava.default)('should create edited qcmDrag props', t => {
269
- t.plan(14);
270
- const state = {
271
- ui: {
272
- answers: {
273
- 1234: {
274
- value: ['Le smartphone', "L'ordinateur"]
275
- }
276
- },
277
- current: {
278
- progressionId: '1234'
279
- }
280
- }
281
- };
282
-
283
- const _getAnswerProps = (0, _answer.createGetAnswerProps)(options, {
284
- dispatch: thunk => {
285
- t.true((0, _isFunction2.default)(thunk));
286
- }
287
- });
288
-
289
- const props = _getAnswerProps(state, _qcmDrag.default);
290
-
291
- t.is(props.type, 'qcmDrag');
292
- t.is(props.answers.length, 3);
293
- t.is(props.answers[0].title, "L'ordinateur");
294
- t.true(props.answers[0].selected);
295
- t.is(props.answers[0].order, 1);
296
- t.true((0, _isFunction2.default)(props.answers[0].onClick));
297
- t.is(props.answers[1].title, 'La tablette');
298
- t.false(props.answers[1].selected);
299
- t.true((0, _isFunction2.default)(props.answers[1].onClick));
300
- t.is(props.answers[2].title, 'Le smartphone');
301
- t.true(props.answers[2].selected);
302
- t.is(props.answers[2].order, 0);
303
- t.true((0, _isFunction2.default)(props.answers[2].onClick));
304
- props.answers[2].onClick();
305
- });
306
- (0, _ava.default)('should create initial slider props', t => {
307
- t.plan(8);
308
- const state = {
309
- ui: {
310
- answers: {},
311
- current: {
312
- progressionId: '1234'
313
- }
314
- }
315
- };
316
-
317
- const dispatch = action => {
318
- t.pass();
319
- };
320
-
321
- const props = (0, _answer.createGetAnswerProps)(options, {
322
- dispatch
323
- })(state, _slider.default);
324
- t.is(props.type, 'slider');
325
- t.is(props.placeholder, 'Déplacez le curseur.');
326
- t.is(props.minLabel, '0 an(s)');
327
- t.is(props.maxLabel, '1000 an(s)');
328
- t.is(props.title, '500 an(s)');
329
- t.is(props.value, 0.5);
330
- t.true((0, _isFunction2.default)(props.onChange));
331
- props.onChange(0.87);
332
- });
333
- (0, _ava.default)('should default slider step to 1', t => {
334
- t.plan(2);
335
- const state = {
336
- ui: {
337
- answers: {},
338
- current: {
339
- progressionId: '1234'
340
- }
341
- }
342
- };
343
-
344
- const dispatch = action => {
345
- t.pass();
346
- };
347
-
348
- const props = (0, _answer.createGetAnswerProps)(options, {
349
- dispatch
350
- })(state, (0, _omit2.default)('question.content.step', _slider.default));
351
- t.true((0, _isFunction2.default)(props.onChange));
352
- props.onChange(0.87);
353
- });
354
- (0, _ava.default)('should create edited slider props', t => {
355
- const state = {
356
- ui: {
357
- answers: {
358
- 1234: {
359
- value: ['300']
360
- }
361
- },
362
- current: {
363
- progressionId: '1234'
364
- }
365
- }
366
- };
367
- const props = getAnswerProps(state, _slider.default);
368
- t.is(props.title, '300 an(s)');
369
- t.is(props.value, 0.3);
370
- });
371
- (0, _ava.default)('should create initial basic props', t => {
372
- const state = {
373
- ui: {
374
- answers: {},
375
- current: {
376
- progressionId: null
377
- }
378
- }
379
- };
380
- const props = getAnswerProps(state, _basic.default);
381
- t.is(props.type, 'freeText');
382
- });
383
- (0, _ava.default)('should create edited basic props', t => {
384
- const state = {
385
- ui: {
386
- answers: {
387
- 1234: {
388
- value: ['foo']
389
- }
390
- },
391
- current: {
392
- progressionId: '1234'
393
- }
394
- }
395
- };
396
- const props = getAnswerProps(state, _basic.default);
397
- t.is(props.type, 'freeText');
398
- t.is(props.value, 'foo');
399
- t.true((0, _isFunction2.default)(props.onChange));
400
- });
401
- (0, _ava.default)('should provide an help subtitle depending on question.type', t => {
402
- const help = getHelp(_qcmDrag.default);
403
- t.is(help, 'Cliquez sur les réponses dans le bon ordre.');
404
- const help1 = getHelp(_template.default);
405
- t.is(help1, 'Type your answers');
406
- const help2 = getHelp(_qcm.default);
407
- t.is(help2, '__Select something below');
408
- });
409
- //# sourceMappingURL=answer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"answer.js","names":["options","translate","mockTranslate","store","dispatch","getAnswerProps","createGetAnswerProps","getHelp","createGetHelp","test","t","plan","state","ui","current","progressionId","_getAnswerProps","thunk","true","props","qcm","is","type","answers","every","answer","selected","onClick","value","length","title","false","template","Array","isArray","name","placeholder","onChange","selectOptions","validOption","qcmGraphic","data","configs","entities","version","shuffleChoices","progressions","engine","ref","deepEqual","qcmDrag","order","action","pass","slider","minLabel","maxLabel","basic","help","help1","help2"],"sources":["../../../src/map-state-to-props/test/answer.js"],"sourcesContent":["import test from 'ava';\nimport {omit, isFunction, identity, sortBy, pipe, map, pick} from 'lodash/fp';\n\nimport {mockTranslate} from '@coorpacademy/translate';\nimport {createGetAnswerProps, createGetHelp} from '../answer';\nimport basic from './fixtures/slides/basic';\nimport qcm from './fixtures/slides/qcm';\nimport qcmDrag from './fixtures/slides/qcm-drag';\nimport qcmGraphic from './fixtures/slides/qcm-graphic';\nimport template from './fixtures/slides/template';\nimport slider from './fixtures/slides/slider';\n\nconst options = {translate: mockTranslate};\nconst store = {dispatch: identity};\nconst getAnswerProps = createGetAnswerProps(options, store);\nconst getHelp = createGetHelp(options, store);\n\ntest('should create initial qcm props', t => {\n t.plan(3);\n\n const state = {\n ui: {\n current: {progressionId: '1234'}\n }\n };\n\n const _getAnswerProps = createGetAnswerProps(options, {\n dispatch: thunk => {\n t.true(isFunction(thunk));\n }\n });\n\n const props = _getAnswerProps(state, qcm);\n\n t.is(props.type, 'qcm');\n t.true(props.answers.every(answer => answer.selected === false));\n\n props.answers[0].onClick();\n});\n\ntest('should create edited qcm props', t => {\n const state = {\n ui: {\n answers: {1234: {value: ['Case 1', 'Case 3']}},\n current: {progressionId: '1234'}\n }\n };\n\n const props = getAnswerProps(state, qcm);\n\n t.is(props.type, 'qcm');\n t.is(props.answers.length, 4);\n t.is(props.answers[0].title, 'Case 1');\n t.true(props.answers[0].selected);\n t.is(props.answers[1].title, 'Case 2');\n t.false(props.answers[1].selected);\n t.is(props.answers[2].title, 'Case 3');\n t.true(props.answers[2].selected);\n t.is(props.answers[3].title, 'Case 4');\n t.false(props.answers[3].selected);\n t.true(isFunction(props.answers[0].onClick));\n});\n\ntest('should create edited template props', t => {\n t.plan(24);\n\n const state = {\n ui: {\n answers: {1234: {value: ['foo', 'exclusive']}},\n current: {progressionId: '1234'}\n }\n };\n\n const _getAnswerProps = createGetAnswerProps(options, {\n dispatch: thunk => {\n t.true(isFunction(thunk));\n }\n });\n\n const props = _getAnswerProps(state, template);\n t.is(props.type, 'template');\n t.is(props.template, 'The answer is {{inp81438}} {{sel31191}}');\n t.true(Array.isArray(props.answers));\n t.is(props.answers.length, 2);\n t.is(props.answers[0].type, 'text');\n t.is(props.answers[0].name, 'inp81438');\n t.is(props.answers[0].placeholder, '__Type here');\n t.is(props.answers[0].value, 'foo');\n t.true(isFunction(props.answers[0].onChange));\n t.is(props.answers[1].type, 'select');\n t.is(props.answers[1].name, 'sel31191');\n t.is(props.answers[1]['aria-label'], '__Select an answer');\n t.true(isFunction(props.answers[1].onChange));\n const selectOptions = props.answers[1].options;\n t.true(Array.isArray(selectOptions));\n t.is(selectOptions.length, 2);\n t.is(selectOptions[0].name, 'temporary');\n t.is(selectOptions[0].value, 'temporary');\n t.false(selectOptions[0].selected);\n t.true(selectOptions[0].validOption);\n t.is(selectOptions[1].name, 'exclusive');\n t.is(selectOptions[1].value, 'exclusive');\n t.true(selectOptions[1].selected);\n t.true(selectOptions[1].validOption);\n\n props.answers[1].onChange();\n});\n\ntest('should add an invalid `select an answer` choice for a select field in a template question if there are no answers for it', t => {\n t.plan(13);\n const state = {\n ui: {\n answers: {},\n current: {progressionId: '1234'}\n }\n };\n\n const _getAnswerProps = createGetAnswerProps(options, {\n dispatch: thunk => {\n t.true(isFunction(thunk));\n }\n });\n\n const props = _getAnswerProps(state, template);\n const selectOptions = props.answers[1].options;\n\n t.is(selectOptions.length, 3);\n t.is(selectOptions[0].name, '__Select an answer');\n t.true(selectOptions[0].selected);\n t.false(selectOptions[0].validOption);\n t.is(selectOptions[1].name, 'temporary');\n t.is(selectOptions[1].value, 'temporary');\n t.false(selectOptions[1].selected);\n t.true(selectOptions[1].validOption);\n t.is(selectOptions[2].name, 'exclusive');\n t.is(selectOptions[2].value, 'exclusive');\n t.false(selectOptions[2].selected);\n t.true(selectOptions[2].validOption);\n\n props.answers[1].onChange();\n});\n\ntest('should create initial qcmGraphic props', t => {\n const state = {\n ui: {\n answers: {},\n current: {progressionId: '1234'}\n }\n };\n const props = getAnswerProps(state, qcmGraphic);\n t.is(props.type, 'qcmGraphic');\n t.is(props.answers.length, 2);\n t.true(props.answers.every(answer => answer.selected === false));\n});\n\ntest('should create edited qcmGraphic props', t => {\n t.plan(5);\n const state = {\n data: {\n configs: {\n entities: {\n 'learner@2': {\n version: '2',\n shuffleChoices: true\n }\n }\n },\n progressions: {\n entities: {\n 1234: {\n engine: {\n ref: 'learner',\n version: '2'\n }\n }\n }\n }\n },\n ui: {\n answers: {1234: {value: ['Vrai']}},\n current: {progressionId: '1234'}\n }\n };\n\n const _getAnswerProps = createGetAnswerProps(options, {\n dispatch: thunk => {\n t.true(isFunction(thunk));\n }\n });\n\n const props = _getAnswerProps(state, qcmGraphic);\n\n t.is(props.type, 'qcmGraphic');\n t.is(props.answers.length, 2);\n\n const answers = pipe(map(pick(['title', 'selected'])), sortBy('title'))(props.answers);\n t.deepEqual(answers, [\n {title: 'Faux', selected: false},\n {title: 'Vrai', selected: true}\n ]);\n\n t.true(isFunction(props.answers[0].onClick));\n\n props.answers[0].onClick();\n});\n\ntest('should create initial qcmDrag props', t => {\n const state = {\n ui: {\n answers: {},\n current: {progressionId: '1234'}\n }\n };\n const props = getAnswerProps(state, qcmDrag);\n t.is(props.type, 'qcmDrag');\n t.is(props.answers.length, 3);\n t.is(props.answers[0].title, \"L'ordinateur\");\n t.false(props.answers[0].selected);\n t.true(isFunction(props.answers[0].onClick));\n t.is(props.answers[1].title, 'La tablette');\n t.false(props.answers[1].selected);\n t.true(isFunction(props.answers[1].onClick));\n t.is(props.answers[2].title, 'Le smartphone');\n t.false(props.answers[2].selected);\n t.true(isFunction(props.answers[2].onClick));\n});\n\ntest('should create edited qcmDrag props', t => {\n t.plan(14);\n const state = {\n ui: {\n answers: {1234: {value: ['Le smartphone', \"L'ordinateur\"]}},\n current: {progressionId: '1234'}\n }\n };\n\n const _getAnswerProps = createGetAnswerProps(options, {\n dispatch: thunk => {\n t.true(isFunction(thunk));\n }\n });\n\n const props = _getAnswerProps(state, qcmDrag);\n\n t.is(props.type, 'qcmDrag');\n t.is(props.answers.length, 3);\n\n t.is(props.answers[0].title, \"L'ordinateur\");\n t.true(props.answers[0].selected);\n t.is(props.answers[0].order, 1);\n t.true(isFunction(props.answers[0].onClick));\n t.is(props.answers[1].title, 'La tablette');\n t.false(props.answers[1].selected);\n t.true(isFunction(props.answers[1].onClick));\n t.is(props.answers[2].title, 'Le smartphone');\n t.true(props.answers[2].selected);\n t.is(props.answers[2].order, 0);\n t.true(isFunction(props.answers[2].onClick));\n\n props.answers[2].onClick();\n});\n\ntest('should create initial slider props', t => {\n t.plan(8);\n const state = {\n ui: {\n answers: {},\n current: {progressionId: '1234'}\n }\n };\n\n const dispatch = action => {\n t.pass();\n };\n\n const props = createGetAnswerProps(options, {dispatch})(state, slider);\n\n t.is(props.type, 'slider');\n t.is(props.placeholder, 'Déplacez le curseur.');\n t.is(props.minLabel, '0 an(s)');\n t.is(props.maxLabel, '1000 an(s)');\n t.is(props.title, '500 an(s)');\n t.is(props.value, 0.5);\n t.true(isFunction(props.onChange));\n\n props.onChange(0.87);\n});\n\ntest('should default slider step to 1', t => {\n t.plan(2);\n const state = {\n ui: {\n answers: {},\n current: {progressionId: '1234'}\n }\n };\n\n const dispatch = action => {\n t.pass();\n };\n\n const props = createGetAnswerProps(options, {dispatch})(\n state,\n omit('question.content.step', slider)\n );\n\n t.true(isFunction(props.onChange));\n\n props.onChange(0.87);\n});\n\ntest('should create edited slider props', t => {\n const state = {\n ui: {\n answers: {1234: {value: ['300']}},\n current: {progressionId: '1234'}\n }\n };\n\n const props = getAnswerProps(state, slider);\n t.is(props.title, '300 an(s)');\n t.is(props.value, 0.3);\n});\n\ntest('should create initial basic props', t => {\n const state = {\n ui: {\n answers: {},\n current: {progressionId: null}\n }\n };\n const props = getAnswerProps(state, basic);\n t.is(props.type, 'freeText');\n});\n\ntest('should create edited basic props', t => {\n const state = {\n ui: {\n answers: {1234: {value: ['foo']}},\n current: {progressionId: '1234'}\n }\n };\n\n const props = getAnswerProps(state, basic);\n t.is(props.type, 'freeText');\n t.is(props.value, 'foo');\n t.true(isFunction(props.onChange));\n});\n\ntest('should provide an help subtitle depending on question.type', t => {\n const help = getHelp(qcmDrag);\n t.is(help, 'Cliquez sur les réponses dans le bon ordre.');\n const help1 = getHelp(template);\n t.is(help1, 'Type your answers');\n const help2 = getHelp(qcm);\n t.is(help2, '__Select something below');\n});\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,MAAMA,OAAO,GAAG;EAACC,SAAS,EAAEC;AAAZ,CAAhB;AACA,MAAMC,KAAK,GAAG;EAACC,QAAQ;AAAT,CAAd;AACA,MAAMC,cAAc,GAAG,IAAAC,4BAAA,EAAqBN,OAArB,EAA8BG,KAA9B,CAAvB;AACA,MAAMI,OAAO,GAAG,IAAAC,qBAAA,EAAcR,OAAd,EAAuBG,KAAvB,CAAhB;AAEA,IAAAM,YAAA,EAAK,iCAAL,EAAwCC,CAAC,IAAI;EAC3CA,CAAC,CAACC,IAAF,CAAO,CAAP;EAEA,MAAMC,KAAK,GAAG;IACZC,EAAE,EAAE;MACFC,OAAO,EAAE;QAACC,aAAa,EAAE;MAAhB;IADP;EADQ,CAAd;;EAMA,MAAMC,eAAe,GAAG,IAAAV,4BAAA,EAAqBN,OAArB,EAA8B;IACpDI,QAAQ,EAAEa,KAAK,IAAI;MACjBP,CAAC,CAACQ,IAAF,CAAO,0BAAWD,KAAX,CAAP;IACD;EAHmD,CAA9B,CAAxB;;EAMA,MAAME,KAAK,GAAGH,eAAe,CAACJ,KAAD,EAAQQ,YAAR,CAA7B;;EAEAV,CAAC,CAACW,EAAF,CAAKF,KAAK,CAACG,IAAX,EAAiB,KAAjB;EACAZ,CAAC,CAACQ,IAAF,CAAOC,KAAK,CAACI,OAAN,CAAcC,KAAd,CAAoBC,MAAM,IAAIA,MAAM,CAACC,QAAP,KAAoB,KAAlD,CAAP;EAEAP,KAAK,CAACI,OAAN,CAAc,CAAd,EAAiBI,OAAjB;AACD,CArBD;AAuBA,IAAAlB,YAAA,EAAK,gCAAL,EAAuCC,CAAC,IAAI;EAC1C,MAAME,KAAK,GAAG;IACZC,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EAAE;MAAhB;IAFP;EADQ,CAAd;EAMA,MAAMI,KAAK,GAAGd,cAAc,CAACO,KAAD,EAAQ6C,cAAR,CAA5B;EACA/C,CAAC,CAACW,EAAF,CAAKF,KAAK,CAACG,IAAX,EAAiB,UAAjB;AACD,CATD;AAWA,IAAAb,YAAA,EAAK,kCAAL,EAAyCC,CAAC,IAAI;EAC5C,MAAME,KAAK,GAAG;IACZC,EAAE,EAAE;MACFU,OAAO,EAAE;QAAC,MAAM;UAACK,KAAK,EAAE,CAAC,KAAD;QAAR;MAAP,CADP;MAEFd,OAAO,EAAE;QAACC,aAAa,EAAE;MAAhB;IAFP;EADQ,CAAd;EAOA,MAAMI,KAAK,GAAGd,cAAc,CAACO,KAAD,EAAQ6C,cAAR,CAA5B;EACA/C,CAAC,CAACW,EAAF,CAAKF,KAAK,CAACG,IAAX,EAAiB,UAAjB;EACAZ,CAAC,CAACW,EAAF,CAAKF,KAAK,CAACS,KAAX,EAAkB,KAAlB;EACAlB,CAAC,CAACQ,IAAF,CAAO,0BAAWC,KAAK,CAACkB,QAAjB,CAAP;AACD,CAZD;AAcA,IAAA5B,YAAA,EAAK,4DAAL,EAAmEC,CAAC,IAAI;EACtE,MAAMgD,IAAI,GAAGnD,OAAO,CAAC2C,gBAAD,CAApB;EACAxC,CAAC,CAACW,EAAF,CAAKqC,IAAL,EAAW,6CAAX;EACA,MAAMC,KAAK,GAAGpD,OAAO,CAACyB,iBAAD,CAArB;EACAtB,CAAC,CAACW,EAAF,CAAKsC,KAAL,EAAY,mBAAZ;EACA,MAAMC,KAAK,GAAGrD,OAAO,CAACa,YAAD,CAArB;EACAV,CAAC,CAACW,EAAF,CAAKuC,KAAL,EAAY,0BAAZ;AACD,CAPD"}
@@ -1,131 +0,0 @@
1
- {
2
- "data": {
3
- "configs": {
4
- "entities": {
5
- "microlearning@1": {
6
- "version": 1
7
- }
8
- }
9
- },
10
- "clues": {
11
- "entities": {
12
- "0": {
13
- "1.B2.4": "Clue"
14
- }
15
- }
16
- },
17
- "contents": {
18
- "chapter": {
19
- "entities": {
20
- "cha_Ny1BTxRp~": {
21
- "info": {
22
- "nbSlides": 4
23
- }
24
- }
25
- }
26
- },
27
- "slide": {
28
- "entities": {
29
- "1.B2.4": {
30
- "_id": "1.B2.4",
31
- "klf": "Some KLF",
32
- "tips": "XXX",
33
- "hasClue": true,
34
- "chapter_id": "cha_Ny1BTxRp~",
35
- "authors": [],
36
- "context": {
37
- "media": {
38
- "subtitles": [],
39
- "posters": [],
40
- "src": []
41
- }
42
- },
43
- "lessons": [
44
- {
45
- "type": "video",
46
- "poster": "//static.coorpacademy.com/content/digital/miniatures_cours/base/1B2.png",
47
- "description": "Anatomie d'une page de résultats",
48
- "mimeType": "application/vimeo",
49
- "videoId": "88393119\n",
50
- "_id": "590b862e2e967f64333ad456",
51
- "subtitles": [],
52
- "posters": [],
53
- "src": []
54
- }
55
- ],
56
- "question": {
57
- "type": "basic",
58
- "header": "Écrivez le mot Text dans l'input.\n",
59
- "explanation": "Saisissez votre réponse.",
60
- "content": {
61
- "label": "Saisissez votre réponse.",
62
- "placeholder": " ",
63
- "maxTypos": null,
64
- "choices": [],
65
- "answers": [["Text"]],
66
- "media": {
67
- "subtitles": [],
68
- "posters": [],
69
- "src": []
70
- }
71
- },
72
- "medias": []
73
- }
74
- }
75
- }
76
- }
77
- },
78
- "progressions": {
79
- "entities": {
80
- "0": {
81
- "_id": "0",
82
- "engine": {
83
- "ref": "microlearning",
84
- "version": "1"
85
- },
86
- "content": {
87
- "ref": "cha_Ny1BTxRp~",
88
- "type": "chapter"
89
- },
90
- "state": {
91
- "slides": ["1.B2.3"],
92
- "content": {
93
- "ref": "1.B2.3",
94
- "type": "slide"
95
- },
96
- "nextContent": {
97
- "ref": "1.B2.4",
98
- "type": "slide"
99
- },
100
- "lives": 1,
101
- "step": {
102
- "current": 2
103
- },
104
- "isCorrect": false,
105
- "stars": 0,
106
- "requestedClues": [],
107
- "viewedResources": []
108
- }
109
- }
110
- }
111
- },
112
- "exitNodes": {
113
- "entities": {}
114
- }
115
- },
116
- "ui": {
117
- "answers": {
118
- "0": {
119
- "isCorrect": false,
120
- "correction": [["Text"]]
121
- }
122
- },
123
- "current": {
124
- "progressionId": "0"
125
- },
126
- "corrections": {},
127
- "route": {
128
- "0": "clue"
129
- }
130
- }
131
- }