@coorpacademy/app-review 0.5.4 → 0.5.6-alpha.10

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 (256) hide show
  1. package/es/locales/en/review.json +14 -0
  2. package/es/sandbox/index.d.ts +9 -0
  3. package/es/sandbox/index.js +56 -0
  4. package/es/{index.js → src/index.js} +6 -5
  5. package/es/src/services/fetch-slides-to-review-by-skill-ref.d.ts +2 -0
  6. package/es/src/services/fetch-slides-to-review-by-skill-ref.js +8 -0
  7. package/es/{services → src/services}/index.js +2 -0
  8. package/es/{test → src/test}/index.test.js +3 -1
  9. package/{lib → es/src}/test/util/services.mock.d.ts +1 -0
  10. package/es/{test → src/test}/util/services.mock.js +20 -1
  11. package/{lib → es/src}/types/common.d.ts +10 -2
  12. package/{lib → es/src}/views/slides/index.d.ts +2 -1
  13. package/es/{views → src/views}/slides/index.js +20 -18
  14. package/lib/locales/en/review.json +14 -0
  15. package/lib/sandbox/index.d.ts +9 -0
  16. package/lib/sandbox/index.js +67 -0
  17. package/lib/{index.js → src/index.js} +6 -6
  18. package/lib/src/services/fetch-slides-to-review-by-skill-ref.d.ts +2 -0
  19. package/lib/src/services/fetch-slides-to-review-by-skill-ref.js +52 -0
  20. package/lib/{services → src/services}/index.js +2 -0
  21. package/lib/{test → src/test}/index.test.js +3 -1
  22. package/{es → lib/src}/test/util/services.mock.d.ts +1 -0
  23. package/lib/{test → src/test}/util/services.mock.js +20 -1
  24. package/{es → lib/src}/types/common.d.ts +10 -2
  25. package/{es → lib/src}/views/slides/index.d.ts +2 -1
  26. package/lib/{views → src/views}/slides/index.js +20 -18
  27. package/locales/en/review.json +14 -0
  28. package/package.json +9 -6
  29. package/src/index.tsx +7 -7
  30. package/src/services/fetch-slides-to-review-by-skill-ref.ts +18 -0
  31. package/src/services/index.ts +2 -0
  32. package/src/services/test/fetch-slides-to-review-by-skill-ref.test.ts +51 -0
  33. package/src/test/index.test.tsx +3 -1
  34. package/src/test/util/services.mock.ts +24 -2
  35. package/src/types/common.ts +16 -2
  36. package/src/types/globals.d.ts +1 -0
  37. package/src/views/slides/index.ts +43 -19
  38. package/src/views/slides/test/header.on-click.test.ts +10 -3
  39. package/src/views/slides/test/index.test.ts +58 -55
  40. package/src/views/slides/test/on-quit-popin.on-click.test.ts +12 -3
  41. package/src/views/slides/test/slide.free-text.on-change.test.ts +4 -2
  42. package/src/views/slides/test/slide.next-slide.on-click.test.ts +6 -3
  43. package/src/views/slides/test/slide.qcm-drag.on-click.test.ts +3 -2
  44. package/src/views/slides/test/slide.qcm-graphic.on-click.test.ts +3 -2
  45. package/src/views/slides/test/slide.qcm.on-click.test.ts +3 -2
  46. package/src/views/slides/test/slide.slider.on-change.test.ts +3 -2
  47. package/src/views/slides/test/slide.slider.on-slider-change.test.ts +3 -2
  48. package/src/views/slides/test/slide.template.on-change.test.ts +5 -4
  49. /package/es/{actions → src/actions}/api/fetch-correction.d.ts +0 -0
  50. /package/es/{actions → src/actions}/api/fetch-correction.js +0 -0
  51. /package/es/{actions → src/actions}/api/fetch-rank.d.ts +0 -0
  52. /package/es/{actions → src/actions}/api/fetch-rank.js +0 -0
  53. /package/es/{actions → src/actions}/api/fetch-skills.d.ts +0 -0
  54. /package/es/{actions → src/actions}/api/fetch-skills.js +0 -0
  55. /package/es/{actions → src/actions}/api/fetch-slide.d.ts +0 -0
  56. /package/es/{actions → src/actions}/api/fetch-slide.js +0 -0
  57. /package/es/{actions → src/actions}/api/post-answer.d.ts +0 -0
  58. /package/es/{actions → src/actions}/api/post-answer.js +0 -0
  59. /package/es/{actions → src/actions}/api/post-progression.d.ts +0 -0
  60. /package/es/{actions → src/actions}/api/post-progression.js +0 -0
  61. /package/es/{actions → src/actions}/data/token.d.ts +0 -0
  62. /package/es/{actions → src/actions}/data/token.js +0 -0
  63. /package/es/{actions → src/actions}/index.d.ts +0 -0
  64. /package/es/{actions → src/actions}/index.js +0 -0
  65. /package/es/{actions → src/actions}/test/create-test-store.d.ts +0 -0
  66. /package/es/{actions → src/actions}/test/create-test-store.js +0 -0
  67. /package/es/{actions → src/actions}/ui/answers.d.ts +0 -0
  68. /package/es/{actions → src/actions}/ui/answers.js +0 -0
  69. /package/es/{actions → src/actions}/ui/navigation.d.ts +0 -0
  70. /package/es/{actions → src/actions}/ui/navigation.js +0 -0
  71. /package/es/{actions → src/actions}/ui/next-slide.d.ts +0 -0
  72. /package/es/{actions → src/actions}/ui/next-slide.js +0 -0
  73. /package/es/{actions → src/actions}/ui/quit-popin.d.ts +0 -0
  74. /package/es/{actions → src/actions}/ui/quit-popin.js +0 -0
  75. /package/es/{actions → src/actions}/ui/slides.d.ts +0 -0
  76. /package/es/{actions → src/actions}/ui/slides.js +0 -0
  77. /package/es/{common → src/common}/index.d.ts +0 -0
  78. /package/es/{common → src/common}/index.js +0 -0
  79. /package/es/{configure-store.d.ts → src/configure-store.d.ts} +0 -0
  80. /package/es/{configure-store.js → src/configure-store.js} +0 -0
  81. /package/es/{helpers → src/helpers}/css-register.d.ts +0 -0
  82. /package/es/{helpers → src/helpers}/css-register.js +0 -0
  83. /package/es/{index.d.ts → src/index.d.ts} +0 -0
  84. /package/es/{reducers → src/reducers}/data/corrections.d.ts +0 -0
  85. /package/es/{reducers → src/reducers}/data/corrections.js +0 -0
  86. /package/es/{reducers → src/reducers}/data/index.d.ts +0 -0
  87. /package/es/{reducers → src/reducers}/data/index.js +0 -0
  88. /package/es/{reducers → src/reducers}/data/progression.d.ts +0 -0
  89. /package/es/{reducers → src/reducers}/data/progression.js +0 -0
  90. /package/es/{reducers → src/reducers}/data/rank.d.ts +0 -0
  91. /package/es/{reducers → src/reducers}/data/rank.js +0 -0
  92. /package/es/{reducers → src/reducers}/data/skills.d.ts +0 -0
  93. /package/es/{reducers → src/reducers}/data/skills.js +0 -0
  94. /package/es/{reducers → src/reducers}/data/slides.d.ts +0 -0
  95. /package/es/{reducers → src/reducers}/data/slides.js +0 -0
  96. /package/es/{reducers → src/reducers}/data/token.d.ts +0 -0
  97. /package/es/{reducers → src/reducers}/data/token.js +0 -0
  98. /package/es/{reducers → src/reducers}/index.d.ts +0 -0
  99. /package/es/{reducers → src/reducers}/index.js +0 -0
  100. /package/es/{reducers → src/reducers}/ui/answers.d.ts +0 -0
  101. /package/es/{reducers → src/reducers}/ui/answers.js +0 -0
  102. /package/es/{reducers → src/reducers}/ui/current-slide-ref.d.ts +0 -0
  103. /package/es/{reducers → src/reducers}/ui/current-slide-ref.js +0 -0
  104. /package/es/{reducers → src/reducers}/ui/index.d.ts +0 -0
  105. /package/es/{reducers → src/reducers}/ui/index.js +0 -0
  106. /package/es/{reducers → src/reducers}/ui/navigation.d.ts +0 -0
  107. /package/es/{reducers → src/reducers}/ui/navigation.js +0 -0
  108. /package/es/{reducers → src/reducers}/ui/positions.d.ts +0 -0
  109. /package/es/{reducers → src/reducers}/ui/positions.js +0 -0
  110. /package/es/{reducers → src/reducers}/ui/quit-popin.d.ts +0 -0
  111. /package/es/{reducers → src/reducers}/ui/quit-popin.js +0 -0
  112. /package/es/{reducers → src/reducers}/ui/show-congrats.d.ts +0 -0
  113. /package/es/{reducers → src/reducers}/ui/show-congrats.js +0 -0
  114. /package/es/{reducers → src/reducers}/ui/slide.d.ts +0 -0
  115. /package/es/{reducers → src/reducers}/ui/slide.js +0 -0
  116. /package/es/{services → src/services}/fetch-correction.d.ts +0 -0
  117. /package/es/{services → src/services}/fetch-correction.js +0 -0
  118. /package/es/{services → src/services}/fetch-rank.d.ts +0 -0
  119. /package/es/{services → src/services}/fetch-rank.js +0 -0
  120. /package/es/{services → src/services}/fetch-skills.d.ts +0 -0
  121. /package/es/{services → src/services}/fetch-skills.js +0 -0
  122. /package/es/{services → src/services}/fetch-slide.d.ts +0 -0
  123. /package/es/{services → src/services}/fetch-slide.js +0 -0
  124. /package/es/{services → src/services}/index.d.ts +0 -0
  125. /package/es/{services → src/services}/post-answer.d.ts +0 -0
  126. /package/es/{services → src/services}/post-answer.js +0 -0
  127. /package/es/{services → src/services}/post-progression.d.ts +0 -0
  128. /package/es/{services → src/services}/post-progression.js +0 -0
  129. /package/es/{services → src/services}/tools/fetch-responses.d.ts +0 -0
  130. /package/es/{services → src/services}/tools/fetch-responses.js +0 -0
  131. /package/es/{services → src/services}/tools/sleep.d.ts +0 -0
  132. /package/es/{services → src/services}/tools/sleep.js +0 -0
  133. /package/es/{test → src/test}/index.test.d.ts +0 -0
  134. /package/es/{types → src/types}/common.js +0 -0
  135. /package/es/{types → src/types}/slides.d.ts +0 -0
  136. /package/es/{types → src/types}/slides.js +0 -0
  137. /package/es/{views → src/views}/skills/index.d.ts +0 -0
  138. /package/es/{views → src/views}/skills/index.js +0 -0
  139. /package/es/{views → src/views}/slides/map-api-slide-to-ui.d.ts +0 -0
  140. /package/es/{views → src/views}/slides/map-api-slide-to-ui.js +0 -0
  141. /package/es/{views → src/views}/slides/test/fixtures/free-text.d.ts +0 -0
  142. /package/es/{views → src/views}/slides/test/fixtures/free-text.js +0 -0
  143. /package/es/{views → src/views}/slides/test/fixtures/qcm-drag.d.ts +0 -0
  144. /package/es/{views → src/views}/slides/test/fixtures/qcm-drag.js +0 -0
  145. /package/es/{views → src/views}/slides/test/fixtures/qcm-graphic.d.ts +0 -0
  146. /package/es/{views → src/views}/slides/test/fixtures/qcm-graphic.js +0 -0
  147. /package/es/{views → src/views}/slides/test/fixtures/qcm.d.ts +0 -0
  148. /package/es/{views → src/views}/slides/test/fixtures/qcm.js +0 -0
  149. /package/es/{views → src/views}/slides/test/fixtures/slider.d.ts +0 -0
  150. /package/es/{views → src/views}/slides/test/fixtures/slider.js +0 -0
  151. /package/es/{views → src/views}/slides/test/fixtures/template.d.ts +0 -0
  152. /package/es/{views → src/views}/slides/test/fixtures/template.js +0 -0
  153. /package/lib/{actions → src/actions}/api/fetch-correction.d.ts +0 -0
  154. /package/lib/{actions → src/actions}/api/fetch-correction.js +0 -0
  155. /package/lib/{actions → src/actions}/api/fetch-rank.d.ts +0 -0
  156. /package/lib/{actions → src/actions}/api/fetch-rank.js +0 -0
  157. /package/lib/{actions → src/actions}/api/fetch-skills.d.ts +0 -0
  158. /package/lib/{actions → src/actions}/api/fetch-skills.js +0 -0
  159. /package/lib/{actions → src/actions}/api/fetch-slide.d.ts +0 -0
  160. /package/lib/{actions → src/actions}/api/fetch-slide.js +0 -0
  161. /package/lib/{actions → src/actions}/api/post-answer.d.ts +0 -0
  162. /package/lib/{actions → src/actions}/api/post-answer.js +0 -0
  163. /package/lib/{actions → src/actions}/api/post-progression.d.ts +0 -0
  164. /package/lib/{actions → src/actions}/api/post-progression.js +0 -0
  165. /package/lib/{actions → src/actions}/data/token.d.ts +0 -0
  166. /package/lib/{actions → src/actions}/data/token.js +0 -0
  167. /package/lib/{actions → src/actions}/index.d.ts +0 -0
  168. /package/lib/{actions → src/actions}/index.js +0 -0
  169. /package/lib/{actions → src/actions}/test/create-test-store.d.ts +0 -0
  170. /package/lib/{actions → src/actions}/test/create-test-store.js +0 -0
  171. /package/lib/{actions → src/actions}/ui/answers.d.ts +0 -0
  172. /package/lib/{actions → src/actions}/ui/answers.js +0 -0
  173. /package/lib/{actions → src/actions}/ui/navigation.d.ts +0 -0
  174. /package/lib/{actions → src/actions}/ui/navigation.js +0 -0
  175. /package/lib/{actions → src/actions}/ui/next-slide.d.ts +0 -0
  176. /package/lib/{actions → src/actions}/ui/next-slide.js +0 -0
  177. /package/lib/{actions → src/actions}/ui/quit-popin.d.ts +0 -0
  178. /package/lib/{actions → src/actions}/ui/quit-popin.js +0 -0
  179. /package/lib/{actions → src/actions}/ui/slides.d.ts +0 -0
  180. /package/lib/{actions → src/actions}/ui/slides.js +0 -0
  181. /package/lib/{common → src/common}/index.d.ts +0 -0
  182. /package/lib/{common → src/common}/index.js +0 -0
  183. /package/lib/{configure-store.d.ts → src/configure-store.d.ts} +0 -0
  184. /package/lib/{configure-store.js → src/configure-store.js} +0 -0
  185. /package/lib/{helpers → src/helpers}/css-register.d.ts +0 -0
  186. /package/lib/{helpers → src/helpers}/css-register.js +0 -0
  187. /package/lib/{index.d.ts → src/index.d.ts} +0 -0
  188. /package/lib/{reducers → src/reducers}/data/corrections.d.ts +0 -0
  189. /package/lib/{reducers → src/reducers}/data/corrections.js +0 -0
  190. /package/lib/{reducers → src/reducers}/data/index.d.ts +0 -0
  191. /package/lib/{reducers → src/reducers}/data/index.js +0 -0
  192. /package/lib/{reducers → src/reducers}/data/progression.d.ts +0 -0
  193. /package/lib/{reducers → src/reducers}/data/progression.js +0 -0
  194. /package/lib/{reducers → src/reducers}/data/rank.d.ts +0 -0
  195. /package/lib/{reducers → src/reducers}/data/rank.js +0 -0
  196. /package/lib/{reducers → src/reducers}/data/skills.d.ts +0 -0
  197. /package/lib/{reducers → src/reducers}/data/skills.js +0 -0
  198. /package/lib/{reducers → src/reducers}/data/slides.d.ts +0 -0
  199. /package/lib/{reducers → src/reducers}/data/slides.js +0 -0
  200. /package/lib/{reducers → src/reducers}/data/token.d.ts +0 -0
  201. /package/lib/{reducers → src/reducers}/data/token.js +0 -0
  202. /package/lib/{reducers → src/reducers}/index.d.ts +0 -0
  203. /package/lib/{reducers → src/reducers}/index.js +0 -0
  204. /package/lib/{reducers → src/reducers}/ui/answers.d.ts +0 -0
  205. /package/lib/{reducers → src/reducers}/ui/answers.js +0 -0
  206. /package/lib/{reducers → src/reducers}/ui/current-slide-ref.d.ts +0 -0
  207. /package/lib/{reducers → src/reducers}/ui/current-slide-ref.js +0 -0
  208. /package/lib/{reducers → src/reducers}/ui/index.d.ts +0 -0
  209. /package/lib/{reducers → src/reducers}/ui/index.js +0 -0
  210. /package/lib/{reducers → src/reducers}/ui/navigation.d.ts +0 -0
  211. /package/lib/{reducers → src/reducers}/ui/navigation.js +0 -0
  212. /package/lib/{reducers → src/reducers}/ui/positions.d.ts +0 -0
  213. /package/lib/{reducers → src/reducers}/ui/positions.js +0 -0
  214. /package/lib/{reducers → src/reducers}/ui/quit-popin.d.ts +0 -0
  215. /package/lib/{reducers → src/reducers}/ui/quit-popin.js +0 -0
  216. /package/lib/{reducers → src/reducers}/ui/show-congrats.d.ts +0 -0
  217. /package/lib/{reducers → src/reducers}/ui/show-congrats.js +0 -0
  218. /package/lib/{reducers → src/reducers}/ui/slide.d.ts +0 -0
  219. /package/lib/{reducers → src/reducers}/ui/slide.js +0 -0
  220. /package/lib/{services → src/services}/fetch-correction.d.ts +0 -0
  221. /package/lib/{services → src/services}/fetch-correction.js +0 -0
  222. /package/lib/{services → src/services}/fetch-rank.d.ts +0 -0
  223. /package/lib/{services → src/services}/fetch-rank.js +0 -0
  224. /package/lib/{services → src/services}/fetch-skills.d.ts +0 -0
  225. /package/lib/{services → src/services}/fetch-skills.js +0 -0
  226. /package/lib/{services → src/services}/fetch-slide.d.ts +0 -0
  227. /package/lib/{services → src/services}/fetch-slide.js +0 -0
  228. /package/lib/{services → src/services}/index.d.ts +0 -0
  229. /package/lib/{services → src/services}/post-answer.d.ts +0 -0
  230. /package/lib/{services → src/services}/post-answer.js +0 -0
  231. /package/lib/{services → src/services}/post-progression.d.ts +0 -0
  232. /package/lib/{services → src/services}/post-progression.js +0 -0
  233. /package/lib/{services → src/services}/tools/fetch-responses.d.ts +0 -0
  234. /package/lib/{services → src/services}/tools/fetch-responses.js +0 -0
  235. /package/lib/{services → src/services}/tools/sleep.d.ts +0 -0
  236. /package/lib/{services → src/services}/tools/sleep.js +0 -0
  237. /package/lib/{test → src/test}/index.test.d.ts +0 -0
  238. /package/lib/{types → src/types}/common.js +0 -0
  239. /package/lib/{types → src/types}/slides.d.ts +0 -0
  240. /package/lib/{types → src/types}/slides.js +0 -0
  241. /package/lib/{views → src/views}/skills/index.d.ts +0 -0
  242. /package/lib/{views → src/views}/skills/index.js +0 -0
  243. /package/lib/{views → src/views}/slides/map-api-slide-to-ui.d.ts +0 -0
  244. /package/lib/{views → src/views}/slides/map-api-slide-to-ui.js +0 -0
  245. /package/lib/{views → src/views}/slides/test/fixtures/free-text.d.ts +0 -0
  246. /package/lib/{views → src/views}/slides/test/fixtures/free-text.js +0 -0
  247. /package/lib/{views → src/views}/slides/test/fixtures/qcm-drag.d.ts +0 -0
  248. /package/lib/{views → src/views}/slides/test/fixtures/qcm-drag.js +0 -0
  249. /package/lib/{views → src/views}/slides/test/fixtures/qcm-graphic.d.ts +0 -0
  250. /package/lib/{views → src/views}/slides/test/fixtures/qcm-graphic.js +0 -0
  251. /package/lib/{views → src/views}/slides/test/fixtures/qcm.d.ts +0 -0
  252. /package/lib/{views → src/views}/slides/test/fixtures/qcm.js +0 -0
  253. /package/lib/{views → src/views}/slides/test/fixtures/slider.d.ts +0 -0
  254. /package/lib/{views → src/views}/slides/test/fixtures/slider.js +0 -0
  255. /package/lib/{views → src/views}/slides/test/fixtures/template.d.ts +0 -0
  256. /package/lib/{views → src/views}/slides/test/fixtures/template.js +0 -0
@@ -8,7 +8,8 @@ import {
8
8
  postAnswerResponses,
9
9
  progressionSlideWithPendingSlide,
10
10
  getChoicesCorrection,
11
- incorrectFreeTextPostAnswerResponse
11
+ incorrectFreeTextPostAnswerResponse,
12
+ translate
12
13
  } from '../../../test/util/services.mock';
13
14
  import {CongratsCardProps, CongratsProps, mapStateToSlidesProps} from '..';
14
15
  import type {StoreState} from '../../../reducers';
@@ -18,6 +19,8 @@ import {templateSlide} from './fixtures/template';
18
19
  import {qcmSlide} from './fixtures/qcm';
19
20
  import {sliderSlide} from './fixtures/slider';
20
21
 
22
+ const connectedOptions = {translate, onQuitClick: identity};
23
+
21
24
  test('should create initial props when fetched slide is not still received', t => {
22
25
  // SCENARIO : @@progression/POST_SUCCESS ok and @@slides/FETCH_REQUEST, (the slide is being fetched)
23
26
  const state: StoreState = {
@@ -48,13 +51,13 @@ test('should create initial props when fetched slide is not still received', t =
48
51
  }
49
52
  };
50
53
 
51
- const props = mapStateToSlidesProps(state, identity, identity);
54
+ const props = mapStateToSlidesProps(state, identity, connectedOptions);
52
55
  t.is(props.congrats, undefined);
53
56
  t.deepEqual(omit(['onQuitClick'], props.header), {
54
57
  'aria-label': 'aria-header-wrapper',
55
58
  closeButtonAriaLabel: 'aria-close-button',
56
- mode: '__revision_mode',
57
- skillName: '__agility',
59
+ mode: translate('Review Title'),
60
+ skillName: translate('Content Parent Title'),
58
61
  steps: [
59
62
  {
60
63
  current: true,
@@ -141,13 +144,13 @@ test('should create props when first slide is on the state', t => {
141
144
  }
142
145
  };
143
146
 
144
- const props = mapStateToSlidesProps(state, identity, identity);
147
+ const props = mapStateToSlidesProps(state, identity, connectedOptions);
145
148
  t.is(props.congrats, undefined);
146
149
  t.deepEqual(omit(['onQuitClick'], props.header), {
147
150
  'aria-label': 'aria-header-wrapper',
148
151
  closeButtonAriaLabel: 'aria-close-button',
149
- mode: '__revision_mode',
150
- skillName: '__agility',
152
+ mode: translate('Review Title'),
153
+ skillName: translate('Content Parent Title'),
151
154
  steps: [
152
155
  {
153
156
  current: true,
@@ -249,13 +252,13 @@ test('should create props when slide is on the state and user has selected answe
249
252
  }
250
253
  };
251
254
 
252
- const props = mapStateToSlidesProps(state, identity, identity);
255
+ const props = mapStateToSlidesProps(state, identity, connectedOptions);
253
256
  t.is(props.congrats, undefined);
254
257
  t.deepEqual(omit(['onQuitClick'], props.header), {
255
258
  'aria-label': 'aria-header-wrapper',
256
259
  closeButtonAriaLabel: 'aria-close-button',
257
- mode: '__revision_mode',
258
- skillName: '__agility',
260
+ mode: translate('Review Title'),
261
+ skillName: translate('Content Parent Title'),
259
262
  steps: [
260
263
  {
261
264
  current: true,
@@ -363,13 +366,13 @@ test('should verify props when first slide was answered correctly and next slide
363
366
  }
364
367
  };
365
368
 
366
- const props = mapStateToSlidesProps(state, identity, identity);
369
+ const props = mapStateToSlidesProps(state, identity, connectedOptions);
367
370
  t.is(props.congrats, undefined);
368
371
  t.deepEqual(omit(['onQuitClick'], props.header), {
369
372
  'aria-label': 'aria-header-wrapper',
370
373
  closeButtonAriaLabel: 'aria-close-button',
371
- mode: '__revision_mode',
372
- skillName: '__agility',
374
+ mode: translate('Review Title'),
375
+ skillName: translate('Content Parent Title'),
373
376
  steps: [
374
377
  {
375
378
  current: true,
@@ -481,13 +484,13 @@ test('should verify props when first slide was answered with error and next slid
481
484
  }
482
485
  };
483
486
 
484
- const props = mapStateToSlidesProps(state, identity, identity);
487
+ const props = mapStateToSlidesProps(state, identity, connectedOptions);
485
488
  t.is(props.congrats, undefined);
486
489
  t.deepEqual(omit(['onQuitClick'], props.header), {
487
490
  'aria-label': 'aria-header-wrapper',
488
491
  closeButtonAriaLabel: 'aria-close-button',
489
- mode: '__revision_mode',
490
- skillName: '__agility',
492
+ mode: translate('Review Title'),
493
+ skillName: translate('Content Parent Title'),
491
494
  steps: [
492
495
  {
493
496
  current: true,
@@ -556,13 +559,13 @@ test('should verify props when first slide was answered, next slide is fetched &
556
559
  }
557
560
  };
558
561
 
559
- const props = mapStateToSlidesProps(state, identity, identity);
562
+ const props = mapStateToSlidesProps(state, identity, connectedOptions);
560
563
  t.is(props.congrats, undefined);
561
564
  t.deepEqual(omit(['onQuitClick'], props.header), {
562
565
  'aria-label': 'aria-header-wrapper',
563
566
  closeButtonAriaLabel: 'aria-close-button',
564
- mode: '__revision_mode',
565
- skillName: '__agility',
567
+ mode: translate('Review Title'),
568
+ skillName: translate('Content Parent Title'),
566
569
  steps: [
567
570
  {
568
571
  current: true,
@@ -593,16 +596,16 @@ test('should verify props when first slide was answered, next slide is fetched &
593
596
  });
594
597
  t.is(props.stack.endReview, false);
595
598
  t.deepEqual(omit('next.onClick', props.stack.correctionPopinProps), {
596
- resultLabel: '_right',
599
+ resultLabel: translate('Correct Answer'),
597
600
  information: {
598
- label: '_klf',
601
+ label: translate('KLF'),
599
602
  message:
600
603
  'To negotiate your salary when being hired, you have to establish a benchmark beforehand. In other words, you should assess the salary to which you aspire by enquiring about the remuneration paid in the same industry, the same region and the same position.'
601
604
  },
602
605
  klf: undefined,
603
606
  next: {
604
- ariaLabel: '_correctionNextAriaLabel',
605
- label: '_correctionNextLabel'
607
+ ariaLabel: translate('Next Question'),
608
+ label: translate('Next Question')
606
609
  },
607
610
  type: 'right'
608
611
  });
@@ -688,13 +691,13 @@ test('should verify props when first slide was answered incorrectly, next slide
688
691
  }
689
692
  };
690
693
 
691
- const props = mapStateToSlidesProps(state, identity, identity);
694
+ const props = mapStateToSlidesProps(state, identity, connectedOptions);
692
695
  t.is(props.congrats, undefined);
693
696
  t.deepEqual(omit(['onQuitClick'], props.header), {
694
697
  'aria-label': 'aria-header-wrapper',
695
698
  closeButtonAriaLabel: 'aria-close-button',
696
- mode: '__revision_mode',
697
- skillName: '__agility',
699
+ mode: translate('Review Title'),
700
+ skillName: translate('Content Parent Title'),
698
701
  steps: [
699
702
  {
700
703
  current: true,
@@ -725,19 +728,19 @@ test('should verify props when first slide was answered incorrectly, next slide
725
728
  });
726
729
  t.is(props.stack.endReview, false);
727
730
  t.deepEqual(omit('next.onClick', props.stack.correctionPopinProps), {
728
- resultLabel: '_wrong',
731
+ resultLabel: translate('Wrong Answer'),
729
732
  information: {
730
- label: '_correctAnswer',
733
+ label: translate('Correct Answer'),
731
734
  message: 'Benchmark'
732
735
  },
733
736
  klf: {
734
- label: '_klf',
737
+ label: translate('KLF'),
735
738
  tooltip:
736
739
  'To negotiate your salary when being hired, you have to establish a benchmark beforehand. In other words, you should assess the salary to which you aspire by enquiring about the remuneration paid in the same industry, the same region and the same position.'
737
740
  },
738
741
  next: {
739
- ariaLabel: '_correctionNextAriaLabel',
740
- label: '_correctionNextLabel'
742
+ ariaLabel: translate('Next Question'),
743
+ label: translate('Next Question')
741
744
  },
742
745
  type: 'wrong'
743
746
  });
@@ -827,13 +830,13 @@ test('should verify props when currentSlideRef has changed to nextContent of pro
827
830
  }
828
831
  };
829
832
 
830
- const props = mapStateToSlidesProps(state, identity, identity);
833
+ const props = mapStateToSlidesProps(state, identity, connectedOptions);
831
834
  t.is(props.congrats, undefined);
832
835
  t.deepEqual(omit(['onQuitClick'], props.header), {
833
836
  'aria-label': 'aria-header-wrapper',
834
837
  closeButtonAriaLabel: 'aria-close-button',
835
- mode: '__revision_mode',
836
- skillName: '__agility',
838
+ mode: translate('Review Title'),
839
+ skillName: translate('Content Parent Title'),
837
840
  steps: [
838
841
  {
839
842
  current: false,
@@ -960,13 +963,13 @@ test('should verify props when progression is in success, showing last correctio
960
963
  }
961
964
  };
962
965
 
963
- const props = mapStateToSlidesProps(state, identity, identity);
966
+ const props = mapStateToSlidesProps(state, identity, connectedOptions);
964
967
  t.is(props.congrats, undefined);
965
968
  t.deepEqual(omit(['onQuitClick'], props.header), {
966
969
  'aria-label': 'aria-header-wrapper',
967
970
  closeButtonAriaLabel: 'aria-close-button',
968
- mode: '__revision_mode',
969
- skillName: '__agility',
971
+ mode: translate('Review Title'),
972
+ skillName: translate('Content Parent Title'),
970
973
  steps: [
971
974
  {
972
975
  current: false,
@@ -998,16 +1001,16 @@ test('should verify props when progression is in success, showing last correctio
998
1001
 
999
1002
  t.deepEqual(omit(['next.onClick'], props.stack.correctionPopinProps), {
1000
1003
  information: {
1001
- label: '_klf',
1004
+ label: translate('KLF'),
1002
1005
  message:
1003
1006
  'L’apprenant peut aussi évaluer sa performance grâce à un classement disponible sur la vue leaderboard. Elle compare sa position par rapport à celle des autres apprenants de la plateforme.'
1004
1007
  },
1005
1008
  klf: undefined,
1006
1009
  next: {
1007
- ariaLabel: '_correctionNextAriaLabel',
1008
- label: '_correctionNextLabel'
1010
+ ariaLabel: translate('Next Question'),
1011
+ label: translate('Next Question')
1009
1012
  },
1010
- resultLabel: '_right',
1013
+ resultLabel: translate('Correct Answer'),
1011
1014
  type: 'right'
1012
1015
  });
1013
1016
  });
@@ -1082,9 +1085,9 @@ test('should verify props showing congrats', t => {
1082
1085
  }
1083
1086
  };
1084
1087
 
1085
- const props = mapStateToSlidesProps(state, identity, identity);
1088
+ const props = mapStateToSlidesProps(state, identity, connectedOptions);
1086
1089
  const congrats = props.congrats as CongratsProps;
1087
- t.is(congrats.title, 'Congratulations!');
1090
+ t.is(congrats.title, translate('Congratulations!'));
1088
1091
  t.is(
1089
1092
  congrats.animationLottie.animationSrc,
1090
1093
  'https://static-staging.coorpacademy.com/animations/review/confetti.json'
@@ -1109,7 +1112,7 @@ test('should verify props showing congrats', t => {
1109
1112
  loop: true
1110
1113
  },
1111
1114
  rankSuffix: 'th',
1112
- reviewCardTitle: 'You are now',
1115
+ reviewCardTitle: translate('You are now'),
1113
1116
  reviewCardValue: '9'
1114
1117
  }
1115
1118
  );
@@ -1135,7 +1138,7 @@ test('should verify props showing congrats', t => {
1135
1138
  }
1136
1139
  },
1137
1140
  rankSuffix: undefined,
1138
- reviewCardTitle: 'You have won',
1141
+ reviewCardTitle: translate('You have won'),
1139
1142
  reviewCardValue: '40'
1140
1143
  }
1141
1144
  );
@@ -1214,9 +1217,9 @@ test('should verify props showing congrats, with only stars card, if user has no
1214
1217
  }
1215
1218
  };
1216
1219
 
1217
- const props = mapStateToSlidesProps(state, identity, identity);
1220
+ const props = mapStateToSlidesProps(state, identity, connectedOptions);
1218
1221
  const congrats = props.congrats as CongratsProps;
1219
- t.is(congrats.title, 'Congratulations!');
1222
+ t.is(congrats.title, translate('Congratulations!'));
1220
1223
  t.is(
1221
1224
  congrats.animationLottie.animationSrc,
1222
1225
  'https://static-staging.coorpacademy.com/animations/review/confetti.json'
@@ -1244,7 +1247,7 @@ test('should verify props showing congrats, with only stars card, if user has no
1244
1247
  }
1245
1248
  },
1246
1249
  rankSuffix: undefined,
1247
- reviewCardTitle: 'You have won',
1250
+ reviewCardTitle: translate('You have won'),
1248
1251
  reviewCardValue: '40'
1249
1252
  }
1250
1253
  );
@@ -1325,12 +1328,12 @@ test('should verify props when progression has answered a current pendingSlide',
1325
1328
  }
1326
1329
  };
1327
1330
 
1328
- const props = mapStateToSlidesProps(state, identity, identity);
1331
+ const props = mapStateToSlidesProps(state, identity, connectedOptions);
1329
1332
  t.deepEqual(omit(['onQuitClick'], props.header), {
1330
1333
  'aria-label': 'aria-header-wrapper',
1331
1334
  closeButtonAriaLabel: 'aria-close-button',
1332
- mode: '__revision_mode',
1333
- skillName: '__agility',
1335
+ mode: translate('Review Title'),
1336
+ skillName: translate('Content Parent Title'),
1334
1337
  steps: [
1335
1338
  {
1336
1339
  current: true,
@@ -1431,12 +1434,12 @@ test('should verify props when progression still has a pendingSlide', t => {
1431
1434
  }
1432
1435
  };
1433
1436
 
1434
- const props = mapStateToSlidesProps(state, identity, identity);
1437
+ const props = mapStateToSlidesProps(state, identity, connectedOptions);
1435
1438
  t.deepEqual(omit(['onQuitClick'], props.header), {
1436
1439
  'aria-label': 'aria-header-wrapper',
1437
1440
  closeButtonAriaLabel: 'aria-close-button',
1438
- mode: '__revision_mode',
1439
- skillName: '__agility',
1441
+ mode: translate('Review Title'),
1442
+ skillName: translate('Content Parent Title'),
1440
1443
  steps: [
1441
1444
  {
1442
1445
  current: false,
@@ -1495,6 +1498,6 @@ test('should verify that props quitPopin is not undefined when popin is displaye
1495
1498
  showQuitPopin: true
1496
1499
  }
1497
1500
  };
1498
- const props = mapStateToSlidesProps(state, identity, identity);
1501
+ const props = mapStateToSlidesProps(state, identity, connectedOptions);
1499
1502
  t.not(props.quitPopin, undefined);
1500
1503
  });
@@ -2,12 +2,18 @@ import test from 'ava';
2
2
  import identity from 'lodash/fp/identity';
3
3
  import {createTestStore} from '../../../actions/test/create-test-store';
4
4
  import {CLOSE_POPIN} from '../../../actions/ui/quit-popin';
5
- import {incorrectFreeTextPostAnswerResponse, services} from '../../../test/util/services.mock';
5
+ import {
6
+ incorrectFreeTextPostAnswerResponse,
7
+ services,
8
+ translate
9
+ } from '../../../test/util/services.mock';
6
10
  import {StoreState} from '../../../reducers';
7
11
  import {mapStateToSlidesProps, QuitPopinProps} from '..';
8
12
  import {freeTextSlide} from './fixtures/free-text';
9
13
  import {qcmGraphicSlide} from './fixtures/qcm-graphic';
10
14
 
15
+ const connectedOptions = {translate, onQuitClick: identity};
16
+
11
17
  const state: StoreState = {
12
18
  data: {
13
19
  progression: incorrectFreeTextPostAnswerResponse,
@@ -45,7 +51,7 @@ const state: StoreState = {
45
51
  test('should dispatch CLOSE_POPIN action via the property handleOnclick of secondButton when popin is open', async t => {
46
52
  const expectedAction = [{type: CLOSE_POPIN}];
47
53
  const {dispatch, getState} = createTestStore(t, state, services, expectedAction);
48
- const props = mapStateToSlidesProps(getState(), dispatch, identity);
54
+ const props = mapStateToSlidesProps(getState(), dispatch, connectedOptions);
49
55
  const quitPopin = props.quitPopin as QuitPopinProps;
50
56
  await quitPopin.secondButton.handleOnclick();
51
57
  const updatedState = getState();
@@ -58,7 +64,10 @@ test('should dispatch onQuitClick function via the property handleOnclick of fir
58
64
 
59
65
  const expectedAction = [{type: CLOSE_POPIN}];
60
66
  const {dispatch, getState} = createTestStore(t, state, services, expectedAction);
61
- const props = mapStateToSlidesProps(getState(), dispatch, () => t.pass());
67
+ const props = mapStateToSlidesProps(getState(), dispatch, {
68
+ translate,
69
+ onQuitClick: () => t.pass()
70
+ });
62
71
  const quitPopin = props.quitPopin as QuitPopinProps;
63
72
  await quitPopin.firstButton.handleOnclick();
64
73
  t.pass();
@@ -13,7 +13,8 @@ import {ProgressionFromAPI} from '../../../types/common';
13
13
  import {
14
14
  getChoicesCorrection,
15
15
  postAnswerResponses,
16
- services
16
+ services,
17
+ translate
17
18
  } from '../../../test/util/services.mock';
18
19
  import {createTestStore} from '../../../actions/test/create-test-store';
19
20
  import {StoreState} from '../../../reducers';
@@ -22,6 +23,7 @@ import {FreeText} from '../../../types/slides';
22
23
  import {freeTextSlide} from './fixtures/free-text';
23
24
  import {qcmGraphicSlide} from './fixtures/qcm-graphic';
24
25
 
26
+ const connectedOptions = {translate, onQuitClick: identity};
25
27
  const progression: ProgressionFromAPI = {
26
28
  _id: '123456789123',
27
29
  content: {type: 'skill', ref: '_skill-ref'},
@@ -99,7 +101,7 @@ test('should dispatch EDIT_BASIC action via the property onChange of a Free Text
99
101
  ];
100
102
  const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
101
103
 
102
- const props = mapStateToSlidesProps(getState(), dispatch, identity);
104
+ const props = mapStateToSlidesProps(getState(), dispatch, connectedOptions);
103
105
  t.deepEqual(omit('answerUI', props.stack.slides['0']), {
104
106
  animationType: undefined,
105
107
  animateCorrectionPopin: false,
@@ -5,7 +5,8 @@ import {
5
5
  postAnswerResponses,
6
6
  getChoicesCorrection,
7
7
  incorrectFreeTextPostAnswerResponse,
8
- services
8
+ services,
9
+ translate
9
10
  } from '../../../test/util/services.mock';
10
11
  import {CorrectionPopinProps, mapStateToSlidesProps} from '..';
11
12
  import {createTestStore} from '../../../actions/test/create-test-store';
@@ -16,6 +17,8 @@ import {templateSlide} from './fixtures/template';
16
17
  import {qcmSlide} from './fixtures/qcm';
17
18
  import {sliderSlide} from './fixtures/slider';
18
19
 
20
+ const connectedOptions = {translate, onQuitClick: identity};
21
+
19
22
  test('correction popin actions after click', async t => {
20
23
  const state: StoreState = {
21
24
  data: {
@@ -66,7 +69,7 @@ test('correction popin actions after click', async t => {
66
69
  }
67
70
  ];
68
71
  const {dispatch, getState} = createTestStore(t, state, services, expectedActions);
69
- const props = mapStateToSlidesProps(getState(), dispatch, identity);
72
+ const props = mapStateToSlidesProps(getState(), dispatch, connectedOptions);
70
73
  const correctionPopin = props.stack.correctionPopinProps as CorrectionPopinProps;
71
74
  await correctionPopin.next.onClick();
72
75
 
@@ -164,7 +167,7 @@ test('correction popin actions after click when progression is finished', async
164
167
  }
165
168
  ];
166
169
  const {dispatch, getState} = createTestStore(t, state, services, expectedActions);
167
- const props = mapStateToSlidesProps(getState(), dispatch, identity);
170
+ const props = mapStateToSlidesProps(getState(), dispatch, connectedOptions);
168
171
  t.is(props.congrats, undefined);
169
172
  const correctionPopin = props.stack.correctionPopinProps as CorrectionPopinProps;
170
173
  await correctionPopin.next.onClick();
@@ -4,13 +4,14 @@ import get from 'lodash/fp/get';
4
4
  import identity from 'lodash/fp/identity';
5
5
  import {mapStateToSlidesProps} from '..';
6
6
  import {ProgressionFromAPI} from '../../../types/common';
7
- import {services} from '../../../test/util/services.mock';
7
+ import {services, translate} from '../../../test/util/services.mock';
8
8
  import {createTestStore} from '../../../actions/test/create-test-store';
9
9
  import {StoreState} from '../../../reducers';
10
10
  import {EDIT_QCM_DRAG} from '../../../actions/ui/answers';
11
11
  import {QcmDrag} from '../../../types/slides';
12
12
  import {qcmDragSlide} from './fixtures/qcm-drag';
13
13
 
14
+ const connectedOptions = {translate, onQuitClick: identity};
14
15
  const progression: ProgressionFromAPI = {
15
16
  _id: '123456789123',
16
17
  content: {type: 'skill', ref: '_skill-ref'},
@@ -73,7 +74,7 @@ test('should dispatch EDIT_QCM_DRAG action via the property onClick of a QCM Dra
73
74
  ];
74
75
  const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
75
76
 
76
- const props = mapStateToSlidesProps(getState(), dispatch, identity);
77
+ const props = mapStateToSlidesProps(getState(), dispatch, connectedOptions);
77
78
  t.deepEqual(omit('answerUI', props.stack.slides['0']), {
78
79
  animationType: undefined,
79
80
  animateCorrectionPopin: false,
@@ -4,13 +4,14 @@ import get from 'lodash/fp/get';
4
4
  import identity from 'lodash/fp/identity';
5
5
  import {mapStateToSlidesProps} from '..';
6
6
  import {ProgressionFromAPI} from '../../../types/common';
7
- import {services} from '../../../test/util/services.mock';
7
+ import {services, translate} from '../../../test/util/services.mock';
8
8
  import {createTestStore} from '../../../actions/test/create-test-store';
9
9
  import {StoreState} from '../../../reducers';
10
10
  import {EDIT_QCM_GRAPHIC} from '../../../actions/ui/answers';
11
11
  import {QcmGraphic} from '../../../types/slides';
12
12
  import {qcmGraphicSlide} from './fixtures/qcm-graphic';
13
13
 
14
+ const connectedOptions = {translate, onQuitClick: identity};
14
15
  const progression: ProgressionFromAPI = {
15
16
  _id: '123456789123',
16
17
  content: {type: 'skill', ref: '_skill-ref'},
@@ -73,7 +74,7 @@ test('should dispatch EDIT_QCM_GRAPHIC action via the property onClick of a QCM
73
74
  ];
74
75
  const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
75
76
 
76
- const props = mapStateToSlidesProps(getState(), dispatch, identity);
77
+ const props = mapStateToSlidesProps(getState(), dispatch, connectedOptions);
77
78
  t.deepEqual(omit('answerUI', props.stack.slides['0']), {
78
79
  animationType: undefined,
79
80
  animateCorrectionPopin: false,
@@ -4,13 +4,14 @@ import get from 'lodash/fp/get';
4
4
  import identity from 'lodash/fp/identity';
5
5
  import {mapStateToSlidesProps} from '..';
6
6
  import {ProgressionFromAPI} from '../../../types/common';
7
- import {services} from '../../../test/util/services.mock';
7
+ import {services, translate} from '../../../test/util/services.mock';
8
8
  import {createTestStore} from '../../../actions/test/create-test-store';
9
9
  import {StoreState} from '../../../reducers';
10
10
  import {EDIT_QCM} from '../../../actions/ui/answers';
11
11
  import {Qcm} from '../../../types/slides';
12
12
  import {qcmSlide} from './fixtures/qcm';
13
13
 
14
+ const connectedOptions = {translate, onQuitClick: identity};
14
15
  const progression: ProgressionFromAPI = {
15
16
  _id: '123456789123',
16
17
  content: {type: 'skill', ref: '_skill-ref'},
@@ -75,7 +76,7 @@ test('should dispatch EDIT_QCM action via the property onClick of a QCM slide',
75
76
  ];
76
77
  const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
77
78
 
78
- const props = mapStateToSlidesProps(getState(), dispatch, identity);
79
+ const props = mapStateToSlidesProps(getState(), dispatch, connectedOptions);
79
80
  t.deepEqual(omit('answerUI', props.stack.slides['0']), {
80
81
  animationType: undefined,
81
82
  animateCorrectionPopin: false,
@@ -4,13 +4,14 @@ import get from 'lodash/fp/get';
4
4
  import identity from 'lodash/fp/identity';
5
5
  import {mapStateToSlidesProps} from '..';
6
6
  import {ProgressionFromAPI} from '../../../types/common';
7
- import {services} from '../../../test/util/services.mock';
7
+ import {services, translate} from '../../../test/util/services.mock';
8
8
  import {createTestStore} from '../../../actions/test/create-test-store';
9
9
  import {StoreState} from '../../../reducers';
10
10
  import {EDIT_SLIDER} from '../../../actions/ui/answers';
11
11
  import {QuestionRange} from '../../../types/slides';
12
12
  import {sliderSlide} from './fixtures/slider';
13
13
 
14
+ const connectedOptions = {translate, onQuitClick: identity};
14
15
  const progression: ProgressionFromAPI = {
15
16
  _id: '123456789123',
16
17
  content: {type: 'skill', ref: '_skill-ref'},
@@ -73,7 +74,7 @@ test('should dispatch EDIT_SLIDER action via the property onChange of a Slider s
73
74
  ];
74
75
  const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
75
76
 
76
- const props = mapStateToSlidesProps(getState(), dispatch, identity);
77
+ const props = mapStateToSlidesProps(getState(), dispatch, connectedOptions);
77
78
  t.deepEqual(omit('answerUI', props.stack.slides['0']), {
78
79
  animationType: undefined,
79
80
  animateCorrectionPopin: false,
@@ -5,12 +5,13 @@ import identity from 'lodash/fp/identity';
5
5
  import {ProgressionFromAPI} from '../../../types/common';
6
6
  import {StoreState} from '../../../reducers';
7
7
  import {mapStateToSlidesProps} from '..';
8
- import {services} from '../../../test/util/services.mock';
8
+ import {services, translate} from '../../../test/util/services.mock';
9
9
  import {createTestStore} from '../../../actions/test/create-test-store';
10
10
  import {EDIT_SLIDER} from '../../../actions/ui/answers';
11
11
  import {QuestionRange} from '../../../types/slides';
12
12
  import {sliderSlide} from './fixtures/slider';
13
13
 
14
+ const connectedOptions = {translate, onQuitClick: identity};
14
15
  const progression: ProgressionFromAPI = {
15
16
  _id: '123456789123',
16
17
  content: {type: 'skill', ref: '_skill-ref'},
@@ -72,7 +73,7 @@ test('should dispatch EDIT_SLIDER action via the property onSliderChange of a Sl
72
73
  }
73
74
  ];
74
75
  const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
75
- const props = mapStateToSlidesProps(getState(), dispatch, identity);
76
+ const props = mapStateToSlidesProps(getState(), dispatch, connectedOptions);
76
77
 
77
78
  const slideProps = props.stack.slides['0'].answerUI?.model as QuestionRange;
78
79
  t.deepEqual(omit('answerUI', props.stack.slides['0']), {
@@ -5,13 +5,14 @@ import set from 'lodash/fp/set';
5
5
  import identity from 'lodash/fp/identity';
6
6
  import {mapStateToSlidesProps} from '..';
7
7
  import {ProgressionFromAPI} from '../../../types/common';
8
- import {services} from '../../../test/util/services.mock';
8
+ import {services, translate} from '../../../test/util/services.mock';
9
9
  import {createTestStore} from '../../../actions/test/create-test-store';
10
10
  import {StoreState} from '../../../reducers';
11
11
  import {EDIT_TEMPLATE} from '../../../actions/ui/answers';
12
12
  import {Template, TextTemplate} from '../../../types/slides';
13
13
  import {templateSlide} from './fixtures/template';
14
14
 
15
+ const connectedOptions = {translate, onQuitClick: identity};
15
16
  const progression: ProgressionFromAPI = {
16
17
  _id: '123456789123',
17
18
  content: {type: 'skill', ref: '_skill-ref'},
@@ -71,7 +72,7 @@ test('should dispatch EDIT_TEMPLATE action via the property onChange of a Templa
71
72
  ];
72
73
  const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
73
74
 
74
- const props = mapStateToSlidesProps(getState(), dispatch, identity);
75
+ const props = mapStateToSlidesProps(getState(), dispatch, connectedOptions);
75
76
  t.deepEqual(omit('answerUI', props.stack.slides['0']), {
76
77
  animationType: undefined,
77
78
  animateCorrectionPopin: false,
@@ -102,7 +103,7 @@ test('should dispatch EDIT_TEMPLATE action via the property onChange of a Templa
102
103
  expectedActions
103
104
  );
104
105
 
105
- const props = mapStateToSlidesProps(getState(), dispatch, identity);
106
+ const props = mapStateToSlidesProps(getState(), dispatch, connectedOptions);
106
107
  t.deepEqual(omit('answerUI', props.stack.slides['0']), {
107
108
  animationType: undefined,
108
109
  animateCorrectionPopin: false,
@@ -119,7 +120,7 @@ test('should dispatch EDIT_TEMPLATE action via the property onChange of a Templa
119
120
  const onChangeText = get(['1', 'onChange'], slideProps.answers);
120
121
  onChangeText('');
121
122
 
122
- const newProps = mapStateToSlidesProps(getState(), dispatch, identity);
123
+ const newProps = mapStateToSlidesProps(getState(), dispatch, connectedOptions);
123
124
  const slidePropsAfterOnChange = newProps.stack.slides['0'].answerUI?.model as Template;
124
125
  const textAnswerPropsAfterOnChange = slidePropsAfterOnChange.answers[1] as TextTemplate;
125
126
  t.is(textAnswerPropsAfterOnChange.value, '');
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes