@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.
- package/es/locales/en/review.json +14 -0
- package/es/sandbox/index.d.ts +9 -0
- package/es/sandbox/index.js +56 -0
- package/es/{index.js → src/index.js} +6 -5
- package/es/src/services/fetch-slides-to-review-by-skill-ref.d.ts +2 -0
- package/es/src/services/fetch-slides-to-review-by-skill-ref.js +8 -0
- package/es/{services → src/services}/index.js +2 -0
- package/es/{test → src/test}/index.test.js +3 -1
- package/{lib → es/src}/test/util/services.mock.d.ts +1 -0
- package/es/{test → src/test}/util/services.mock.js +20 -1
- package/{lib → es/src}/types/common.d.ts +10 -2
- package/{lib → es/src}/views/slides/index.d.ts +2 -1
- package/es/{views → src/views}/slides/index.js +20 -18
- package/lib/locales/en/review.json +14 -0
- package/lib/sandbox/index.d.ts +9 -0
- package/lib/sandbox/index.js +67 -0
- package/lib/{index.js → src/index.js} +6 -6
- package/lib/src/services/fetch-slides-to-review-by-skill-ref.d.ts +2 -0
- package/lib/src/services/fetch-slides-to-review-by-skill-ref.js +52 -0
- package/lib/{services → src/services}/index.js +2 -0
- package/lib/{test → src/test}/index.test.js +3 -1
- package/{es → lib/src}/test/util/services.mock.d.ts +1 -0
- package/lib/{test → src/test}/util/services.mock.js +20 -1
- package/{es → lib/src}/types/common.d.ts +10 -2
- package/{es → lib/src}/views/slides/index.d.ts +2 -1
- package/lib/{views → src/views}/slides/index.js +20 -18
- package/locales/en/review.json +14 -0
- package/package.json +9 -6
- package/src/index.tsx +7 -7
- package/src/services/fetch-slides-to-review-by-skill-ref.ts +18 -0
- package/src/services/index.ts +2 -0
- package/src/services/test/fetch-slides-to-review-by-skill-ref.test.ts +51 -0
- package/src/test/index.test.tsx +3 -1
- package/src/test/util/services.mock.ts +24 -2
- package/src/types/common.ts +16 -2
- package/src/types/globals.d.ts +1 -0
- package/src/views/slides/index.ts +43 -19
- package/src/views/slides/test/header.on-click.test.ts +10 -3
- package/src/views/slides/test/index.test.ts +58 -55
- package/src/views/slides/test/on-quit-popin.on-click.test.ts +12 -3
- package/src/views/slides/test/slide.free-text.on-change.test.ts +4 -2
- package/src/views/slides/test/slide.next-slide.on-click.test.ts +6 -3
- package/src/views/slides/test/slide.qcm-drag.on-click.test.ts +3 -2
- package/src/views/slides/test/slide.qcm-graphic.on-click.test.ts +3 -2
- package/src/views/slides/test/slide.qcm.on-click.test.ts +3 -2
- package/src/views/slides/test/slide.slider.on-change.test.ts +3 -2
- package/src/views/slides/test/slide.slider.on-slider-change.test.ts +3 -2
- package/src/views/slides/test/slide.template.on-change.test.ts +5 -4
- /package/es/{actions → src/actions}/api/fetch-correction.d.ts +0 -0
- /package/es/{actions → src/actions}/api/fetch-correction.js +0 -0
- /package/es/{actions → src/actions}/api/fetch-rank.d.ts +0 -0
- /package/es/{actions → src/actions}/api/fetch-rank.js +0 -0
- /package/es/{actions → src/actions}/api/fetch-skills.d.ts +0 -0
- /package/es/{actions → src/actions}/api/fetch-skills.js +0 -0
- /package/es/{actions → src/actions}/api/fetch-slide.d.ts +0 -0
- /package/es/{actions → src/actions}/api/fetch-slide.js +0 -0
- /package/es/{actions → src/actions}/api/post-answer.d.ts +0 -0
- /package/es/{actions → src/actions}/api/post-answer.js +0 -0
- /package/es/{actions → src/actions}/api/post-progression.d.ts +0 -0
- /package/es/{actions → src/actions}/api/post-progression.js +0 -0
- /package/es/{actions → src/actions}/data/token.d.ts +0 -0
- /package/es/{actions → src/actions}/data/token.js +0 -0
- /package/es/{actions → src/actions}/index.d.ts +0 -0
- /package/es/{actions → src/actions}/index.js +0 -0
- /package/es/{actions → src/actions}/test/create-test-store.d.ts +0 -0
- /package/es/{actions → src/actions}/test/create-test-store.js +0 -0
- /package/es/{actions → src/actions}/ui/answers.d.ts +0 -0
- /package/es/{actions → src/actions}/ui/answers.js +0 -0
- /package/es/{actions → src/actions}/ui/navigation.d.ts +0 -0
- /package/es/{actions → src/actions}/ui/navigation.js +0 -0
- /package/es/{actions → src/actions}/ui/next-slide.d.ts +0 -0
- /package/es/{actions → src/actions}/ui/next-slide.js +0 -0
- /package/es/{actions → src/actions}/ui/quit-popin.d.ts +0 -0
- /package/es/{actions → src/actions}/ui/quit-popin.js +0 -0
- /package/es/{actions → src/actions}/ui/slides.d.ts +0 -0
- /package/es/{actions → src/actions}/ui/slides.js +0 -0
- /package/es/{common → src/common}/index.d.ts +0 -0
- /package/es/{common → src/common}/index.js +0 -0
- /package/es/{configure-store.d.ts → src/configure-store.d.ts} +0 -0
- /package/es/{configure-store.js → src/configure-store.js} +0 -0
- /package/es/{helpers → src/helpers}/css-register.d.ts +0 -0
- /package/es/{helpers → src/helpers}/css-register.js +0 -0
- /package/es/{index.d.ts → src/index.d.ts} +0 -0
- /package/es/{reducers → src/reducers}/data/corrections.d.ts +0 -0
- /package/es/{reducers → src/reducers}/data/corrections.js +0 -0
- /package/es/{reducers → src/reducers}/data/index.d.ts +0 -0
- /package/es/{reducers → src/reducers}/data/index.js +0 -0
- /package/es/{reducers → src/reducers}/data/progression.d.ts +0 -0
- /package/es/{reducers → src/reducers}/data/progression.js +0 -0
- /package/es/{reducers → src/reducers}/data/rank.d.ts +0 -0
- /package/es/{reducers → src/reducers}/data/rank.js +0 -0
- /package/es/{reducers → src/reducers}/data/skills.d.ts +0 -0
- /package/es/{reducers → src/reducers}/data/skills.js +0 -0
- /package/es/{reducers → src/reducers}/data/slides.d.ts +0 -0
- /package/es/{reducers → src/reducers}/data/slides.js +0 -0
- /package/es/{reducers → src/reducers}/data/token.d.ts +0 -0
- /package/es/{reducers → src/reducers}/data/token.js +0 -0
- /package/es/{reducers → src/reducers}/index.d.ts +0 -0
- /package/es/{reducers → src/reducers}/index.js +0 -0
- /package/es/{reducers → src/reducers}/ui/answers.d.ts +0 -0
- /package/es/{reducers → src/reducers}/ui/answers.js +0 -0
- /package/es/{reducers → src/reducers}/ui/current-slide-ref.d.ts +0 -0
- /package/es/{reducers → src/reducers}/ui/current-slide-ref.js +0 -0
- /package/es/{reducers → src/reducers}/ui/index.d.ts +0 -0
- /package/es/{reducers → src/reducers}/ui/index.js +0 -0
- /package/es/{reducers → src/reducers}/ui/navigation.d.ts +0 -0
- /package/es/{reducers → src/reducers}/ui/navigation.js +0 -0
- /package/es/{reducers → src/reducers}/ui/positions.d.ts +0 -0
- /package/es/{reducers → src/reducers}/ui/positions.js +0 -0
- /package/es/{reducers → src/reducers}/ui/quit-popin.d.ts +0 -0
- /package/es/{reducers → src/reducers}/ui/quit-popin.js +0 -0
- /package/es/{reducers → src/reducers}/ui/show-congrats.d.ts +0 -0
- /package/es/{reducers → src/reducers}/ui/show-congrats.js +0 -0
- /package/es/{reducers → src/reducers}/ui/slide.d.ts +0 -0
- /package/es/{reducers → src/reducers}/ui/slide.js +0 -0
- /package/es/{services → src/services}/fetch-correction.d.ts +0 -0
- /package/es/{services → src/services}/fetch-correction.js +0 -0
- /package/es/{services → src/services}/fetch-rank.d.ts +0 -0
- /package/es/{services → src/services}/fetch-rank.js +0 -0
- /package/es/{services → src/services}/fetch-skills.d.ts +0 -0
- /package/es/{services → src/services}/fetch-skills.js +0 -0
- /package/es/{services → src/services}/fetch-slide.d.ts +0 -0
- /package/es/{services → src/services}/fetch-slide.js +0 -0
- /package/es/{services → src/services}/index.d.ts +0 -0
- /package/es/{services → src/services}/post-answer.d.ts +0 -0
- /package/es/{services → src/services}/post-answer.js +0 -0
- /package/es/{services → src/services}/post-progression.d.ts +0 -0
- /package/es/{services → src/services}/post-progression.js +0 -0
- /package/es/{services → src/services}/tools/fetch-responses.d.ts +0 -0
- /package/es/{services → src/services}/tools/fetch-responses.js +0 -0
- /package/es/{services → src/services}/tools/sleep.d.ts +0 -0
- /package/es/{services → src/services}/tools/sleep.js +0 -0
- /package/es/{test → src/test}/index.test.d.ts +0 -0
- /package/es/{types → src/types}/common.js +0 -0
- /package/es/{types → src/types}/slides.d.ts +0 -0
- /package/es/{types → src/types}/slides.js +0 -0
- /package/es/{views → src/views}/skills/index.d.ts +0 -0
- /package/es/{views → src/views}/skills/index.js +0 -0
- /package/es/{views → src/views}/slides/map-api-slide-to-ui.d.ts +0 -0
- /package/es/{views → src/views}/slides/map-api-slide-to-ui.js +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/free-text.d.ts +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/free-text.js +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/qcm-drag.d.ts +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/qcm-drag.js +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/qcm-graphic.d.ts +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/qcm-graphic.js +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/qcm.d.ts +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/qcm.js +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/slider.d.ts +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/slider.js +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/template.d.ts +0 -0
- /package/es/{views → src/views}/slides/test/fixtures/template.js +0 -0
- /package/lib/{actions → src/actions}/api/fetch-correction.d.ts +0 -0
- /package/lib/{actions → src/actions}/api/fetch-correction.js +0 -0
- /package/lib/{actions → src/actions}/api/fetch-rank.d.ts +0 -0
- /package/lib/{actions → src/actions}/api/fetch-rank.js +0 -0
- /package/lib/{actions → src/actions}/api/fetch-skills.d.ts +0 -0
- /package/lib/{actions → src/actions}/api/fetch-skills.js +0 -0
- /package/lib/{actions → src/actions}/api/fetch-slide.d.ts +0 -0
- /package/lib/{actions → src/actions}/api/fetch-slide.js +0 -0
- /package/lib/{actions → src/actions}/api/post-answer.d.ts +0 -0
- /package/lib/{actions → src/actions}/api/post-answer.js +0 -0
- /package/lib/{actions → src/actions}/api/post-progression.d.ts +0 -0
- /package/lib/{actions → src/actions}/api/post-progression.js +0 -0
- /package/lib/{actions → src/actions}/data/token.d.ts +0 -0
- /package/lib/{actions → src/actions}/data/token.js +0 -0
- /package/lib/{actions → src/actions}/index.d.ts +0 -0
- /package/lib/{actions → src/actions}/index.js +0 -0
- /package/lib/{actions → src/actions}/test/create-test-store.d.ts +0 -0
- /package/lib/{actions → src/actions}/test/create-test-store.js +0 -0
- /package/lib/{actions → src/actions}/ui/answers.d.ts +0 -0
- /package/lib/{actions → src/actions}/ui/answers.js +0 -0
- /package/lib/{actions → src/actions}/ui/navigation.d.ts +0 -0
- /package/lib/{actions → src/actions}/ui/navigation.js +0 -0
- /package/lib/{actions → src/actions}/ui/next-slide.d.ts +0 -0
- /package/lib/{actions → src/actions}/ui/next-slide.js +0 -0
- /package/lib/{actions → src/actions}/ui/quit-popin.d.ts +0 -0
- /package/lib/{actions → src/actions}/ui/quit-popin.js +0 -0
- /package/lib/{actions → src/actions}/ui/slides.d.ts +0 -0
- /package/lib/{actions → src/actions}/ui/slides.js +0 -0
- /package/lib/{common → src/common}/index.d.ts +0 -0
- /package/lib/{common → src/common}/index.js +0 -0
- /package/lib/{configure-store.d.ts → src/configure-store.d.ts} +0 -0
- /package/lib/{configure-store.js → src/configure-store.js} +0 -0
- /package/lib/{helpers → src/helpers}/css-register.d.ts +0 -0
- /package/lib/{helpers → src/helpers}/css-register.js +0 -0
- /package/lib/{index.d.ts → src/index.d.ts} +0 -0
- /package/lib/{reducers → src/reducers}/data/corrections.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/data/corrections.js +0 -0
- /package/lib/{reducers → src/reducers}/data/index.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/data/index.js +0 -0
- /package/lib/{reducers → src/reducers}/data/progression.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/data/progression.js +0 -0
- /package/lib/{reducers → src/reducers}/data/rank.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/data/rank.js +0 -0
- /package/lib/{reducers → src/reducers}/data/skills.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/data/skills.js +0 -0
- /package/lib/{reducers → src/reducers}/data/slides.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/data/slides.js +0 -0
- /package/lib/{reducers → src/reducers}/data/token.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/data/token.js +0 -0
- /package/lib/{reducers → src/reducers}/index.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/index.js +0 -0
- /package/lib/{reducers → src/reducers}/ui/answers.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/ui/answers.js +0 -0
- /package/lib/{reducers → src/reducers}/ui/current-slide-ref.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/ui/current-slide-ref.js +0 -0
- /package/lib/{reducers → src/reducers}/ui/index.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/ui/index.js +0 -0
- /package/lib/{reducers → src/reducers}/ui/navigation.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/ui/navigation.js +0 -0
- /package/lib/{reducers → src/reducers}/ui/positions.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/ui/positions.js +0 -0
- /package/lib/{reducers → src/reducers}/ui/quit-popin.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/ui/quit-popin.js +0 -0
- /package/lib/{reducers → src/reducers}/ui/show-congrats.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/ui/show-congrats.js +0 -0
- /package/lib/{reducers → src/reducers}/ui/slide.d.ts +0 -0
- /package/lib/{reducers → src/reducers}/ui/slide.js +0 -0
- /package/lib/{services → src/services}/fetch-correction.d.ts +0 -0
- /package/lib/{services → src/services}/fetch-correction.js +0 -0
- /package/lib/{services → src/services}/fetch-rank.d.ts +0 -0
- /package/lib/{services → src/services}/fetch-rank.js +0 -0
- /package/lib/{services → src/services}/fetch-skills.d.ts +0 -0
- /package/lib/{services → src/services}/fetch-skills.js +0 -0
- /package/lib/{services → src/services}/fetch-slide.d.ts +0 -0
- /package/lib/{services → src/services}/fetch-slide.js +0 -0
- /package/lib/{services → src/services}/index.d.ts +0 -0
- /package/lib/{services → src/services}/post-answer.d.ts +0 -0
- /package/lib/{services → src/services}/post-answer.js +0 -0
- /package/lib/{services → src/services}/post-progression.d.ts +0 -0
- /package/lib/{services → src/services}/post-progression.js +0 -0
- /package/lib/{services → src/services}/tools/fetch-responses.d.ts +0 -0
- /package/lib/{services → src/services}/tools/fetch-responses.js +0 -0
- /package/lib/{services → src/services}/tools/sleep.d.ts +0 -0
- /package/lib/{services → src/services}/tools/sleep.js +0 -0
- /package/lib/{test → src/test}/index.test.d.ts +0 -0
- /package/lib/{types → src/types}/common.js +0 -0
- /package/lib/{types → src/types}/slides.d.ts +0 -0
- /package/lib/{types → src/types}/slides.js +0 -0
- /package/lib/{views → src/views}/skills/index.d.ts +0 -0
- /package/lib/{views → src/views}/skills/index.js +0 -0
- /package/lib/{views → src/views}/slides/map-api-slide-to-ui.d.ts +0 -0
- /package/lib/{views → src/views}/slides/map-api-slide-to-ui.js +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/free-text.d.ts +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/free-text.js +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/qcm-drag.d.ts +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/qcm-drag.js +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/qcm-graphic.d.ts +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/qcm-graphic.js +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/qcm.d.ts +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/qcm.js +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/slider.d.ts +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/slider.js +0 -0
- /package/lib/{views → src/views}/slides/test/fixtures/template.d.ts +0 -0
- /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,
|
|
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: '
|
|
57
|
-
skillName: '
|
|
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,
|
|
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: '
|
|
150
|
-
skillName: '
|
|
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,
|
|
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: '
|
|
258
|
-
skillName: '
|
|
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,
|
|
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: '
|
|
372
|
-
skillName: '
|
|
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,
|
|
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: '
|
|
490
|
-
skillName: '
|
|
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,
|
|
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: '
|
|
565
|
-
skillName: '
|
|
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: '
|
|
599
|
+
resultLabel: translate('Correct Answer'),
|
|
597
600
|
information: {
|
|
598
|
-
label: '
|
|
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: '
|
|
605
|
-
label: '
|
|
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,
|
|
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: '
|
|
697
|
-
skillName: '
|
|
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: '
|
|
731
|
+
resultLabel: translate('Wrong Answer'),
|
|
729
732
|
information: {
|
|
730
|
-
label: '
|
|
733
|
+
label: translate('Correct Answer'),
|
|
731
734
|
message: 'Benchmark'
|
|
732
735
|
},
|
|
733
736
|
klf: {
|
|
734
|
-
label: '
|
|
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: '
|
|
740
|
-
label: '
|
|
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,
|
|
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: '
|
|
836
|
-
skillName: '
|
|
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,
|
|
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: '
|
|
969
|
-
skillName: '
|
|
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: '
|
|
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: '
|
|
1008
|
-
label: '
|
|
1010
|
+
ariaLabel: translate('Next Question'),
|
|
1011
|
+
label: translate('Next Question')
|
|
1009
1012
|
},
|
|
1010
|
-
resultLabel: '
|
|
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,
|
|
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,
|
|
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,
|
|
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: '
|
|
1333
|
-
skillName: '
|
|
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,
|
|
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: '
|
|
1439
|
-
skillName: '
|
|
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,
|
|
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 {
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
|
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
|