@coorpacademy/app-review 0.3.1 → 0.3.3
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/index.js +4 -3
- package/es/reducers/data/corrections.js +2 -2
- package/es/reducers/ui/answers.js +1 -1
- package/es/test/index.test.js +3 -1
- package/es/types/common.d.ts +1 -0
- package/es/views/slides/index.d.ts +1 -1
- package/es/views/slides/index.js +2 -5
- package/lib/index.js +5 -3
- package/lib/reducers/data/corrections.js +2 -2
- package/lib/reducers/ui/answers.js +1 -1
- package/lib/test/index.test.js +3 -1
- package/lib/types/common.d.ts +1 -0
- package/lib/views/slides/index.d.ts +1 -1
- package/lib/views/slides/index.js +2 -5
- package/package.json +3 -3
- package/src/index.tsx +5 -4
- package/src/reducers/data/corrections.ts +2 -2
- package/src/reducers/ui/answers.ts +1 -1
- package/src/test/index.test.tsx +3 -1
- package/src/types/common.ts +1 -0
- package/src/views/slides/index.ts +6 -5
- package/src/views/slides/test/index.test.ts +11 -11
- package/src/views/slides/test/slide.free-text.on-change.test.ts +2 -1
- package/src/views/slides/test/slide.qcm-drag.on-click.test.ts +2 -1
- package/src/views/slides/test/slide.qcm-graphic.on-click.test.ts +2 -1
- package/src/views/slides/test/slide.qcm.on-click.test.ts +2 -1
- package/src/views/slides/test/slide.slider.on-change.test.ts +2 -1
- package/src/views/slides/test/slide.slider.on-slider-change.test.ts +2 -1
- package/src/views/slides/test/slide.template.on-change.test.ts +3 -2
package/es/index.js
CHANGED
|
@@ -11,11 +11,11 @@ import { postProgression } from './actions/api/post-progression';
|
|
|
11
11
|
import { VIEWS } from './common';
|
|
12
12
|
import { mapStateToSlidesProps } from './views/slides';
|
|
13
13
|
import { mapStateToSkillsProps } from './views/skills';
|
|
14
|
-
const ConnectedApp = () => {
|
|
14
|
+
const ConnectedApp = ({ onQuitClick }) => {
|
|
15
15
|
const dispatch = useDispatch();
|
|
16
16
|
const props = {
|
|
17
17
|
viewName: useSelector((state) => state.ui.navigation[state.ui.navigation.length - 1]),
|
|
18
|
-
slides: useSelector((state) => mapStateToSlidesProps(state, dispatch)),
|
|
18
|
+
slides: useSelector((state) => mapStateToSlidesProps(state, dispatch, onQuitClick)),
|
|
19
19
|
skills: useSelector((state) => mapStateToSkillsProps(state))
|
|
20
20
|
};
|
|
21
21
|
return React.createElement(AppReviewTemplate, { ...props });
|
|
@@ -23,6 +23,7 @@ const ConnectedApp = () => {
|
|
|
23
23
|
const AppReview = ({ options }) => {
|
|
24
24
|
const [store, setStore] = useState(null);
|
|
25
25
|
const [isProgressionCreated, setIsProgressionCreated] = useState(false);
|
|
26
|
+
const onQuitClick = options.onQuitClick;
|
|
26
27
|
useEffect(() => {
|
|
27
28
|
if (store)
|
|
28
29
|
return;
|
|
@@ -66,6 +67,6 @@ const AppReview = ({ options }) => {
|
|
|
66
67
|
if (!store)
|
|
67
68
|
return null;
|
|
68
69
|
return (React.createElement(Provider, { store: store },
|
|
69
|
-
React.createElement(ConnectedApp,
|
|
70
|
+
React.createElement(ConnectedApp, { onQuitClick: onQuitClick })));
|
|
70
71
|
};
|
|
71
72
|
export default AppReview;
|
|
@@ -7,12 +7,12 @@ state = initialState, action) => {
|
|
|
7
7
|
switch (action.type) {
|
|
8
8
|
case CORRECTION_FETCH_REQUEST: {
|
|
9
9
|
const { meta } = action;
|
|
10
|
-
return set(meta.slideRef, null, state);
|
|
10
|
+
return set([meta.slideRef], null, state);
|
|
11
11
|
}
|
|
12
12
|
case CORRECTION_FETCH_SUCCESS: {
|
|
13
13
|
const { meta } = action;
|
|
14
14
|
const correction = action.payload;
|
|
15
|
-
return set(meta.slideRef, correction, state);
|
|
15
|
+
return set([meta.slideRef], correction, state);
|
|
16
16
|
}
|
|
17
17
|
default:
|
|
18
18
|
return state;
|
|
@@ -6,7 +6,7 @@ const reducer = (
|
|
|
6
6
|
// eslint-disable-next-line default-param-last
|
|
7
7
|
state = initialState, action) => {
|
|
8
8
|
return includes(action.type, ANSWER_EDIT_ACTIONS)
|
|
9
|
-
? set(action.meta.slideRef, action.payload, initialState)
|
|
9
|
+
? set([action.meta.slideRef], action.payload, initialState)
|
|
10
10
|
: state;
|
|
11
11
|
};
|
|
12
12
|
export default reducer;
|
package/es/test/index.test.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import browserEnv from 'browser-env';
|
|
2
|
+
import identity from 'lodash/fp/identity';
|
|
2
3
|
import test from 'ava';
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import { render, fireEvent, act } from '@testing-library/react';
|
|
@@ -37,7 +38,8 @@ const clickAllSlides = async (t, container, accumulator = 0) => {
|
|
|
37
38
|
const appOptions = {
|
|
38
39
|
token: process.env.API_TEST_TOKEN || '',
|
|
39
40
|
skillRef: 'skill_NJC0jFKoH',
|
|
40
|
-
services
|
|
41
|
+
services,
|
|
42
|
+
onQuitClick: identity
|
|
41
43
|
};
|
|
42
44
|
test('should show the loader while the app is fetching the data', async (t) => {
|
|
43
45
|
t.plan(2);
|
package/es/types/common.d.ts
CHANGED
|
@@ -89,5 +89,5 @@ export declare type SlidesViewProps = {
|
|
|
89
89
|
};
|
|
90
90
|
export declare const initialState: SlidesStack;
|
|
91
91
|
export declare const buildStepItems: (state: StoreState) => StepItem[];
|
|
92
|
-
export declare const mapStateToSlidesProps: (state: StoreState, dispatch: Dispatch) => SlidesViewProps;
|
|
92
|
+
export declare const mapStateToSlidesProps: (state: StoreState, dispatch: Dispatch, onQuitClick: Function) => SlidesViewProps;
|
|
93
93
|
export {};
|
package/es/views/slides/index.js
CHANGED
|
@@ -163,7 +163,7 @@ const getCorrectionPopinProps = (isCorrect, correctAnswer, klf) => ({
|
|
|
163
163
|
},
|
|
164
164
|
type: isCorrect ? 'right' : 'wrong'
|
|
165
165
|
});
|
|
166
|
-
export const mapStateToSlidesProps = (state, dispatch) => {
|
|
166
|
+
export const mapStateToSlidesProps = (state, dispatch, onQuitClick) => {
|
|
167
167
|
const currentSlideRef = get(['ui', 'currentSlideRef'], state);
|
|
168
168
|
const correction = get(['data', 'corrections', currentSlideRef], state);
|
|
169
169
|
const isCorrect = get(['data', 'progression', 'state', 'isCorrect'], state);
|
|
@@ -172,10 +172,7 @@ export const mapStateToSlidesProps = (state, dispatch) => {
|
|
|
172
172
|
header: {
|
|
173
173
|
mode: '__revision_mode',
|
|
174
174
|
skillName: '__agility',
|
|
175
|
-
onQuitClick
|
|
176
|
-
// eslint-disable-next-line no-console
|
|
177
|
-
console.log('onQuitClick');
|
|
178
|
-
},
|
|
175
|
+
onQuitClick,
|
|
179
176
|
'aria-label': 'aria-header-wrapper',
|
|
180
177
|
closeButtonAriaLabel: 'aria-close-button',
|
|
181
178
|
steps: buildStepItems(state)
|
package/lib/index.js
CHANGED
|
@@ -22,11 +22,12 @@ import { postProgression } from './actions/api/post-progression';
|
|
|
22
22
|
import { VIEWS } from './common';
|
|
23
23
|
import { mapStateToSlidesProps } from './views/slides';
|
|
24
24
|
import { mapStateToSkillsProps } from './views/skills';
|
|
25
|
-
var ConnectedApp = function () {
|
|
25
|
+
var ConnectedApp = function (_a) {
|
|
26
|
+
var onQuitClick = _a.onQuitClick;
|
|
26
27
|
var dispatch = useDispatch();
|
|
27
28
|
var props = {
|
|
28
29
|
viewName: useSelector(function (state) { return state.ui.navigation[state.ui.navigation.length - 1]; }),
|
|
29
|
-
slides: useSelector(function (state) { return mapStateToSlidesProps(state, dispatch); }),
|
|
30
|
+
slides: useSelector(function (state) { return mapStateToSlidesProps(state, dispatch, onQuitClick); }),
|
|
30
31
|
skills: useSelector(function (state) { return mapStateToSkillsProps(state); })
|
|
31
32
|
};
|
|
32
33
|
return React.createElement(AppReviewTemplate, __assign({}, props));
|
|
@@ -35,6 +36,7 @@ var AppReview = function (_a) {
|
|
|
35
36
|
var options = _a.options;
|
|
36
37
|
var _b = useState(null), store = _b[0], setStore = _b[1];
|
|
37
38
|
var _c = useState(false), isProgressionCreated = _c[0], setIsProgressionCreated = _c[1];
|
|
39
|
+
var onQuitClick = options.onQuitClick;
|
|
38
40
|
useEffect(function () {
|
|
39
41
|
if (store)
|
|
40
42
|
return;
|
|
@@ -78,6 +80,6 @@ var AppReview = function (_a) {
|
|
|
78
80
|
if (!store)
|
|
79
81
|
return null;
|
|
80
82
|
return (React.createElement(Provider, { store: store },
|
|
81
|
-
React.createElement(ConnectedApp,
|
|
83
|
+
React.createElement(ConnectedApp, { onQuitClick: onQuitClick })));
|
|
82
84
|
};
|
|
83
85
|
export default AppReview;
|
|
@@ -8,12 +8,12 @@ state, action) {
|
|
|
8
8
|
switch (action.type) {
|
|
9
9
|
case CORRECTION_FETCH_REQUEST: {
|
|
10
10
|
var meta = action.meta;
|
|
11
|
-
return set(meta.slideRef, null, state);
|
|
11
|
+
return set([meta.slideRef], null, state);
|
|
12
12
|
}
|
|
13
13
|
case CORRECTION_FETCH_SUCCESS: {
|
|
14
14
|
var meta = action.meta;
|
|
15
15
|
var correction = action.payload;
|
|
16
|
-
return set(meta.slideRef, correction, state);
|
|
16
|
+
return set([meta.slideRef], correction, state);
|
|
17
17
|
}
|
|
18
18
|
default:
|
|
19
19
|
return state;
|
|
@@ -7,7 +7,7 @@ var reducer = function (
|
|
|
7
7
|
state, action) {
|
|
8
8
|
if (state === void 0) { state = initialState; }
|
|
9
9
|
return includes(action.type, ANSWER_EDIT_ACTIONS)
|
|
10
|
-
? set(action.meta.slideRef, action.payload, initialState)
|
|
10
|
+
? set([action.meta.slideRef], action.payload, initialState)
|
|
11
11
|
: state;
|
|
12
12
|
};
|
|
13
13
|
export default reducer;
|
package/lib/test/index.test.js
CHANGED
|
@@ -35,6 +35,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
import browserEnv from 'browser-env';
|
|
38
|
+
import identity from 'lodash/fp/identity';
|
|
38
39
|
import test from 'ava';
|
|
39
40
|
import React from 'react';
|
|
40
41
|
import { render, fireEvent, act } from '@testing-library/react';
|
|
@@ -133,7 +134,8 @@ var clickAllSlides = function (t, container, accumulator) {
|
|
|
133
134
|
var appOptions = {
|
|
134
135
|
token: process.env.API_TEST_TOKEN || '',
|
|
135
136
|
skillRef: 'skill_NJC0jFKoH',
|
|
136
|
-
services: services
|
|
137
|
+
services: services,
|
|
138
|
+
onQuitClick: identity
|
|
137
139
|
};
|
|
138
140
|
test('should show the loader while the app is fetching the data', function (t) { return __awaiter(void 0, void 0, void 0, function () {
|
|
139
141
|
var container, loader;
|
package/lib/types/common.d.ts
CHANGED
|
@@ -89,5 +89,5 @@ export declare type SlidesViewProps = {
|
|
|
89
89
|
};
|
|
90
90
|
export declare const initialState: SlidesStack;
|
|
91
91
|
export declare const buildStepItems: (state: StoreState) => StepItem[];
|
|
92
|
-
export declare const mapStateToSlidesProps: (state: StoreState, dispatch: Dispatch) => SlidesViewProps;
|
|
92
|
+
export declare const mapStateToSlidesProps: (state: StoreState, dispatch: Dispatch, onQuitClick: Function) => SlidesViewProps;
|
|
93
93
|
export {};
|
|
@@ -167,7 +167,7 @@ var getCorrectionPopinProps = function (isCorrect, correctAnswer, klf) { return
|
|
|
167
167
|
},
|
|
168
168
|
type: isCorrect ? 'right' : 'wrong'
|
|
169
169
|
}); };
|
|
170
|
-
export var mapStateToSlidesProps = function (state, dispatch) {
|
|
170
|
+
export var mapStateToSlidesProps = function (state, dispatch, onQuitClick) {
|
|
171
171
|
var currentSlideRef = get(['ui', 'currentSlideRef'], state);
|
|
172
172
|
var correction = get(['data', 'corrections', currentSlideRef], state);
|
|
173
173
|
var isCorrect = get(['data', 'progression', 'state', 'isCorrect'], state);
|
|
@@ -176,10 +176,7 @@ export var mapStateToSlidesProps = function (state, dispatch) {
|
|
|
176
176
|
header: {
|
|
177
177
|
mode: '__revision_mode',
|
|
178
178
|
skillName: '__agility',
|
|
179
|
-
onQuitClick:
|
|
180
|
-
// eslint-disable-next-line no-console
|
|
181
|
-
console.log('onQuitClick');
|
|
182
|
-
},
|
|
179
|
+
onQuitClick: onQuitClick,
|
|
183
180
|
'aria-label': 'aria-header-wrapper',
|
|
184
181
|
closeButtonAriaLabel: 'aria-close-button',
|
|
185
182
|
steps: buildStepItems(state)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coorpacademy/app-review",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16.15.0"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@coorpacademy/redux-task": "^1.1.5",
|
|
46
46
|
"cross-fetch": "^3.1.5",
|
|
47
47
|
"jwt-decode": "^3.1.2",
|
|
48
|
-
"react-redux": "
|
|
48
|
+
"react-redux": "7.2.8",
|
|
49
49
|
"redux": "^4.2.0",
|
|
50
50
|
"redux-thunk": "^2.4.1"
|
|
51
51
|
},
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"ts-node": "^10.9.1",
|
|
79
79
|
"typescript": "^4.7.4"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "0644eb3879ad1e675f9360e0b55d65ba04b83451"
|
|
82
82
|
}
|
package/src/index.tsx
CHANGED
|
@@ -19,17 +19,16 @@ import {VIEWS} from './common';
|
|
|
19
19
|
import {mapStateToSlidesProps} from './views/slides';
|
|
20
20
|
import {mapStateToSkillsProps} from './views/skills';
|
|
21
21
|
|
|
22
|
-
const ConnectedApp = (): JSX.Element => {
|
|
22
|
+
const ConnectedApp = ({onQuitClick}: {onQuitClick: Function}): JSX.Element => {
|
|
23
23
|
const dispatch = useDispatch();
|
|
24
24
|
|
|
25
25
|
const props = {
|
|
26
26
|
viewName: useSelector(
|
|
27
27
|
(state: StoreState) => state.ui.navigation[state.ui.navigation.length - 1]
|
|
28
28
|
),
|
|
29
|
-
slides: useSelector((state: StoreState) => mapStateToSlidesProps(state, dispatch)),
|
|
29
|
+
slides: useSelector((state: StoreState) => mapStateToSlidesProps(state, dispatch, onQuitClick)),
|
|
30
30
|
skills: useSelector((state: StoreState) => mapStateToSkillsProps(state))
|
|
31
31
|
};
|
|
32
|
-
|
|
33
32
|
return <AppReviewTemplate {...props} />;
|
|
34
33
|
};
|
|
35
34
|
|
|
@@ -37,6 +36,8 @@ const AppReview = ({options}: {options: AppOptions}): JSX.Element | null => {
|
|
|
37
36
|
const [store, setStore] = useState<Store<StoreState, AnyAction> | null>(null);
|
|
38
37
|
const [isProgressionCreated, setIsProgressionCreated] = useState(false);
|
|
39
38
|
|
|
39
|
+
const onQuitClick = options.onQuitClick;
|
|
40
|
+
|
|
40
41
|
useEffect(() => {
|
|
41
42
|
if (store) return;
|
|
42
43
|
|
|
@@ -88,7 +89,7 @@ const AppReview = ({options}: {options: AppOptions}): JSX.Element | null => {
|
|
|
88
89
|
|
|
89
90
|
return (
|
|
90
91
|
<Provider store={store}>
|
|
91
|
-
<ConnectedApp />
|
|
92
|
+
<ConnectedApp onQuitClick={onQuitClick} />
|
|
92
93
|
</Provider>
|
|
93
94
|
);
|
|
94
95
|
};
|
|
@@ -21,12 +21,12 @@ const reducer = (
|
|
|
21
21
|
switch (action.type) {
|
|
22
22
|
case CORRECTION_FETCH_REQUEST: {
|
|
23
23
|
const {meta} = action;
|
|
24
|
-
return set(meta.slideRef, null, state);
|
|
24
|
+
return set([meta.slideRef], null, state);
|
|
25
25
|
}
|
|
26
26
|
case CORRECTION_FETCH_SUCCESS: {
|
|
27
27
|
const {meta} = action;
|
|
28
28
|
const correction = action.payload;
|
|
29
|
-
return set(meta.slideRef, correction, state);
|
|
29
|
+
return set([meta.slideRef], correction, state);
|
|
30
30
|
}
|
|
31
31
|
default:
|
|
32
32
|
return state;
|
|
@@ -14,7 +14,7 @@ const reducer = (
|
|
|
14
14
|
action: EditAnswerAction
|
|
15
15
|
): UIAnswerState => {
|
|
16
16
|
return includes(action.type, ANSWER_EDIT_ACTIONS)
|
|
17
|
-
? set(action.meta.slideRef, action.payload, initialState)
|
|
17
|
+
? set([action.meta.slideRef], action.payload, initialState)
|
|
18
18
|
: state;
|
|
19
19
|
};
|
|
20
20
|
|
package/src/test/index.test.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import browserEnv from 'browser-env';
|
|
2
|
+
import identity from 'lodash/fp/identity';
|
|
2
3
|
import test from 'ava';
|
|
3
4
|
import type {ExecutionContext} from 'ava';
|
|
4
5
|
import React from 'react';
|
|
@@ -59,7 +60,8 @@ const clickAllSlides = async (
|
|
|
59
60
|
const appOptions: AppOptions = {
|
|
60
61
|
token: process.env.API_TEST_TOKEN || '',
|
|
61
62
|
skillRef: 'skill_NJC0jFKoH',
|
|
62
|
-
services
|
|
63
|
+
services,
|
|
64
|
+
onQuitClick: identity
|
|
63
65
|
};
|
|
64
66
|
|
|
65
67
|
test('should show the loader while the app is fetching the data', async t => {
|
package/src/types/common.ts
CHANGED
|
@@ -298,7 +298,11 @@ const getCorrectionPopinProps = (
|
|
|
298
298
|
type: isCorrect ? 'right' : 'wrong'
|
|
299
299
|
});
|
|
300
300
|
|
|
301
|
-
export const mapStateToSlidesProps = (
|
|
301
|
+
export const mapStateToSlidesProps = (
|
|
302
|
+
state: StoreState,
|
|
303
|
+
dispatch: Dispatch,
|
|
304
|
+
onQuitClick: Function
|
|
305
|
+
): SlidesViewProps => {
|
|
302
306
|
const currentSlideRef = get(['ui', 'currentSlideRef'], state);
|
|
303
307
|
const correction = get(['data', 'corrections', currentSlideRef], state);
|
|
304
308
|
const isCorrect = get(['data', 'progression', 'state', 'isCorrect'], state);
|
|
@@ -308,10 +312,7 @@ export const mapStateToSlidesProps = (state: StoreState, dispatch: Dispatch): Sl
|
|
|
308
312
|
header: {
|
|
309
313
|
mode: '__revision_mode',
|
|
310
314
|
skillName: '__agility',
|
|
311
|
-
onQuitClick
|
|
312
|
-
// eslint-disable-next-line no-console
|
|
313
|
-
console.log('onQuitClick');
|
|
314
|
-
},
|
|
315
|
+
onQuitClick,
|
|
315
316
|
'aria-label': 'aria-header-wrapper',
|
|
316
317
|
closeButtonAriaLabel: 'aria-close-button',
|
|
317
318
|
steps: buildStepItems(state)
|
|
@@ -74,7 +74,7 @@ test('should create initial props when fetched slide is not still received', t =
|
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
-
const props = mapStateToSlidesProps(state, identity);
|
|
77
|
+
const props = mapStateToSlidesProps(state, identity, identity);
|
|
78
78
|
t.is(props.congratsProps, undefined);
|
|
79
79
|
t.deepEqual(omit(['onQuitClick'], props.header), {
|
|
80
80
|
'aria-label': 'aria-header-wrapper',
|
|
@@ -169,7 +169,7 @@ test('should create props when first slide is on the state', t => {
|
|
|
169
169
|
}
|
|
170
170
|
};
|
|
171
171
|
|
|
172
|
-
const props = mapStateToSlidesProps(state, identity);
|
|
172
|
+
const props = mapStateToSlidesProps(state, identity, identity);
|
|
173
173
|
t.is(props.congratsProps, undefined);
|
|
174
174
|
t.deepEqual(omit(['onQuitClick'], props.header), {
|
|
175
175
|
'aria-label': 'aria-header-wrapper',
|
|
@@ -278,7 +278,7 @@ test('should create props when slide is on the state and user has selected answe
|
|
|
278
278
|
}
|
|
279
279
|
};
|
|
280
280
|
|
|
281
|
-
const props = mapStateToSlidesProps(state, identity);
|
|
281
|
+
const props = mapStateToSlidesProps(state, identity, identity);
|
|
282
282
|
t.is(props.congratsProps, undefined);
|
|
283
283
|
t.deepEqual(omit(['onQuitClick'], props.header), {
|
|
284
284
|
'aria-label': 'aria-header-wrapper',
|
|
@@ -393,7 +393,7 @@ test('should verify props when first slide was answered correctly and next slide
|
|
|
393
393
|
}
|
|
394
394
|
};
|
|
395
395
|
|
|
396
|
-
const props = mapStateToSlidesProps(state, identity);
|
|
396
|
+
const props = mapStateToSlidesProps(state, identity, identity);
|
|
397
397
|
t.is(props.congratsProps, undefined);
|
|
398
398
|
t.deepEqual(omit(['onQuitClick'], props.header), {
|
|
399
399
|
'aria-label': 'aria-header-wrapper',
|
|
@@ -512,7 +512,7 @@ test('should verify props when first slide was answered with error and next slid
|
|
|
512
512
|
}
|
|
513
513
|
};
|
|
514
514
|
|
|
515
|
-
const props = mapStateToSlidesProps(state, identity);
|
|
515
|
+
const props = mapStateToSlidesProps(state, identity, identity);
|
|
516
516
|
t.is(props.congratsProps, undefined);
|
|
517
517
|
t.deepEqual(omit(['onQuitClick'], props.header), {
|
|
518
518
|
'aria-label': 'aria-header-wrapper',
|
|
@@ -584,7 +584,7 @@ test('should verify props when first slide was answered, next slide is fetched &
|
|
|
584
584
|
}
|
|
585
585
|
};
|
|
586
586
|
|
|
587
|
-
const props = mapStateToSlidesProps(state, identity);
|
|
587
|
+
const props = mapStateToSlidesProps(state, identity, identity);
|
|
588
588
|
t.is(props.congratsProps, undefined);
|
|
589
589
|
t.deepEqual(omit(['onQuitClick'], props.header), {
|
|
590
590
|
'aria-label': 'aria-header-wrapper',
|
|
@@ -705,7 +705,7 @@ test('should verify props when first slide was answered incorrectly, next slide
|
|
|
705
705
|
}
|
|
706
706
|
};
|
|
707
707
|
|
|
708
|
-
const props = mapStateToSlidesProps(state, identity);
|
|
708
|
+
const props = mapStateToSlidesProps(state, identity, identity);
|
|
709
709
|
t.is(props.congratsProps, undefined);
|
|
710
710
|
t.deepEqual(omit(['onQuitClick'], props.header), {
|
|
711
711
|
'aria-label': 'aria-header-wrapper',
|
|
@@ -828,7 +828,7 @@ test('should verify props when currentSlideRef has changed to nextContent of pro
|
|
|
828
828
|
}
|
|
829
829
|
};
|
|
830
830
|
|
|
831
|
-
const props = mapStateToSlidesProps(state, identity);
|
|
831
|
+
const props = mapStateToSlidesProps(state, identity, identity);
|
|
832
832
|
t.is(props.congratsProps, undefined);
|
|
833
833
|
t.deepEqual(omit(['onQuitClick'], props.header), {
|
|
834
834
|
'aria-label': 'aria-header-wrapper',
|
|
@@ -930,7 +930,7 @@ test('should verify props when progression is in success', t => {
|
|
|
930
930
|
}
|
|
931
931
|
};
|
|
932
932
|
|
|
933
|
-
const props = mapStateToSlidesProps(state, identity);
|
|
933
|
+
const props = mapStateToSlidesProps(state, identity, identity);
|
|
934
934
|
t.is(props.congratsProps, undefined);
|
|
935
935
|
t.deepEqual(omit(['onQuitClick'], props.header), {
|
|
936
936
|
'aria-label': 'aria-header-wrapper',
|
|
@@ -1032,7 +1032,7 @@ test('should verify props when progression has answered a current pendingSlide',
|
|
|
1032
1032
|
}
|
|
1033
1033
|
};
|
|
1034
1034
|
|
|
1035
|
-
const props = mapStateToSlidesProps(state, identity);
|
|
1035
|
+
const props = mapStateToSlidesProps(state, identity, identity);
|
|
1036
1036
|
t.deepEqual(omit(['onQuitClick'], props.header), {
|
|
1037
1037
|
'aria-label': 'aria-header-wrapper',
|
|
1038
1038
|
closeButtonAriaLabel: 'aria-close-button',
|
|
@@ -1131,7 +1131,7 @@ test('should verify props when progression still has a pendingSlide', t => {
|
|
|
1131
1131
|
}
|
|
1132
1132
|
};
|
|
1133
1133
|
|
|
1134
|
-
const props = mapStateToSlidesProps(state, identity);
|
|
1134
|
+
const props = mapStateToSlidesProps(state, identity, identity);
|
|
1135
1135
|
t.deepEqual(omit(['onQuitClick'], props.header), {
|
|
1136
1136
|
'aria-label': 'aria-header-wrapper',
|
|
1137
1137
|
closeButtonAriaLabel: 'aria-close-button',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import test from 'ava';
|
|
2
2
|
import omit from 'lodash/fp/omit';
|
|
3
3
|
import get from 'lodash/fp/get';
|
|
4
|
+
import identity from 'lodash/fp/identity';
|
|
4
5
|
import {mapStateToSlidesProps} from '..';
|
|
5
6
|
import {ProgressionFromAPI} from '../../../types/common';
|
|
6
7
|
import {services} from '../../../test/util/services.mock';
|
|
@@ -69,7 +70,7 @@ test('should dispatch EDIT_BASIC action via the property onChange of a Free Text
|
|
|
69
70
|
];
|
|
70
71
|
const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
|
|
71
72
|
|
|
72
|
-
const props = mapStateToSlidesProps(getState(), dispatch);
|
|
73
|
+
const props = mapStateToSlidesProps(getState(), dispatch, identity);
|
|
73
74
|
t.deepEqual(omit('answerUI', props.stack.slides['0']), {
|
|
74
75
|
animateCorrectionPopin: false,
|
|
75
76
|
showCorrectionPopin: false,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import test from 'ava';
|
|
2
2
|
import omit from 'lodash/fp/omit';
|
|
3
3
|
import get from 'lodash/fp/get';
|
|
4
|
+
import identity from 'lodash/fp/identity';
|
|
4
5
|
import {mapStateToSlidesProps} from '..';
|
|
5
6
|
import {ProgressionFromAPI} from '../../../types/common';
|
|
6
7
|
import {services} from '../../../test/util/services.mock';
|
|
@@ -69,7 +70,7 @@ test('should dispatch EDIT_QCM_DRAG action via the property onClick of a QCM Dra
|
|
|
69
70
|
];
|
|
70
71
|
const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
|
|
71
72
|
|
|
72
|
-
const props = mapStateToSlidesProps(getState(), dispatch);
|
|
73
|
+
const props = mapStateToSlidesProps(getState(), dispatch, identity);
|
|
73
74
|
t.deepEqual(omit('answerUI', props.stack.slides['0']), {
|
|
74
75
|
animateCorrectionPopin: false,
|
|
75
76
|
showCorrectionPopin: false,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import test from 'ava';
|
|
2
2
|
import omit from 'lodash/fp/omit';
|
|
3
3
|
import get from 'lodash/fp/get';
|
|
4
|
+
import identity from 'lodash/fp/identity';
|
|
4
5
|
import {mapStateToSlidesProps} from '..';
|
|
5
6
|
import {ProgressionFromAPI} from '../../../types/common';
|
|
6
7
|
import {services} from '../../../test/util/services.mock';
|
|
@@ -69,7 +70,7 @@ test('should dispatch EDIT_QCM_GRAPHIC action via the property onClick of a QCM
|
|
|
69
70
|
];
|
|
70
71
|
const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
|
|
71
72
|
|
|
72
|
-
const props = mapStateToSlidesProps(getState(), dispatch);
|
|
73
|
+
const props = mapStateToSlidesProps(getState(), dispatch, identity);
|
|
73
74
|
t.deepEqual(omit('answerUI', props.stack.slides['0']), {
|
|
74
75
|
animateCorrectionPopin: false,
|
|
75
76
|
showCorrectionPopin: false,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import test from 'ava';
|
|
2
2
|
import omit from 'lodash/fp/omit';
|
|
3
3
|
import get from 'lodash/fp/get';
|
|
4
|
+
import identity from 'lodash/fp/identity';
|
|
4
5
|
import {mapStateToSlidesProps} from '..';
|
|
5
6
|
import {ProgressionFromAPI} from '../../../types/common';
|
|
6
7
|
import {services} from '../../../test/util/services.mock';
|
|
@@ -71,7 +72,7 @@ test('should dispatch EDIT_QCM action via the property onClick of a QCM slide',
|
|
|
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, identity);
|
|
75
76
|
t.deepEqual(omit('answerUI', props.stack.slides['0']), {
|
|
76
77
|
animateCorrectionPopin: false,
|
|
77
78
|
showCorrectionPopin: false,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import test from 'ava';
|
|
2
2
|
import omit from 'lodash/fp/omit';
|
|
3
3
|
import get from 'lodash/fp/get';
|
|
4
|
+
import identity from 'lodash/fp/identity';
|
|
4
5
|
import {mapStateToSlidesProps} from '..';
|
|
5
6
|
import {ProgressionFromAPI} from '../../../types/common';
|
|
6
7
|
import {services} from '../../../test/util/services.mock';
|
|
@@ -69,7 +70,7 @@ test('should dispatch EDIT_SLIDER action via the property onChange of a Slider s
|
|
|
69
70
|
];
|
|
70
71
|
const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
|
|
71
72
|
|
|
72
|
-
const props = mapStateToSlidesProps(getState(), dispatch);
|
|
73
|
+
const props = mapStateToSlidesProps(getState(), dispatch, identity);
|
|
73
74
|
t.deepEqual(omit('answerUI', props.stack.slides['0']), {
|
|
74
75
|
animateCorrectionPopin: false,
|
|
75
76
|
showCorrectionPopin: false,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import test from 'ava';
|
|
2
2
|
import get from 'lodash/fp/get';
|
|
3
|
+
import identity from 'lodash/fp/identity';
|
|
3
4
|
import {ProgressionFromAPI} from '../../../types/common';
|
|
4
5
|
import {StoreState} from '../../../reducers';
|
|
5
6
|
import {mapStateToSlidesProps} from '..';
|
|
@@ -67,7 +68,7 @@ test('should dispatch EDIT_SLIDER action via the property onSliderChange of a Sl
|
|
|
67
68
|
}
|
|
68
69
|
];
|
|
69
70
|
const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
|
|
70
|
-
const props = mapStateToSlidesProps(getState(), dispatch);
|
|
71
|
+
const props = mapStateToSlidesProps(getState(), dispatch, identity);
|
|
71
72
|
|
|
72
73
|
const SlideProps = props.stack.slides['0'].answerUI?.model as QuestionRange;
|
|
73
74
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import test from 'ava';
|
|
2
2
|
import omit from 'lodash/fp/omit';
|
|
3
3
|
import get from 'lodash/fp/get';
|
|
4
|
+
import identity from 'lodash/fp/identity';
|
|
4
5
|
import {mapStateToSlidesProps} from '..';
|
|
5
6
|
import {ProgressionFromAPI} from '../../../types/common';
|
|
6
7
|
import {services} from '../../../test/util/services.mock';
|
|
@@ -65,7 +66,7 @@ test('should dispatch EDIT_TEMPLATE action via the property onChange of a Templa
|
|
|
65
66
|
];
|
|
66
67
|
const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
|
|
67
68
|
|
|
68
|
-
const props = mapStateToSlidesProps(getState(), dispatch);
|
|
69
|
+
const props = mapStateToSlidesProps(getState(), dispatch, identity);
|
|
69
70
|
t.deepEqual(omit('answerUI', props.stack.slides['0']), {
|
|
70
71
|
animateCorrectionPopin: false,
|
|
71
72
|
showCorrectionPopin: false,
|
|
@@ -89,7 +90,7 @@ test('should dispatch EDIT_TEMPLATE action via the property onChange of a Templa
|
|
|
89
90
|
];
|
|
90
91
|
const {dispatch, getState} = createTestStore(t, initialState, services, expectedActions);
|
|
91
92
|
|
|
92
|
-
const props = mapStateToSlidesProps(getState(), dispatch);
|
|
93
|
+
const props = mapStateToSlidesProps(getState(), dispatch, identity);
|
|
93
94
|
t.deepEqual(omit('answerUI', props.stack.slides['0']), {
|
|
94
95
|
animateCorrectionPopin: false,
|
|
95
96
|
showCorrectionPopin: false,
|