@coorpacademy/app-review 0.5.6-alpha.9 → 0.5.6

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 (253) hide show
  1. package/{lib/src → es}/index.d.ts +1 -0
  2. package/es/{src/index.js → index.js} +4 -4
  3. package/es/{src/test → test}/index.test.js +0 -1
  4. package/{lib/src → es}/test/util/services.mock.d.ts +0 -1
  5. package/es/{src/test → test}/util/services.mock.js +0 -1
  6. package/{lib/src → es}/types/common.d.ts +2 -5
  7. package/{lib/src → es}/views/slides/index.d.ts +1 -2
  8. package/es/{src/views → views}/slides/index.js +18 -20
  9. package/{es/src → lib}/index.d.ts +1 -0
  10. package/lib/{src/index.js → index.js} +5 -4
  11. package/lib/{src/test → test}/index.test.js +0 -1
  12. package/{es/src → lib}/test/util/services.mock.d.ts +0 -1
  13. package/lib/{src/test → test}/util/services.mock.js +0 -1
  14. package/{es/src → lib}/types/common.d.ts +2 -5
  15. package/{es/src → lib}/views/slides/index.d.ts +1 -2
  16. package/lib/{src/views → views}/slides/index.js +18 -20
  17. package/package.json +4 -7
  18. package/src/index.tsx +6 -5
  19. package/src/test/index.test.tsx +0 -1
  20. package/src/test/util/services.mock.ts +0 -2
  21. package/src/types/common.ts +2 -6
  22. package/src/types/globals.d.ts +0 -1
  23. package/src/views/slides/index.ts +19 -43
  24. package/src/views/slides/test/header.on-click.test.ts +3 -10
  25. package/src/views/slides/test/index.test.ts +55 -58
  26. package/src/views/slides/test/on-quit-popin.on-click.test.ts +3 -12
  27. package/src/views/slides/test/slide.free-text.on-change.test.ts +2 -4
  28. package/src/views/slides/test/slide.next-slide.on-click.test.ts +3 -6
  29. package/src/views/slides/test/slide.qcm-drag.on-click.test.ts +2 -3
  30. package/src/views/slides/test/slide.qcm-graphic.on-click.test.ts +2 -3
  31. package/src/views/slides/test/slide.qcm.on-click.test.ts +2 -3
  32. package/src/views/slides/test/slide.slider.on-change.test.ts +2 -3
  33. package/src/views/slides/test/slide.slider.on-slider-change.test.ts +2 -3
  34. package/src/views/slides/test/slide.template.on-change.test.ts +4 -5
  35. package/es/locales/en/review.json +0 -14
  36. package/es/sandbox/index.d.ts +0 -9
  37. package/es/sandbox/index.js +0 -56
  38. package/lib/locales/en/review.json +0 -14
  39. package/lib/sandbox/index.d.ts +0 -9
  40. package/lib/sandbox/index.js +0 -67
  41. package/locales/en/review.json +0 -14
  42. /package/es/{src/actions → actions}/api/fetch-correction.d.ts +0 -0
  43. /package/es/{src/actions → actions}/api/fetch-correction.js +0 -0
  44. /package/es/{src/actions → actions}/api/fetch-rank.d.ts +0 -0
  45. /package/es/{src/actions → actions}/api/fetch-rank.js +0 -0
  46. /package/es/{src/actions → actions}/api/fetch-skills.d.ts +0 -0
  47. /package/es/{src/actions → actions}/api/fetch-skills.js +0 -0
  48. /package/es/{src/actions → actions}/api/fetch-slide.d.ts +0 -0
  49. /package/es/{src/actions → actions}/api/fetch-slide.js +0 -0
  50. /package/es/{src/actions → actions}/api/post-answer.d.ts +0 -0
  51. /package/es/{src/actions → actions}/api/post-answer.js +0 -0
  52. /package/es/{src/actions → actions}/api/post-progression.d.ts +0 -0
  53. /package/es/{src/actions → actions}/api/post-progression.js +0 -0
  54. /package/es/{src/actions → actions}/data/token.d.ts +0 -0
  55. /package/es/{src/actions → actions}/data/token.js +0 -0
  56. /package/es/{src/actions → actions}/index.d.ts +0 -0
  57. /package/es/{src/actions → actions}/index.js +0 -0
  58. /package/es/{src/actions → actions}/test/create-test-store.d.ts +0 -0
  59. /package/es/{src/actions → actions}/test/create-test-store.js +0 -0
  60. /package/es/{src/actions → actions}/ui/answers.d.ts +0 -0
  61. /package/es/{src/actions → actions}/ui/answers.js +0 -0
  62. /package/es/{src/actions → actions}/ui/navigation.d.ts +0 -0
  63. /package/es/{src/actions → actions}/ui/navigation.js +0 -0
  64. /package/es/{src/actions → actions}/ui/next-slide.d.ts +0 -0
  65. /package/es/{src/actions → actions}/ui/next-slide.js +0 -0
  66. /package/es/{src/actions → actions}/ui/quit-popin.d.ts +0 -0
  67. /package/es/{src/actions → actions}/ui/quit-popin.js +0 -0
  68. /package/es/{src/actions → actions}/ui/slides.d.ts +0 -0
  69. /package/es/{src/actions → actions}/ui/slides.js +0 -0
  70. /package/es/{src/common → common}/index.d.ts +0 -0
  71. /package/es/{src/common → common}/index.js +0 -0
  72. /package/es/{src/configure-store.d.ts → configure-store.d.ts} +0 -0
  73. /package/es/{src/configure-store.js → configure-store.js} +0 -0
  74. /package/es/{src/helpers → helpers}/css-register.d.ts +0 -0
  75. /package/es/{src/helpers → helpers}/css-register.js +0 -0
  76. /package/es/{src/reducers → reducers}/data/corrections.d.ts +0 -0
  77. /package/es/{src/reducers → reducers}/data/corrections.js +0 -0
  78. /package/es/{src/reducers → reducers}/data/index.d.ts +0 -0
  79. /package/es/{src/reducers → reducers}/data/index.js +0 -0
  80. /package/es/{src/reducers → reducers}/data/progression.d.ts +0 -0
  81. /package/es/{src/reducers → reducers}/data/progression.js +0 -0
  82. /package/es/{src/reducers → reducers}/data/rank.d.ts +0 -0
  83. /package/es/{src/reducers → reducers}/data/rank.js +0 -0
  84. /package/es/{src/reducers → reducers}/data/skills.d.ts +0 -0
  85. /package/es/{src/reducers → reducers}/data/skills.js +0 -0
  86. /package/es/{src/reducers → reducers}/data/slides.d.ts +0 -0
  87. /package/es/{src/reducers → reducers}/data/slides.js +0 -0
  88. /package/es/{src/reducers → reducers}/data/token.d.ts +0 -0
  89. /package/es/{src/reducers → reducers}/data/token.js +0 -0
  90. /package/es/{src/reducers → reducers}/index.d.ts +0 -0
  91. /package/es/{src/reducers → reducers}/index.js +0 -0
  92. /package/es/{src/reducers → reducers}/ui/answers.d.ts +0 -0
  93. /package/es/{src/reducers → reducers}/ui/answers.js +0 -0
  94. /package/es/{src/reducers → reducers}/ui/current-slide-ref.d.ts +0 -0
  95. /package/es/{src/reducers → reducers}/ui/current-slide-ref.js +0 -0
  96. /package/es/{src/reducers → reducers}/ui/index.d.ts +0 -0
  97. /package/es/{src/reducers → reducers}/ui/index.js +0 -0
  98. /package/es/{src/reducers → reducers}/ui/navigation.d.ts +0 -0
  99. /package/es/{src/reducers → reducers}/ui/navigation.js +0 -0
  100. /package/es/{src/reducers → reducers}/ui/positions.d.ts +0 -0
  101. /package/es/{src/reducers → reducers}/ui/positions.js +0 -0
  102. /package/es/{src/reducers → reducers}/ui/quit-popin.d.ts +0 -0
  103. /package/es/{src/reducers → reducers}/ui/quit-popin.js +0 -0
  104. /package/es/{src/reducers → reducers}/ui/show-congrats.d.ts +0 -0
  105. /package/es/{src/reducers → reducers}/ui/show-congrats.js +0 -0
  106. /package/es/{src/reducers → reducers}/ui/slide.d.ts +0 -0
  107. /package/es/{src/reducers → reducers}/ui/slide.js +0 -0
  108. /package/es/{src/services → services}/fetch-correction.d.ts +0 -0
  109. /package/es/{src/services → services}/fetch-correction.js +0 -0
  110. /package/es/{src/services → services}/fetch-rank.d.ts +0 -0
  111. /package/es/{src/services → services}/fetch-rank.js +0 -0
  112. /package/es/{src/services → services}/fetch-skills.d.ts +0 -0
  113. /package/es/{src/services → services}/fetch-skills.js +0 -0
  114. /package/es/{src/services → services}/fetch-slide.d.ts +0 -0
  115. /package/es/{src/services → services}/fetch-slide.js +0 -0
  116. /package/es/{src/services → services}/fetch-slides-to-review-by-skill-ref.d.ts +0 -0
  117. /package/es/{src/services → services}/fetch-slides-to-review-by-skill-ref.js +0 -0
  118. /package/es/{src/services → services}/index.d.ts +0 -0
  119. /package/es/{src/services → services}/index.js +0 -0
  120. /package/es/{src/services → services}/post-answer.d.ts +0 -0
  121. /package/es/{src/services → services}/post-answer.js +0 -0
  122. /package/es/{src/services → services}/post-progression.d.ts +0 -0
  123. /package/es/{src/services → services}/post-progression.js +0 -0
  124. /package/es/{src/services → services}/tools/fetch-responses.d.ts +0 -0
  125. /package/es/{src/services → services}/tools/fetch-responses.js +0 -0
  126. /package/es/{src/services → services}/tools/sleep.d.ts +0 -0
  127. /package/es/{src/services → services}/tools/sleep.js +0 -0
  128. /package/es/{src/test → test}/index.test.d.ts +0 -0
  129. /package/es/{src/types → types}/common.js +0 -0
  130. /package/es/{src/types → types}/slides.d.ts +0 -0
  131. /package/es/{src/types → types}/slides.js +0 -0
  132. /package/es/{src/views → views}/skills/index.d.ts +0 -0
  133. /package/es/{src/views → views}/skills/index.js +0 -0
  134. /package/es/{src/views → views}/slides/map-api-slide-to-ui.d.ts +0 -0
  135. /package/es/{src/views → views}/slides/map-api-slide-to-ui.js +0 -0
  136. /package/es/{src/views → views}/slides/test/fixtures/free-text.d.ts +0 -0
  137. /package/es/{src/views → views}/slides/test/fixtures/free-text.js +0 -0
  138. /package/es/{src/views → views}/slides/test/fixtures/qcm-drag.d.ts +0 -0
  139. /package/es/{src/views → views}/slides/test/fixtures/qcm-drag.js +0 -0
  140. /package/es/{src/views → views}/slides/test/fixtures/qcm-graphic.d.ts +0 -0
  141. /package/es/{src/views → views}/slides/test/fixtures/qcm-graphic.js +0 -0
  142. /package/es/{src/views → views}/slides/test/fixtures/qcm.d.ts +0 -0
  143. /package/es/{src/views → views}/slides/test/fixtures/qcm.js +0 -0
  144. /package/es/{src/views → views}/slides/test/fixtures/slider.d.ts +0 -0
  145. /package/es/{src/views → views}/slides/test/fixtures/slider.js +0 -0
  146. /package/es/{src/views → views}/slides/test/fixtures/template.d.ts +0 -0
  147. /package/es/{src/views → views}/slides/test/fixtures/template.js +0 -0
  148. /package/lib/{src/actions → actions}/api/fetch-correction.d.ts +0 -0
  149. /package/lib/{src/actions → actions}/api/fetch-correction.js +0 -0
  150. /package/lib/{src/actions → actions}/api/fetch-rank.d.ts +0 -0
  151. /package/lib/{src/actions → actions}/api/fetch-rank.js +0 -0
  152. /package/lib/{src/actions → actions}/api/fetch-skills.d.ts +0 -0
  153. /package/lib/{src/actions → actions}/api/fetch-skills.js +0 -0
  154. /package/lib/{src/actions → actions}/api/fetch-slide.d.ts +0 -0
  155. /package/lib/{src/actions → actions}/api/fetch-slide.js +0 -0
  156. /package/lib/{src/actions → actions}/api/post-answer.d.ts +0 -0
  157. /package/lib/{src/actions → actions}/api/post-answer.js +0 -0
  158. /package/lib/{src/actions → actions}/api/post-progression.d.ts +0 -0
  159. /package/lib/{src/actions → actions}/api/post-progression.js +0 -0
  160. /package/lib/{src/actions → actions}/data/token.d.ts +0 -0
  161. /package/lib/{src/actions → actions}/data/token.js +0 -0
  162. /package/lib/{src/actions → actions}/index.d.ts +0 -0
  163. /package/lib/{src/actions → actions}/index.js +0 -0
  164. /package/lib/{src/actions → actions}/test/create-test-store.d.ts +0 -0
  165. /package/lib/{src/actions → actions}/test/create-test-store.js +0 -0
  166. /package/lib/{src/actions → actions}/ui/answers.d.ts +0 -0
  167. /package/lib/{src/actions → actions}/ui/answers.js +0 -0
  168. /package/lib/{src/actions → actions}/ui/navigation.d.ts +0 -0
  169. /package/lib/{src/actions → actions}/ui/navigation.js +0 -0
  170. /package/lib/{src/actions → actions}/ui/next-slide.d.ts +0 -0
  171. /package/lib/{src/actions → actions}/ui/next-slide.js +0 -0
  172. /package/lib/{src/actions → actions}/ui/quit-popin.d.ts +0 -0
  173. /package/lib/{src/actions → actions}/ui/quit-popin.js +0 -0
  174. /package/lib/{src/actions → actions}/ui/slides.d.ts +0 -0
  175. /package/lib/{src/actions → actions}/ui/slides.js +0 -0
  176. /package/lib/{src/common → common}/index.d.ts +0 -0
  177. /package/lib/{src/common → common}/index.js +0 -0
  178. /package/lib/{src/configure-store.d.ts → configure-store.d.ts} +0 -0
  179. /package/lib/{src/configure-store.js → configure-store.js} +0 -0
  180. /package/lib/{src/helpers → helpers}/css-register.d.ts +0 -0
  181. /package/lib/{src/helpers → helpers}/css-register.js +0 -0
  182. /package/lib/{src/reducers → reducers}/data/corrections.d.ts +0 -0
  183. /package/lib/{src/reducers → reducers}/data/corrections.js +0 -0
  184. /package/lib/{src/reducers → reducers}/data/index.d.ts +0 -0
  185. /package/lib/{src/reducers → reducers}/data/index.js +0 -0
  186. /package/lib/{src/reducers → reducers}/data/progression.d.ts +0 -0
  187. /package/lib/{src/reducers → reducers}/data/progression.js +0 -0
  188. /package/lib/{src/reducers → reducers}/data/rank.d.ts +0 -0
  189. /package/lib/{src/reducers → reducers}/data/rank.js +0 -0
  190. /package/lib/{src/reducers → reducers}/data/skills.d.ts +0 -0
  191. /package/lib/{src/reducers → reducers}/data/skills.js +0 -0
  192. /package/lib/{src/reducers → reducers}/data/slides.d.ts +0 -0
  193. /package/lib/{src/reducers → reducers}/data/slides.js +0 -0
  194. /package/lib/{src/reducers → reducers}/data/token.d.ts +0 -0
  195. /package/lib/{src/reducers → reducers}/data/token.js +0 -0
  196. /package/lib/{src/reducers → reducers}/index.d.ts +0 -0
  197. /package/lib/{src/reducers → reducers}/index.js +0 -0
  198. /package/lib/{src/reducers → reducers}/ui/answers.d.ts +0 -0
  199. /package/lib/{src/reducers → reducers}/ui/answers.js +0 -0
  200. /package/lib/{src/reducers → reducers}/ui/current-slide-ref.d.ts +0 -0
  201. /package/lib/{src/reducers → reducers}/ui/current-slide-ref.js +0 -0
  202. /package/lib/{src/reducers → reducers}/ui/index.d.ts +0 -0
  203. /package/lib/{src/reducers → reducers}/ui/index.js +0 -0
  204. /package/lib/{src/reducers → reducers}/ui/navigation.d.ts +0 -0
  205. /package/lib/{src/reducers → reducers}/ui/navigation.js +0 -0
  206. /package/lib/{src/reducers → reducers}/ui/positions.d.ts +0 -0
  207. /package/lib/{src/reducers → reducers}/ui/positions.js +0 -0
  208. /package/lib/{src/reducers → reducers}/ui/quit-popin.d.ts +0 -0
  209. /package/lib/{src/reducers → reducers}/ui/quit-popin.js +0 -0
  210. /package/lib/{src/reducers → reducers}/ui/show-congrats.d.ts +0 -0
  211. /package/lib/{src/reducers → reducers}/ui/show-congrats.js +0 -0
  212. /package/lib/{src/reducers → reducers}/ui/slide.d.ts +0 -0
  213. /package/lib/{src/reducers → reducers}/ui/slide.js +0 -0
  214. /package/lib/{src/services → services}/fetch-correction.d.ts +0 -0
  215. /package/lib/{src/services → services}/fetch-correction.js +0 -0
  216. /package/lib/{src/services → services}/fetch-rank.d.ts +0 -0
  217. /package/lib/{src/services → services}/fetch-rank.js +0 -0
  218. /package/lib/{src/services → services}/fetch-skills.d.ts +0 -0
  219. /package/lib/{src/services → services}/fetch-skills.js +0 -0
  220. /package/lib/{src/services → services}/fetch-slide.d.ts +0 -0
  221. /package/lib/{src/services → services}/fetch-slide.js +0 -0
  222. /package/lib/{src/services → services}/fetch-slides-to-review-by-skill-ref.d.ts +0 -0
  223. /package/lib/{src/services → services}/fetch-slides-to-review-by-skill-ref.js +0 -0
  224. /package/lib/{src/services → services}/index.d.ts +0 -0
  225. /package/lib/{src/services → services}/index.js +0 -0
  226. /package/lib/{src/services → services}/post-answer.d.ts +0 -0
  227. /package/lib/{src/services → services}/post-answer.js +0 -0
  228. /package/lib/{src/services → services}/post-progression.d.ts +0 -0
  229. /package/lib/{src/services → services}/post-progression.js +0 -0
  230. /package/lib/{src/services → services}/tools/fetch-responses.d.ts +0 -0
  231. /package/lib/{src/services → services}/tools/fetch-responses.js +0 -0
  232. /package/lib/{src/services → services}/tools/sleep.d.ts +0 -0
  233. /package/lib/{src/services → services}/tools/sleep.js +0 -0
  234. /package/lib/{src/test → test}/index.test.d.ts +0 -0
  235. /package/lib/{src/types → types}/common.js +0 -0
  236. /package/lib/{src/types → types}/slides.d.ts +0 -0
  237. /package/lib/{src/types → types}/slides.js +0 -0
  238. /package/lib/{src/views → views}/skills/index.d.ts +0 -0
  239. /package/lib/{src/views → views}/skills/index.js +0 -0
  240. /package/lib/{src/views → views}/slides/map-api-slide-to-ui.d.ts +0 -0
  241. /package/lib/{src/views → views}/slides/map-api-slide-to-ui.js +0 -0
  242. /package/lib/{src/views → views}/slides/test/fixtures/free-text.d.ts +0 -0
  243. /package/lib/{src/views → views}/slides/test/fixtures/free-text.js +0 -0
  244. /package/lib/{src/views → views}/slides/test/fixtures/qcm-drag.d.ts +0 -0
  245. /package/lib/{src/views → views}/slides/test/fixtures/qcm-drag.js +0 -0
  246. /package/lib/{src/views → views}/slides/test/fixtures/qcm-graphic.d.ts +0 -0
  247. /package/lib/{src/views → views}/slides/test/fixtures/qcm-graphic.js +0 -0
  248. /package/lib/{src/views → views}/slides/test/fixtures/qcm.d.ts +0 -0
  249. /package/lib/{src/views → views}/slides/test/fixtures/qcm.js +0 -0
  250. /package/lib/{src/views → views}/slides/test/fixtures/slider.d.ts +0 -0
  251. /package/lib/{src/views → views}/slides/test/fixtures/slider.js +0 -0
  252. /package/lib/{src/views → views}/slides/test/fixtures/template.d.ts +0 -0
  253. /package/lib/{src/views → views}/slides/test/fixtures/template.js +0 -0
@@ -4,14 +4,13 @@ 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, translate} from '../../../test/util/services.mock';
7
+ import {services} 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};
15
14
  const progression: ProgressionFromAPI = {
16
15
  _id: '123456789123',
17
16
  content: {type: 'skill', ref: '_skill-ref'},
@@ -76,7 +75,7 @@ test('should dispatch EDIT_QCM action via the property onClick of a QCM slide',
76
75
  ];
77
76
  const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
78
77
 
79
- const props = mapStateToSlidesProps(getState(), dispatch, connectedOptions);
78
+ const props = mapStateToSlidesProps(getState(), dispatch, identity);
80
79
  t.deepEqual(omit('answerUI', props.stack.slides['0']), {
81
80
  animationType: undefined,
82
81
  animateCorrectionPopin: false,
@@ -4,14 +4,13 @@ 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, translate} from '../../../test/util/services.mock';
7
+ import {services} 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};
15
14
  const progression: ProgressionFromAPI = {
16
15
  _id: '123456789123',
17
16
  content: {type: 'skill', ref: '_skill-ref'},
@@ -74,7 +73,7 @@ test('should dispatch EDIT_SLIDER action via the property onChange of a Slider s
74
73
  ];
75
74
  const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
76
75
 
77
- const props = mapStateToSlidesProps(getState(), dispatch, connectedOptions);
76
+ const props = mapStateToSlidesProps(getState(), dispatch, identity);
78
77
  t.deepEqual(omit('answerUI', props.stack.slides['0']), {
79
78
  animationType: undefined,
80
79
  animateCorrectionPopin: false,
@@ -5,13 +5,12 @@ 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, translate} from '../../../test/util/services.mock';
8
+ import {services} 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};
15
14
  const progression: ProgressionFromAPI = {
16
15
  _id: '123456789123',
17
16
  content: {type: 'skill', ref: '_skill-ref'},
@@ -73,7 +72,7 @@ test('should dispatch EDIT_SLIDER action via the property onSliderChange of a Sl
73
72
  }
74
73
  ];
75
74
  const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
76
- const props = mapStateToSlidesProps(getState(), dispatch, connectedOptions);
75
+ const props = mapStateToSlidesProps(getState(), dispatch, identity);
77
76
 
78
77
  const slideProps = props.stack.slides['0'].answerUI?.model as QuestionRange;
79
78
  t.deepEqual(omit('answerUI', props.stack.slides['0']), {
@@ -5,14 +5,13 @@ 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, translate} from '../../../test/util/services.mock';
8
+ import {services} 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};
16
15
  const progression: ProgressionFromAPI = {
17
16
  _id: '123456789123',
18
17
  content: {type: 'skill', ref: '_skill-ref'},
@@ -72,7 +71,7 @@ test('should dispatch EDIT_TEMPLATE action via the property onChange of a Templa
72
71
  ];
73
72
  const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
74
73
 
75
- const props = mapStateToSlidesProps(getState(), dispatch, connectedOptions);
74
+ const props = mapStateToSlidesProps(getState(), dispatch, identity);
76
75
  t.deepEqual(omit('answerUI', props.stack.slides['0']), {
77
76
  animationType: undefined,
78
77
  animateCorrectionPopin: false,
@@ -103,7 +102,7 @@ test('should dispatch EDIT_TEMPLATE action via the property onChange of a Templa
103
102
  expectedActions
104
103
  );
105
104
 
106
- const props = mapStateToSlidesProps(getState(), dispatch, connectedOptions);
105
+ const props = mapStateToSlidesProps(getState(), dispatch, identity);
107
106
  t.deepEqual(omit('answerUI', props.stack.slides['0']), {
108
107
  animationType: undefined,
109
108
  animateCorrectionPopin: false,
@@ -120,7 +119,7 @@ test('should dispatch EDIT_TEMPLATE action via the property onChange of a Templa
120
119
  const onChangeText = get(['1', 'onChange'], slideProps.answers);
121
120
  onChangeText('');
122
121
 
123
- const newProps = mapStateToSlidesProps(getState(), dispatch, connectedOptions);
122
+ const newProps = mapStateToSlidesProps(getState(), dispatch, identity);
124
123
  const slidePropsAfterOnChange = newProps.stack.slides['0'].answerUI?.model as Template;
125
124
  const textAnswerPropsAfterOnChange = slidePropsAfterOnChange.answers[1] as TextTemplate;
126
125
  t.is(textAnswerPropsAfterOnChange.value, '');
@@ -1,14 +0,0 @@
1
- {
2
- "Review Title": "Review Mode",
3
- "Content Parent Title": "From `{{contentTitle}}` `{{contentType}}`",
4
- "Validate": "Validate",
5
- "Next Question": "Next Question",
6
- "KLF": "Key Learning Factor",
7
- "Correct Answer": "Correct Answer",
8
- "Wrong Answer": "Wrong Answer",
9
- "You have won": "You have won",
10
- "You are now": "You are now",
11
- "Revise another skill": "Revise another skill",
12
- "Continue reviewing": "Continue reviewing",
13
- "Congratulations!": "Congratulations!"
14
- }
@@ -1,9 +0,0 @@
1
- declare type SandboxOptions = {
2
- container: string;
3
- };
4
- declare global {
5
- interface Window {
6
- createSandbox?: (sandboxOptions: SandboxOptions) => void;
7
- }
8
- }
9
- export {};
@@ -1,56 +0,0 @@
1
- import React from 'react';
2
- import { render } from 'react-dom';
3
- import isNil from 'lodash/fp/isNil';
4
- import get from 'lodash/fp/get';
5
- import pipe from 'lodash/fp/pipe';
6
- import createTranslate from '@coorpacademy/translate';
7
- import { WebContext } from '@coorpacademy/components/es/atom/provider';
8
- import localesComponents from '@coorpacademy/components/locales/en/global.json';
9
- import localesAppReview from '../locales/en/review.json';
10
- import AppReview from '../src';
11
- import { services } from '../src/test/util/services.mock';
12
- const translate = (key, data) => {
13
- try {
14
- return createTranslate({
15
- ...localesAppReview,
16
- ...localesComponents
17
- })(key, data);
18
- }
19
- catch (err) {
20
- // eslint-disable-next-line no-console
21
- console.error(err);
22
- return createTranslate({ [key]: key })(key, data);
23
- }
24
- };
25
- const isContainerAvailable = (options) => !pipe(get('container'), isNil)(options);
26
- const createSandbox = (options) => {
27
- if (!isContainerAvailable(options)) {
28
- // eslint-disable-next-line no-console
29
- console.error('[AppReview sandbox] Requires a container.');
30
- }
31
- else {
32
- const container = document.getElementById(options.container);
33
- // mode mobile/web
34
- const appOptions = {
35
- token: process.env.API_TEST_TOKEN || '',
36
- skillRef: '123',
37
- services,
38
- translate,
39
- onQuitClick: () => {
40
- location.reload();
41
- },
42
- url: process.env.LAMBDA_API_REVIEW_GET_SLIDES_URL || 'http://localhost:7006'
43
- };
44
- const skin = {
45
- common: {
46
- primary: '#248e59'
47
- }
48
- };
49
- render(React.createElement(WebContext, { skin: skin, translate: translate },
50
- React.createElement(AppReview, { options: appOptions })), container);
51
- }
52
- };
53
- if (window && !window.createSandbox) {
54
- window.createSandbox = createSandbox;
55
- }
56
- createSandbox({ container: 'root' });
@@ -1,14 +0,0 @@
1
- {
2
- "Review Title": "Review Mode",
3
- "Content Parent Title": "From `{{contentTitle}}` `{{contentType}}`",
4
- "Validate": "Validate",
5
- "Next Question": "Next Question",
6
- "KLF": "Key Learning Factor",
7
- "Correct Answer": "Correct Answer",
8
- "Wrong Answer": "Wrong Answer",
9
- "You have won": "You have won",
10
- "You are now": "You are now",
11
- "Revise another skill": "Revise another skill",
12
- "Continue reviewing": "Continue reviewing",
13
- "Congratulations!": "Congratulations!"
14
- }
@@ -1,9 +0,0 @@
1
- declare type SandboxOptions = {
2
- container: string;
3
- };
4
- declare global {
5
- interface Window {
6
- createSandbox?: (sandboxOptions: SandboxOptions) => void;
7
- }
8
- }
9
- export {};
@@ -1,67 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import React from 'react';
13
- import { render } from 'react-dom';
14
- import isNil from 'lodash/fp/isNil';
15
- import get from 'lodash/fp/get';
16
- import pipe from 'lodash/fp/pipe';
17
- import createTranslate from '@coorpacademy/translate';
18
- import { WebContext } from '@coorpacademy/components/es/atom/provider';
19
- import localesComponents from '@coorpacademy/components/locales/en/global.json';
20
- import localesAppReview from '../locales/en/review.json';
21
- import AppReview from '../src';
22
- import { services } from '../src/test/util/services.mock';
23
- var translate = function (key, data) {
24
- var _a;
25
- try {
26
- return createTranslate(__assign(__assign({}, localesAppReview), localesComponents))(key, data);
27
- }
28
- catch (err) {
29
- // eslint-disable-next-line no-console
30
- console.error(err);
31
- return createTranslate((_a = {}, _a[key] = key, _a))(key, data);
32
- }
33
- };
34
- var isContainerAvailable = function (options) {
35
- return !pipe(get('container'), isNil)(options);
36
- };
37
- var createSandbox = function (options) {
38
- if (!isContainerAvailable(options)) {
39
- // eslint-disable-next-line no-console
40
- console.error('[AppReview sandbox] Requires a container.');
41
- }
42
- else {
43
- var container = document.getElementById(options.container);
44
- // mode mobile/web
45
- var appOptions = {
46
- token: process.env.API_TEST_TOKEN || '',
47
- skillRef: '123',
48
- services: services,
49
- translate: translate,
50
- onQuitClick: function () {
51
- location.reload();
52
- },
53
- url: process.env.LAMBDA_API_REVIEW_GET_SLIDES_URL || 'http://localhost:7006'
54
- };
55
- var skin = {
56
- common: {
57
- primary: '#248e59'
58
- }
59
- };
60
- render(React.createElement(WebContext, { skin: skin, translate: translate },
61
- React.createElement(AppReview, { options: appOptions })), container);
62
- }
63
- };
64
- if (window && !window.createSandbox) {
65
- window.createSandbox = createSandbox;
66
- }
67
- createSandbox({ container: 'root' });
@@ -1,14 +0,0 @@
1
- {
2
- "Review Title": "Review Mode",
3
- "Content Parent Title": "From `{{contentTitle}}` `{{contentType}}`",
4
- "Validate": "Validate",
5
- "Next Question": "Next Question",
6
- "KLF": "Key Learning Factor",
7
- "Correct Answer": "Correct Answer",
8
- "Wrong Answer": "Wrong Answer",
9
- "You have won": "You have won",
10
- "You are now": "You are now",
11
- "Revise another skill": "Revise another skill",
12
- "Continue reviewing": "Continue reviewing",
13
- "Congratulations!": "Congratulations!"
14
- }
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
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
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
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
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes