@coorpacademy/player-web 4.2.11 → 4.2.12
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/map-state-to-props/test/answer.js +390 -0
- package/es/map-state-to-props/test/answer.js.map +1 -0
- package/es/map-state-to-props/test/fixtures/player/clue.json +131 -0
- package/es/map-state-to-props/test/fixtures/player/loading-clue.json +131 -0
- package/es/map-state-to-props/test/fixtures/player/no-clue.json +118 -0
- package/es/map-state-to-props/test/fixtures/player/slide-no-lessons.json +115 -0
- package/es/map-state-to-props/test/fixtures/player/slide.json +127 -0
- package/es/map-state-to-props/test/fixtures/popin-correction/popin-extra-life.json +139 -0
- package/es/map-state-to-props/test/fixtures/popin-correction/popin-failure.json +145 -0
- package/es/map-state-to-props/test/fixtures/popin-correction/popin-next-level.json +282 -0
- package/es/map-state-to-props/test/fixtures/popin-correction/popin-revival.json +140 -0
- package/es/map-state-to-props/test/fixtures/popin-correction/popin-success-node.json +154 -0
- package/es/map-state-to-props/test/fixtures/popin-correction/popin-success.json +268 -0
- package/es/map-state-to-props/test/fixtures/popin-correction/state-fail-multiple-answers.json +473 -0
- package/es/map-state-to-props/test/fixtures/popin-end/fail.json +205 -0
- package/es/map-state-to-props/test/fixtures/popin-end/learner-adaptive-failure.json +209 -0
- package/es/map-state-to-props/test/fixtures/popin-end/learner-failure-with-redirection.json +211 -0
- package/es/map-state-to-props/test/fixtures/popin-end/learner-failure.json +211 -0
- package/es/map-state-to-props/test/fixtures/popin-end/learner-success-with-redirection.json +278 -0
- package/es/map-state-to-props/test/fixtures/popin-end/learner-success.json +275 -0
- package/es/map-state-to-props/test/fixtures/popin-end/success.json +223 -0
- package/es/map-state-to-props/test/fixtures/progression-learner.json +102 -0
- package/es/map-state-to-props/test/fixtures/progression-state.json +45 -0
- package/es/map-state-to-props/test/fixtures/slides/basic.json +60 -0
- package/es/map-state-to-props/test/fixtures/slides/plop.json +56 -0
- package/es/map-state-to-props/test/fixtures/slides/qcm-drag.json +56 -0
- package/es/map-state-to-props/test/fixtures/slides/qcm-graphic.json +49 -0
- package/es/map-state-to-props/test/fixtures/slides/qcm.json +43 -0
- package/es/map-state-to-props/test/fixtures/slides/slider.json +57 -0
- package/es/map-state-to-props/test/fixtures/slides/template.json +49 -0
- package/es/map-state-to-props/test/fixtures/slides/videos.json +163 -0
- package/es/map-state-to-props/test/fixtures/slides/with-context.json +69 -0
- package/es/map-state-to-props/test/header.js +131 -0
- package/es/map-state-to-props/test/header.js.map +1 -0
- package/es/map-state-to-props/test/index.js +107 -0
- package/es/map-state-to-props/test/index.js.map +1 -0
- package/es/map-state-to-props/test/player.js +680 -0
- package/es/map-state-to-props/test/player.js.map +1 -0
- package/es/map-state-to-props/test/popin-correction.create-header-cta.js +301 -0
- package/es/map-state-to-props/test/popin-correction.create-header-cta.js.map +1 -0
- package/es/map-state-to-props/test/popin-correction.js +80 -0
- package/es/map-state-to-props/test/popin-correction.js.map +1 -0
- package/es/map-state-to-props/test/popin-end.js +313 -0
- package/es/map-state-to-props/test/popin-end.js.map +1 -0
- package/es/map-state-to-props/test/popin-error.js +77 -0
- package/es/map-state-to-props/test/popin-error.js.map +1 -0
- package/es/map-state-to-props/test/resources.js +31 -0
- package/es/map-state-to-props/test/resources.js.map +1 -0
- package/es/test/add-timeout.js +8 -0
- package/es/test/add-timeout.js.map +1 -0
- package/es/test/helpers/css-register.js +3 -0
- package/es/test/helpers/css-register.js.map +1 -0
- package/es/test/helpers/macro.js +6 -0
- package/es/test/helpers/macro.js.map +1 -0
- package/es/test/index.js +39 -0
- package/es/test/index.js.map +1 -0
- package/es/test/init-reducers.js +50 -0
- package/es/test/init-reducers.js.map +1 -0
- package/es/test/locales.js +8 -0
- package/es/test/locales.js.map +1 -0
- package/es/test/run-app.js +20 -0
- package/es/test/run-app.js.map +1 -0
- package/es/test/store.js +38 -0
- package/es/test/store.js.map +1 -0
- package/es/views/test/helpers/render.js +13 -0
- package/es/views/test/helpers/render.js.map +1 -0
- package/es/views/test/helpers/state-to-vnode.js +7 -0
- package/es/views/test/helpers/state-to-vnode.js.map +1 -0
- package/es/views/test/loading.js +15 -0
- package/es/views/test/loading.js.map +1 -0
- package/es/views/test/popin-correction.js +223 -0
- package/es/views/test/popin-correction.js.map +1 -0
- package/es/views/test/popin-end.js +93 -0
- package/es/views/test/popin-end.js.map +1 -0
- package/es/views/test/router.js +22 -0
- package/es/views/test/router.js.map +1 -0
- package/es/views/test/slide.js +335 -0
- package/es/views/test/slide.js.map +1 -0
- package/lib/map-state-to-props/test/answer.js +408 -0
- package/lib/map-state-to-props/test/answer.js.map +1 -0
- package/lib/map-state-to-props/test/fixtures/player/clue.json +131 -0
- package/lib/map-state-to-props/test/fixtures/player/loading-clue.json +131 -0
- package/lib/map-state-to-props/test/fixtures/player/no-clue.json +118 -0
- package/lib/map-state-to-props/test/fixtures/player/slide-no-lessons.json +115 -0
- package/lib/map-state-to-props/test/fixtures/player/slide.json +127 -0
- package/lib/map-state-to-props/test/fixtures/popin-correction/popin-extra-life.json +139 -0
- package/lib/map-state-to-props/test/fixtures/popin-correction/popin-failure.json +145 -0
- package/lib/map-state-to-props/test/fixtures/popin-correction/popin-next-level.json +282 -0
- package/lib/map-state-to-props/test/fixtures/popin-correction/popin-revival.json +140 -0
- package/lib/map-state-to-props/test/fixtures/popin-correction/popin-success-node.json +154 -0
- package/lib/map-state-to-props/test/fixtures/popin-correction/popin-success.json +268 -0
- package/lib/map-state-to-props/test/fixtures/popin-correction/state-fail-multiple-answers.json +473 -0
- package/lib/map-state-to-props/test/fixtures/popin-end/fail.json +205 -0
- package/lib/map-state-to-props/test/fixtures/popin-end/learner-adaptive-failure.json +209 -0
- package/lib/map-state-to-props/test/fixtures/popin-end/learner-failure-with-redirection.json +211 -0
- package/lib/map-state-to-props/test/fixtures/popin-end/learner-failure.json +211 -0
- package/lib/map-state-to-props/test/fixtures/popin-end/learner-success-with-redirection.json +278 -0
- package/lib/map-state-to-props/test/fixtures/popin-end/learner-success.json +275 -0
- package/lib/map-state-to-props/test/fixtures/popin-end/success.json +223 -0
- package/lib/map-state-to-props/test/fixtures/progression-learner.json +102 -0
- package/lib/map-state-to-props/test/fixtures/progression-state.json +45 -0
- package/lib/map-state-to-props/test/fixtures/slides/basic.json +60 -0
- package/lib/map-state-to-props/test/fixtures/slides/plop.json +56 -0
- package/lib/map-state-to-props/test/fixtures/slides/qcm-drag.json +56 -0
- package/lib/map-state-to-props/test/fixtures/slides/qcm-graphic.json +49 -0
- package/lib/map-state-to-props/test/fixtures/slides/qcm.json +43 -0
- package/lib/map-state-to-props/test/fixtures/slides/slider.json +57 -0
- package/lib/map-state-to-props/test/fixtures/slides/template.json +49 -0
- package/lib/map-state-to-props/test/fixtures/slides/videos.json +163 -0
- package/lib/map-state-to-props/test/fixtures/slides/with-context.json +69 -0
- package/lib/map-state-to-props/test/header.js +143 -0
- package/lib/map-state-to-props/test/header.js.map +1 -0
- package/lib/map-state-to-props/test/index.js +100 -0
- package/lib/map-state-to-props/test/index.js.map +1 -0
- package/lib/map-state-to-props/test/player.js +714 -0
- package/lib/map-state-to-props/test/player.js.map +1 -0
- package/lib/map-state-to-props/test/popin-correction.create-header-cta.js +315 -0
- package/lib/map-state-to-props/test/popin-correction.create-header-cta.js.map +1 -0
- package/lib/map-state-to-props/test/popin-correction.js +85 -0
- package/lib/map-state-to-props/test/popin-correction.js.map +1 -0
- package/lib/map-state-to-props/test/popin-end.js +328 -0
- package/lib/map-state-to-props/test/popin-end.js.map +1 -0
- package/lib/map-state-to-props/test/popin-error.js +85 -0
- package/lib/map-state-to-props/test/popin-error.js.map +1 -0
- package/lib/map-state-to-props/test/resources.js +42 -0
- package/lib/map-state-to-props/test/resources.js.map +1 -0
- package/lib/test/add-timeout.js +14 -0
- package/lib/test/add-timeout.js.map +1 -0
- package/lib/test/helpers/css-register.js +8 -0
- package/lib/test/helpers/css-register.js.map +1 -0
- package/lib/test/helpers/macro.js +12 -0
- package/lib/test/helpers/macro.js.map +1 -0
- package/lib/test/index.js +53 -0
- package/lib/test/index.js.map +1 -0
- package/lib/test/init-reducers.js +57 -0
- package/lib/test/init-reducers.js.map +1 -0
- package/lib/test/locales.js +18 -0
- package/lib/test/locales.js.map +1 -0
- package/lib/test/run-app.js +27 -0
- package/lib/test/run-app.js.map +1 -0
- package/lib/test/store.js +45 -0
- package/lib/test/store.js.map +1 -0
- package/lib/views/test/helpers/render.js +24 -0
- package/lib/views/test/helpers/render.js.map +1 -0
- package/lib/views/test/helpers/state-to-vnode.js +14 -0
- package/lib/views/test/helpers/state-to-vnode.js.map +1 -0
- package/lib/views/test/loading.js +22 -0
- package/lib/views/test/loading.js.map +1 -0
- package/lib/views/test/popin-correction.js +237 -0
- package/lib/views/test/popin-correction.js.map +1 -0
- package/lib/views/test/popin-end.js +105 -0
- package/lib/views/test/popin-end.js.map +1 -0
- package/lib/views/test/router.js +32 -0
- package/lib/views/test/router.js.map +1 -0
- package/lib/views/test/slide.js +359 -0
- package/lib/views/test/slide.js.map +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import _isUndefined from "lodash/fp/isUndefined";
|
|
2
|
+
import _isFunction from "lodash/fp/isFunction";
|
|
3
|
+
import _identity from "lodash/fp/identity";
|
|
4
|
+
import _pipe from "lodash/fp/pipe";
|
|
5
|
+
import _set from "lodash/fp/set";
|
|
6
|
+
import _map from "lodash/fp/map";
|
|
7
|
+
import _get from "lodash/fp/get";
|
|
8
|
+
import test from 'ava';
|
|
9
|
+
import { mockTranslate } from '@coorpacademy/translate';
|
|
10
|
+
import { getCurrentProgressionId, LOCATION_NEXT_CONTENT_REQUEST, LOCATION_NEXT_CONTENT_SUCCESS, LOCATION_OPEN_RECOMMENDATION_REQUEST, LOCATION_OPEN_RECOMMENDATION_SUCCESS, LOCATION_SEE_COMMENT_REQUEST, LOCATION_SEE_COMMENT_SUCCESS, SEND_POST_COMMENT_REQUEST, SEND_POST_COMMENT_SUCCESS, UI_EDIT_COMMENT } from '@coorpacademy/player-store';
|
|
11
|
+
import popinEnd from '../popin-end';
|
|
12
|
+
import popinLearnerSuccess from './fixtures/popin-end/learner-success';
|
|
13
|
+
import popinLearnerSuccessWithRedirection from './fixtures/popin-end/learner-success-with-redirection';
|
|
14
|
+
import popinLearnerFailure from './fixtures/popin-end/learner-failure';
|
|
15
|
+
import popinLearnerFailureWithRedirection from './fixtures/popin-end/learner-failure-with-redirection';
|
|
16
|
+
import popinLearnerAdaptiveFailure from './fixtures/popin-end/learner-adaptive-failure';
|
|
17
|
+
import popinMicrolearningFailure from './fixtures/popin-end/fail';
|
|
18
|
+
import popinMicrolearningSuccess from './fixtures/popin-end/success';
|
|
19
|
+
const services = {
|
|
20
|
+
Comments: {
|
|
21
|
+
post: _identity
|
|
22
|
+
},
|
|
23
|
+
Location: {
|
|
24
|
+
openRecommendation: _identity,
|
|
25
|
+
nextLevel: _identity,
|
|
26
|
+
seeComment: _identity
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const createDispatch = state => {
|
|
31
|
+
const getState = () => state;
|
|
32
|
+
|
|
33
|
+
return async action => {
|
|
34
|
+
const dispatched = [];
|
|
35
|
+
|
|
36
|
+
const dispatch = maybeAction => _isFunction(maybeAction) ? maybeAction(dispatch, getState, {
|
|
37
|
+
services
|
|
38
|
+
}) : dispatched.push(maybeAction);
|
|
39
|
+
|
|
40
|
+
await dispatch(action);
|
|
41
|
+
return dispatched;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const actionTypes = actions => _map(({
|
|
46
|
+
type
|
|
47
|
+
}) => type, actions);
|
|
48
|
+
|
|
49
|
+
const options = {
|
|
50
|
+
translate: mockTranslate
|
|
51
|
+
};
|
|
52
|
+
test('should create a "Next Level" CTA after success on learner progression', async t => {
|
|
53
|
+
const dispatch = createDispatch(popinLearnerSuccess);
|
|
54
|
+
const props = popinEnd(options, {
|
|
55
|
+
dispatch
|
|
56
|
+
})(popinLearnerSuccess);
|
|
57
|
+
const header = props.summary.header;
|
|
58
|
+
t.is(header.rank, '+1');
|
|
59
|
+
t.is(header.stars, '+2');
|
|
60
|
+
t.is(header.type, 'popinEnd');
|
|
61
|
+
const cta = header.cta;
|
|
62
|
+
t.is(cta.title, '__Next level');
|
|
63
|
+
t.true(_isFunction(cta.onClick));
|
|
64
|
+
t.falsy(cta.href);
|
|
65
|
+
const dispatchedHeaderCta = await cta.onClick();
|
|
66
|
+
t.deepEqual(actionTypes(dispatchedHeaderCta), [LOCATION_NEXT_CONTENT_REQUEST, LOCATION_NEXT_CONTENT_SUCCESS]);
|
|
67
|
+
const action = props.summary.action;
|
|
68
|
+
t.is(action.prefix, '__Next level_');
|
|
69
|
+
t.is(action.title, 'La recherche en ligne - Avancé');
|
|
70
|
+
const buttonCta = action.button;
|
|
71
|
+
t.is(buttonCta.title, '__Next level');
|
|
72
|
+
const dispatchedActionCta = await buttonCta.onClick();
|
|
73
|
+
t.deepEqual(actionTypes(dispatchedActionCta), [LOCATION_NEXT_CONTENT_REQUEST, LOCATION_NEXT_CONTENT_SUCCESS]);
|
|
74
|
+
const comment = props.summary.comment;
|
|
75
|
+
t.is(comment.edition.postDisabled, true);
|
|
76
|
+
});
|
|
77
|
+
test('should write, send, and go see a comment after success on learner progression', async t => {
|
|
78
|
+
const state = _pipe(_set('data.comments.entities.idProgression1234.isSent', true), _set('ui.comments.text', 'textToSend'))(popinLearnerSuccess);
|
|
79
|
+
|
|
80
|
+
const dispatch = createDispatch(state);
|
|
81
|
+
const props = popinEnd(options, {
|
|
82
|
+
dispatch
|
|
83
|
+
})(state);
|
|
84
|
+
const comment = props.summary.comment;
|
|
85
|
+
t.is(comment.isSent, true);
|
|
86
|
+
t.is(comment.edition.value, 'textToSend');
|
|
87
|
+
t.is(comment.edition.postDisabled, false);
|
|
88
|
+
const onChange = comment.edition.onChange;
|
|
89
|
+
t.true(_isFunction(onChange));
|
|
90
|
+
const dispatchedOnChange = await onChange({
|
|
91
|
+
target: {
|
|
92
|
+
value: 'foo'
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
t.deepEqual(actionTypes(dispatchedOnChange), [UI_EDIT_COMMENT]);
|
|
96
|
+
const onPost = comment.edition.onPost;
|
|
97
|
+
t.true(_isFunction(onPost));
|
|
98
|
+
const dispatchedOnPost = await onPost();
|
|
99
|
+
t.deepEqual(actionTypes(dispatchedOnPost), [SEND_POST_COMMENT_REQUEST, SEND_POST_COMMENT_SUCCESS]);
|
|
100
|
+
const onClick = comment.confirmation.onClick;
|
|
101
|
+
t.true(_isFunction(onClick));
|
|
102
|
+
const dispatchedOnClick = await onClick();
|
|
103
|
+
t.deepEqual(actionTypes(dispatchedOnClick), [LOCATION_SEE_COMMENT_REQUEST, LOCATION_SEE_COMMENT_SUCCESS]);
|
|
104
|
+
});
|
|
105
|
+
test('should not see comment section after failure on learner progression', t => {
|
|
106
|
+
const dispatch = createDispatch(popinLearnerFailure);
|
|
107
|
+
const props = popinEnd(options, {
|
|
108
|
+
dispatch
|
|
109
|
+
})(popinLearnerFailure);
|
|
110
|
+
t.is(props.summary.comment, null);
|
|
111
|
+
t.is(props.summary.header.subtitle, '__You are out of lives!');
|
|
112
|
+
t.is(props.summary.header.lives, 0);
|
|
113
|
+
});
|
|
114
|
+
test('should verify that cta should redirect if redirectURLAfterEnd is set on state for failure popin', t => {
|
|
115
|
+
const dispatch = createDispatch(popinLearnerFailureWithRedirection);
|
|
116
|
+
const props = popinEnd(options, {
|
|
117
|
+
dispatch
|
|
118
|
+
})(popinLearnerFailureWithRedirection);
|
|
119
|
+
const header = props.summary.header;
|
|
120
|
+
const cta = header.cta;
|
|
121
|
+
t.is(cta.title, '__Click to continue');
|
|
122
|
+
t.true(_isUndefined(cta.onClick));
|
|
123
|
+
t.is(cta.href, 'http://www.google.com');
|
|
124
|
+
});
|
|
125
|
+
test('should verify that cta should redirect if redirectURLAfterEnd is set on state for success popin', t => {
|
|
126
|
+
const dispatch = createDispatch(popinLearnerSuccessWithRedirection);
|
|
127
|
+
const props = popinEnd(options, {
|
|
128
|
+
dispatch
|
|
129
|
+
})(popinLearnerSuccessWithRedirection);
|
|
130
|
+
const header = props.summary.header;
|
|
131
|
+
const cta = header.cta;
|
|
132
|
+
t.is(cta.title, '__Click to continue');
|
|
133
|
+
t.true(_isUndefined(cta.onClick));
|
|
134
|
+
t.is(cta.href, 'http://www.google.com');
|
|
135
|
+
});
|
|
136
|
+
test('should not see comment section after failure on microlearning progression', t => {
|
|
137
|
+
const dispatch = createDispatch(popinMicrolearningFailure);
|
|
138
|
+
const props = popinEnd(options, {
|
|
139
|
+
dispatch
|
|
140
|
+
})(popinMicrolearningFailure);
|
|
141
|
+
t.is(props.summary.comment, null);
|
|
142
|
+
});
|
|
143
|
+
test('should not see comment section after success on microlearning progression', t => {
|
|
144
|
+
const dispatch = createDispatch(popinMicrolearningSuccess);
|
|
145
|
+
const props = popinEnd(options, {
|
|
146
|
+
dispatch
|
|
147
|
+
})(popinMicrolearningSuccess);
|
|
148
|
+
t.is(props.summary.comment, null);
|
|
149
|
+
});
|
|
150
|
+
test("livesDisabled == true ---> should not see lives and 'You are out of lives!' message", t => {
|
|
151
|
+
const dispatch = createDispatch(popinLearnerAdaptiveFailure);
|
|
152
|
+
const props = popinEnd(options, {
|
|
153
|
+
dispatch
|
|
154
|
+
})(popinLearnerAdaptiveFailure);
|
|
155
|
+
t.is(props.summary.header.subtitle, '__Nice try!');
|
|
156
|
+
t.is(props.summary.header.lives, null);
|
|
157
|
+
});
|
|
158
|
+
test('should create a "Back to Home" CTA after success on learner progression with coach content', async t => {
|
|
159
|
+
const state = _pipe(_set(['data', 'contents', 'level', 'entities', '1.B', 'level'], 'coach'), _set('data.nextContent.entities.idProgression1234', null))(popinLearnerSuccess);
|
|
160
|
+
|
|
161
|
+
const dispatch = createDispatch(state);
|
|
162
|
+
const props = popinEnd(options, {
|
|
163
|
+
dispatch
|
|
164
|
+
})(state);
|
|
165
|
+
const header = props.summary.header;
|
|
166
|
+
t.is(header.rank, '+1');
|
|
167
|
+
t.is(header.stars, '+2');
|
|
168
|
+
t.is(header.type, 'popinEnd');
|
|
169
|
+
const cta = header.cta;
|
|
170
|
+
t.is(cta.title, '__Back to home');
|
|
171
|
+
t.deepEqual(_map('type')(await cta.onClick()), ['@@location/EXIT_REQUEST', '@@location/EXIT_FAILURE']);
|
|
172
|
+
t.falsy(cta.href);
|
|
173
|
+
t.falsy(props.summary.action);
|
|
174
|
+
});
|
|
175
|
+
test('should create a "Back to Home" CTA after success on learner progression with content with only base level', async t => {
|
|
176
|
+
const state = _set(['data', 'nextContent', 'entities', 'idProgression1234'], null, popinLearnerSuccess);
|
|
177
|
+
|
|
178
|
+
const dispatch = createDispatch(state);
|
|
179
|
+
const props = popinEnd(options, {
|
|
180
|
+
dispatch
|
|
181
|
+
})(state);
|
|
182
|
+
const header = props.summary.header;
|
|
183
|
+
t.is(header.rank, '+1');
|
|
184
|
+
t.is(header.stars, '+2');
|
|
185
|
+
t.is(header.type, 'popinEnd');
|
|
186
|
+
const cta = header.cta;
|
|
187
|
+
t.is(cta.title, '__Back to home');
|
|
188
|
+
t.deepEqual(_map('type')(await cta.onClick()), ['@@location/EXIT_REQUEST', '@@location/EXIT_FAILURE']);
|
|
189
|
+
t.falsy(cta.href);
|
|
190
|
+
});
|
|
191
|
+
test('should create a "Retry Level" CTA after failure on learner progression', t => {
|
|
192
|
+
const dispatch = createDispatch(popinLearnerFailure);
|
|
193
|
+
const props = popinEnd(options, {
|
|
194
|
+
dispatch
|
|
195
|
+
})(popinLearnerFailure);
|
|
196
|
+
const header = props.summary.header;
|
|
197
|
+
t.is(header.rank, '-1');
|
|
198
|
+
t.is(header.type, 'popinEnd');
|
|
199
|
+
const cta = props.summary.header.cta;
|
|
200
|
+
t.is(cta.title, '__Retry level');
|
|
201
|
+
t.true(_isFunction(cta.onClick));
|
|
202
|
+
t.falsy(cta.href);
|
|
203
|
+
const action = props.summary.action;
|
|
204
|
+
t.is(action.prefix, '__Retry level_');
|
|
205
|
+
t.is(action.title, 'La recherche en ligne - Base');
|
|
206
|
+
const buttonCta = action.button;
|
|
207
|
+
t.is(buttonCta.title, '__Retry level');
|
|
208
|
+
});
|
|
209
|
+
test('should open recommendation', async t => {
|
|
210
|
+
const dispatch = createDispatch(popinLearnerSuccess);
|
|
211
|
+
const props = popinEnd(options, {
|
|
212
|
+
dispatch
|
|
213
|
+
})(popinLearnerSuccess);
|
|
214
|
+
const recommendations = props.summary.recommendation;
|
|
215
|
+
const dispatchedOpenRecommmendation = await recommendations.cards[0].onClick();
|
|
216
|
+
t.deepEqual(actionTypes(dispatchedOpenRecommmendation), [LOCATION_OPEN_RECOMMENDATION_REQUEST, LOCATION_OPEN_RECOMMENDATION_SUCCESS]);
|
|
217
|
+
});
|
|
218
|
+
test('should create a "Retry Chapter" CTA after failure on microlearning progression', t => {
|
|
219
|
+
const dispatch = createDispatch(popinMicrolearningFailure);
|
|
220
|
+
const props = popinEnd(options, {
|
|
221
|
+
dispatch
|
|
222
|
+
})(popinMicrolearningFailure);
|
|
223
|
+
const header = props.summary.header;
|
|
224
|
+
t.falsy(header.rank);
|
|
225
|
+
t.falsy(header.stars);
|
|
226
|
+
t.is(header.type, 'popinEnd');
|
|
227
|
+
const cta = props.summary.header.cta;
|
|
228
|
+
t.is(cta.title, '__Retry chapter');
|
|
229
|
+
t.true(_isFunction(cta.onClick));
|
|
230
|
+
t.falsy(cta.href);
|
|
231
|
+
});
|
|
232
|
+
test('should extract feedback content from exit node', t => {
|
|
233
|
+
const ref = 'biba-exit-node-A';
|
|
234
|
+
const progressionId = getCurrentProgressionId(popinMicrolearningFailure);
|
|
235
|
+
|
|
236
|
+
const state = _pipe(_set(`data.exitNodes.entities.${ref}`, {
|
|
237
|
+
ref,
|
|
238
|
+
_id: '5a4e2adbd56b8b7ddab06532',
|
|
239
|
+
type: 'success',
|
|
240
|
+
title: 'biba_exit_node_A.title',
|
|
241
|
+
description: 'biba_exit_node_A.description',
|
|
242
|
+
mediaDescription: 'biba_exit_node_A.media.description',
|
|
243
|
+
media: {
|
|
244
|
+
ref: 'biba_exit_node_A-media',
|
|
245
|
+
type: 'pdf',
|
|
246
|
+
mediaUrl: 'biba_exit_node_A.media.pdf.mediaUrl',
|
|
247
|
+
mimeType: 'application/pdf',
|
|
248
|
+
description: 'biba_exit_node_A.media.pdf.description',
|
|
249
|
+
subtitles: 'biba_exit_node_A.media.pdf.subtitles',
|
|
250
|
+
posters: []
|
|
251
|
+
},
|
|
252
|
+
__v: 0
|
|
253
|
+
}), _set(`data.progressions.entities.${progressionId}.state.nextContent.ref`, ref))(popinMicrolearningFailure);
|
|
254
|
+
|
|
255
|
+
const dispatch = createDispatch(state);
|
|
256
|
+
const props = popinEnd(options, {
|
|
257
|
+
dispatch
|
|
258
|
+
})(state);
|
|
259
|
+
t.deepEqual(_get('summary.feedback', props), {
|
|
260
|
+
title: 'biba_exit_node_A.title',
|
|
261
|
+
description: 'biba_exit_node_A.description',
|
|
262
|
+
mediaDescription: 'biba_exit_node_A.media.description',
|
|
263
|
+
media: {
|
|
264
|
+
type: 'pdf',
|
|
265
|
+
description: 'biba_exit_node_A.media.pdf.description',
|
|
266
|
+
mimeType: 'application/pdf',
|
|
267
|
+
mediaUrl: 'biba_exit_node_A.media.pdf.mediaUrl'
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
test('should extract feedback content from exit node and counters', t => {
|
|
272
|
+
const ref = 'biba-exit-node-A';
|
|
273
|
+
const progressionId = getCurrentProgressionId(popinMicrolearningFailure);
|
|
274
|
+
|
|
275
|
+
const state = _pipe(_set(`data.exitNodes.entities.${ref}`, {
|
|
276
|
+
ref,
|
|
277
|
+
_id: '5a4e2adbd56b8b7ddab06532',
|
|
278
|
+
type: 'success',
|
|
279
|
+
title: 'title total: {{ success }}',
|
|
280
|
+
description: 'description {{ success }}/{{ total }}',
|
|
281
|
+
mediaDescription: 'mediaDescription {{ total }}',
|
|
282
|
+
media: {
|
|
283
|
+
ref: 'biba_exit_node_A-media',
|
|
284
|
+
type: 'pdf',
|
|
285
|
+
mediaUrl: 'biba_exit_node_A.media.pdf.mediaUrl',
|
|
286
|
+
mimeType: 'application/pdf',
|
|
287
|
+
description: 'biba_exit_node_A.media.pdf.description',
|
|
288
|
+
subtitles: 'biba_exit_node_A.media.pdf.subtitles',
|
|
289
|
+
posters: []
|
|
290
|
+
},
|
|
291
|
+
__v: 0
|
|
292
|
+
}), _set(`data.progressions.entities.${progressionId}.state.nextContent.ref`, ref), _set(`data.progressions.entities.${progressionId}.state.variables`, {
|
|
293
|
+
success: 4,
|
|
294
|
+
total: 10
|
|
295
|
+
}))(popinMicrolearningFailure);
|
|
296
|
+
|
|
297
|
+
const dispatch = createDispatch(state);
|
|
298
|
+
const props = popinEnd(options, {
|
|
299
|
+
dispatch
|
|
300
|
+
})(state);
|
|
301
|
+
t.deepEqual(_get('summary.feedback', props), {
|
|
302
|
+
title: 'title total: 4',
|
|
303
|
+
description: 'description 4/10',
|
|
304
|
+
mediaDescription: 'mediaDescription 10',
|
|
305
|
+
media: {
|
|
306
|
+
type: 'pdf',
|
|
307
|
+
description: 'biba_exit_node_A.media.pdf.description',
|
|
308
|
+
mimeType: 'application/pdf',
|
|
309
|
+
mediaUrl: 'biba_exit_node_A.media.pdf.mediaUrl'
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
});
|
|
313
|
+
//# sourceMappingURL=popin-end.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popin-end.js","names":["test","mockTranslate","getCurrentProgressionId","LOCATION_NEXT_CONTENT_REQUEST","LOCATION_NEXT_CONTENT_SUCCESS","LOCATION_OPEN_RECOMMENDATION_REQUEST","LOCATION_OPEN_RECOMMENDATION_SUCCESS","LOCATION_SEE_COMMENT_REQUEST","LOCATION_SEE_COMMENT_SUCCESS","SEND_POST_COMMENT_REQUEST","SEND_POST_COMMENT_SUCCESS","UI_EDIT_COMMENT","popinEnd","popinLearnerSuccess","popinLearnerSuccessWithRedirection","popinLearnerFailure","popinLearnerFailureWithRedirection","popinLearnerAdaptiveFailure","popinMicrolearningFailure","popinMicrolearningSuccess","services","Comments","post","Location","openRecommendation","nextLevel","seeComment","createDispatch","state","getState","action","dispatched","dispatch","maybeAction","push","actionTypes","actions","type","options","translate","t","props","header","summary","is","rank","stars","cta","title","true","onClick","falsy","href","dispatchedHeaderCta","deepEqual","prefix","buttonCta","button","dispatchedActionCta","comment","edition","postDisabled","isSent","value","onChange","dispatchedOnChange","target","onPost","dispatchedOnPost","confirmation","dispatchedOnClick","subtitle","lives","recommendations","recommendation","dispatchedOpenRecommmendation","cards","ref","progressionId","_id","description","mediaDescription","media","mediaUrl","mimeType","subtitles","posters","__v","success","total"],"sources":["../../../src/map-state-to-props/test/popin-end.js"],"sourcesContent":["import test from 'ava';\nimport {get, map, set, pipe, identity, isFunction, isUndefined} from 'lodash/fp';\n\nimport {mockTranslate} from '@coorpacademy/translate';\nimport {\n getCurrentProgressionId,\n LOCATION_NEXT_CONTENT_REQUEST,\n LOCATION_NEXT_CONTENT_SUCCESS,\n LOCATION_OPEN_RECOMMENDATION_REQUEST,\n LOCATION_OPEN_RECOMMENDATION_SUCCESS,\n LOCATION_SEE_COMMENT_REQUEST,\n LOCATION_SEE_COMMENT_SUCCESS,\n SEND_POST_COMMENT_REQUEST,\n SEND_POST_COMMENT_SUCCESS,\n UI_EDIT_COMMENT\n} from '@coorpacademy/player-store';\nimport popinEnd from '../popin-end';\n\nimport popinLearnerSuccess from './fixtures/popin-end/learner-success';\nimport popinLearnerSuccessWithRedirection from './fixtures/popin-end/learner-success-with-redirection';\nimport popinLearnerFailure from './fixtures/popin-end/learner-failure';\nimport popinLearnerFailureWithRedirection from './fixtures/popin-end/learner-failure-with-redirection';\nimport popinLearnerAdaptiveFailure from './fixtures/popin-end/learner-adaptive-failure';\nimport popinMicrolearningFailure from './fixtures/popin-end/fail';\nimport popinMicrolearningSuccess from './fixtures/popin-end/success';\n\nconst services = {\n Comments: {\n post: identity\n },\n Location: {\n openRecommendation: identity,\n nextLevel: identity,\n seeComment: identity\n }\n};\n\nconst createDispatch = state => {\n const getState = () => state;\n\n return async action => {\n const dispatched = [];\n const dispatch = maybeAction =>\n isFunction(maybeAction)\n ? maybeAction(dispatch, getState, {services})\n : dispatched.push(maybeAction);\n\n await dispatch(action);\n\n return dispatched;\n };\n};\n\nconst actionTypes = actions => map(({type}) => type, actions);\nconst options = {translate: mockTranslate};\n\ntest('should create a \"Next Level\" CTA after success on learner progression', async t => {\n const dispatch = createDispatch(popinLearnerSuccess);\n const props = popinEnd(options, {dispatch})(popinLearnerSuccess);\n\n const header = props.summary.header;\n t.is(header.rank, '+1');\n t.is(header.stars, '+2');\n t.is(header.type, 'popinEnd');\n\n const cta = header.cta;\n t.is(cta.title, '__Next level');\n t.true(isFunction(cta.onClick));\n t.falsy(cta.href);\n const dispatchedHeaderCta = await cta.onClick();\n t.deepEqual(actionTypes(dispatchedHeaderCta), [\n LOCATION_NEXT_CONTENT_REQUEST,\n LOCATION_NEXT_CONTENT_SUCCESS\n ]);\n\n const action = props.summary.action;\n t.is(action.prefix, '__Next level_');\n t.is(action.title, 'La recherche en ligne - Avancé');\n\n const buttonCta = action.button;\n t.is(buttonCta.title, '__Next level');\n const dispatchedActionCta = await buttonCta.onClick();\n t.deepEqual(actionTypes(dispatchedActionCta), [\n LOCATION_NEXT_CONTENT_REQUEST,\n LOCATION_NEXT_CONTENT_SUCCESS\n ]);\n\n const comment = props.summary.comment;\n t.is(comment.edition.postDisabled, true);\n});\n\ntest('should write, send, and go see a comment after success on learner progression', async t => {\n const state = pipe(\n set('data.comments.entities.idProgression1234.isSent', true),\n set('ui.comments.text', 'textToSend')\n )(popinLearnerSuccess);\n\n const dispatch = createDispatch(state);\n const props = popinEnd(options, {dispatch})(state);\n\n const comment = props.summary.comment;\n t.is(comment.isSent, true);\n t.is(comment.edition.value, 'textToSend');\n t.is(comment.edition.postDisabled, false);\n\n const onChange = comment.edition.onChange;\n t.true(isFunction(onChange));\n const dispatchedOnChange = await onChange({target: {value: 'foo'}});\n\n t.deepEqual(actionTypes(dispatchedOnChange), [UI_EDIT_COMMENT]);\n\n const onPost = comment.edition.onPost;\n t.true(isFunction(onPost));\n const dispatchedOnPost = await onPost();\n\n t.deepEqual(actionTypes(dispatchedOnPost), [\n SEND_POST_COMMENT_REQUEST,\n SEND_POST_COMMENT_SUCCESS\n ]);\n\n const onClick = comment.confirmation.onClick;\n t.true(isFunction(onClick));\n const dispatchedOnClick = await onClick();\n\n t.deepEqual(actionTypes(dispatchedOnClick), [\n LOCATION_SEE_COMMENT_REQUEST,\n LOCATION_SEE_COMMENT_SUCCESS\n ]);\n});\n\ntest('should not see comment section after failure on learner progression', t => {\n const dispatch = createDispatch(popinLearnerFailure);\n const props = popinEnd(options, {dispatch})(popinLearnerFailure);\n t.is(props.summary.comment, null);\n t.is(props.summary.header.subtitle, '__You are out of lives!');\n t.is(props.summary.header.lives, 0);\n});\n\ntest('should verify that cta should redirect if redirectURLAfterEnd is set on state for failure popin', t => {\n const dispatch = createDispatch(popinLearnerFailureWithRedirection);\n const props = popinEnd(options, {dispatch})(popinLearnerFailureWithRedirection);\n\n const header = props.summary.header;\n const cta = header.cta;\n t.is(cta.title, '__Click to continue');\n t.true(isUndefined(cta.onClick));\n t.is(cta.href, 'http://www.google.com');\n});\n\ntest('should verify that cta should redirect if redirectURLAfterEnd is set on state for success popin', t => {\n const dispatch = createDispatch(popinLearnerSuccessWithRedirection);\n const props = popinEnd(options, {dispatch})(popinLearnerSuccessWithRedirection);\n\n const header = props.summary.header;\n const cta = header.cta;\n t.is(cta.title, '__Click to continue');\n t.true(isUndefined(cta.onClick));\n t.is(cta.href, 'http://www.google.com');\n});\n\ntest('should not see comment section after failure on microlearning progression', t => {\n const dispatch = createDispatch(popinMicrolearningFailure);\n const props = popinEnd(options, {\n dispatch\n })(popinMicrolearningFailure);\n t.is(props.summary.comment, null);\n});\n\ntest('should not see comment section after success on microlearning progression', t => {\n const dispatch = createDispatch(popinMicrolearningSuccess);\n const props = popinEnd(options, {\n dispatch\n })(popinMicrolearningSuccess);\n t.is(props.summary.comment, null);\n});\n\ntest(\"livesDisabled == true ---> should not see lives and 'You are out of lives!' message\", t => {\n const dispatch = createDispatch(popinLearnerAdaptiveFailure);\n const props = popinEnd(options, {dispatch})(popinLearnerAdaptiveFailure);\n\n t.is(props.summary.header.subtitle, '__Nice try!');\n t.is(props.summary.header.lives, null);\n});\n\ntest('should create a \"Back to Home\" CTA after success on learner progression with coach content', async t => {\n const state = pipe(\n set(['data', 'contents', 'level', 'entities', '1.B', 'level'], 'coach'),\n set('data.nextContent.entities.idProgression1234', null)\n )(popinLearnerSuccess);\n\n const dispatch = createDispatch(state);\n const props = popinEnd(options, {dispatch})(state);\n\n const header = props.summary.header;\n t.is(header.rank, '+1');\n t.is(header.stars, '+2');\n t.is(header.type, 'popinEnd');\n\n const cta = header.cta;\n t.is(cta.title, '__Back to home');\n t.deepEqual(map('type')(await cta.onClick()), [\n '@@location/EXIT_REQUEST',\n '@@location/EXIT_FAILURE'\n ]);\n t.falsy(cta.href);\n\n t.falsy(props.summary.action);\n});\n\ntest('should create a \"Back to Home\" CTA after success on learner progression with content with only base level', async t => {\n const state = set(\n ['data', 'nextContent', 'entities', 'idProgression1234'],\n null,\n popinLearnerSuccess\n );\n\n const dispatch = createDispatch(state);\n const props = popinEnd(options, {dispatch})(state);\n\n const header = props.summary.header;\n t.is(header.rank, '+1');\n t.is(header.stars, '+2');\n t.is(header.type, 'popinEnd');\n\n const cta = header.cta;\n t.is(cta.title, '__Back to home');\n t.deepEqual(map('type')(await cta.onClick()), [\n '@@location/EXIT_REQUEST',\n '@@location/EXIT_FAILURE'\n ]);\n t.falsy(cta.href);\n});\n\ntest('should create a \"Retry Level\" CTA after failure on learner progression', t => {\n const dispatch = createDispatch(popinLearnerFailure);\n const props = popinEnd(options, {dispatch})(popinLearnerFailure);\n\n const header = props.summary.header;\n t.is(header.rank, '-1');\n t.is(header.type, 'popinEnd');\n\n const cta = props.summary.header.cta;\n t.is(cta.title, '__Retry level');\n t.true(isFunction(cta.onClick));\n t.falsy(cta.href);\n\n const action = props.summary.action;\n t.is(action.prefix, '__Retry level_');\n t.is(action.title, 'La recherche en ligne - Base');\n\n const buttonCta = action.button;\n t.is(buttonCta.title, '__Retry level');\n});\n\ntest('should open recommendation', async t => {\n const dispatch = createDispatch(popinLearnerSuccess);\n const props = popinEnd(options, {dispatch})(popinLearnerSuccess);\n\n const recommendations = props.summary.recommendation;\n\n const dispatchedOpenRecommmendation = await recommendations.cards[0].onClick();\n t.deepEqual(actionTypes(dispatchedOpenRecommmendation), [\n LOCATION_OPEN_RECOMMENDATION_REQUEST,\n LOCATION_OPEN_RECOMMENDATION_SUCCESS\n ]);\n});\n\ntest('should create a \"Retry Chapter\" CTA after failure on microlearning progression', t => {\n const dispatch = createDispatch(popinMicrolearningFailure);\n const props = popinEnd(options, {dispatch})(popinMicrolearningFailure);\n\n const header = props.summary.header;\n t.falsy(header.rank);\n t.falsy(header.stars);\n t.is(header.type, 'popinEnd');\n\n const cta = props.summary.header.cta;\n t.is(cta.title, '__Retry chapter');\n t.true(isFunction(cta.onClick));\n t.falsy(cta.href);\n});\n\ntest('should extract feedback content from exit node', t => {\n const ref = 'biba-exit-node-A';\n const progressionId = getCurrentProgressionId(popinMicrolearningFailure);\n const state = pipe(\n set(`data.exitNodes.entities.${ref}`, {\n ref,\n _id: '5a4e2adbd56b8b7ddab06532',\n type: 'success',\n title: 'biba_exit_node_A.title',\n description: 'biba_exit_node_A.description',\n mediaDescription: 'biba_exit_node_A.media.description',\n media: {\n ref: 'biba_exit_node_A-media',\n type: 'pdf',\n mediaUrl: 'biba_exit_node_A.media.pdf.mediaUrl',\n mimeType: 'application/pdf',\n description: 'biba_exit_node_A.media.pdf.description',\n subtitles: 'biba_exit_node_A.media.pdf.subtitles',\n posters: []\n },\n __v: 0\n }),\n set(`data.progressions.entities.${progressionId}.state.nextContent.ref`, ref)\n )(popinMicrolearningFailure);\n\n const dispatch = createDispatch(state);\n const props = popinEnd(options, {dispatch})(state);\n\n t.deepEqual(get('summary.feedback', props), {\n title: 'biba_exit_node_A.title',\n description: 'biba_exit_node_A.description',\n mediaDescription: 'biba_exit_node_A.media.description',\n media: {\n type: 'pdf',\n description: 'biba_exit_node_A.media.pdf.description',\n mimeType: 'application/pdf',\n mediaUrl: 'biba_exit_node_A.media.pdf.mediaUrl'\n }\n });\n});\n\ntest('should extract feedback content from exit node and counters', t => {\n const ref = 'biba-exit-node-A';\n const progressionId = getCurrentProgressionId(popinMicrolearningFailure);\n const state = pipe(\n set(`data.exitNodes.entities.${ref}`, {\n ref,\n _id: '5a4e2adbd56b8b7ddab06532',\n type: 'success',\n title: 'title total: {{ success }}',\n description: 'description {{ success }}/{{ total }}',\n mediaDescription: 'mediaDescription {{ total }}',\n media: {\n ref: 'biba_exit_node_A-media',\n type: 'pdf',\n mediaUrl: 'biba_exit_node_A.media.pdf.mediaUrl',\n mimeType: 'application/pdf',\n description: 'biba_exit_node_A.media.pdf.description',\n subtitles: 'biba_exit_node_A.media.pdf.subtitles',\n posters: []\n },\n __v: 0\n }),\n set(`data.progressions.entities.${progressionId}.state.nextContent.ref`, ref),\n set(`data.progressions.entities.${progressionId}.state.variables`, {success: 4, total: 10})\n )(popinMicrolearningFailure);\n const dispatch = createDispatch(state);\n const props = popinEnd(options, {dispatch})(state);\n\n t.deepEqual(get('summary.feedback', props), {\n title: 'title total: 4',\n description: 'description 4/10',\n mediaDescription: 'mediaDescription 10',\n media: {\n type: 'pdf',\n description: 'biba_exit_node_A.media.pdf.description',\n mimeType: 'application/pdf',\n mediaUrl: 'biba_exit_node_A.media.pdf.mediaUrl'\n }\n });\n});\n"],"mappings":";;;;;;;AAAA,OAAOA,IAAP,MAAiB,KAAjB;AAGA,SAAQC,aAAR,QAA4B,yBAA5B;AACA,SACEC,uBADF,EAEEC,6BAFF,EAGEC,6BAHF,EAIEC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CALuB;IAMpCC,gBAAgB,EAAE,8BANkB;IAOpCC,KAAK,EAAE;MACLL,GAAG,EAAE,wBADA;MAELxC,IAAI,EAAE,KAFD;MAGL8C,QAAQ,EAAE,qCAHL;MAILC,QAAQ,EAAE,iBAJL;MAKLJ,WAAW,EAAE,wCALR;MAMLK,SAAS,EAAE,sCANN;MAOLC,OAAO,EAAE;IAPJ,CAP6B;IAgBpCC,GAAG,EAAE;EAhB+B,CAAtC,CADY,EAmBZ,KAAK,8BAA6BT,aAAc,wBAAhD,EAAyED,GAAzE,CAnBY,EAoBZ,KAAK,8BAA6BC,aAAc,kBAAhD,EAAmE;IAACU,OAAO,EAAE,CAAV;IAAaC,KAAK,EAAE;EAApB,CAAnE,CApBY,EAqBZvE,yBArBY,CAAd;;EAsBA,MAAMc,QAAQ,GAAGL,cAAc,CAACC,KAAD,CAA/B;EACA,MAAMa,KAAK,GAAG7B,QAAQ,CAAC0B,OAAD,EAAU;IAACN;EAAD,CAAV,CAAR,CAA8BJ,KAA9B,CAAd;EAEAY,CAAC,CAACc,SAAF,CAAY,KAAI,kBAAJ,EAAwBb,KAAxB,CAAZ,EAA4C;IAC1CO,KAAK,EAAE,gBADmC;IAE1CgC,WAAW,EAAE,kBAF6B;IAG1CC,gBAAgB,EAAE,qBAHwB;IAI1CC,KAAK,EAAE;MACL7C,IAAI,EAAE,KADD;MAEL2C,WAAW,EAAE,wCAFR;MAGLI,QAAQ,EAAE,iBAHL;MAILD,QAAQ,EAAE;IAJL;EAJmC,CAA5C;AAWD,CAvCG,CAAJ"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import _omit from "lodash/fp/omit";
|
|
2
|
+
import _identity from "lodash/fp/identity";
|
|
3
|
+
import test from 'ava';
|
|
4
|
+
import mapStateToErrorPopinProps from '../error-popin';
|
|
5
|
+
test('should return error popin props if any call fails', t => {
|
|
6
|
+
t.plan(2);
|
|
7
|
+
global.window = {
|
|
8
|
+
location: {
|
|
9
|
+
reload: () => {
|
|
10
|
+
t.pass();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const props = mapStateToErrorPopinProps({
|
|
15
|
+
dispatch: _identity
|
|
16
|
+
})({
|
|
17
|
+
data: {
|
|
18
|
+
progressions: {
|
|
19
|
+
isFailure: true
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
t.deepEqual(_omit('firstButton.handleOnclick', props), {
|
|
24
|
+
content: 'An unexpected error has occurred',
|
|
25
|
+
icon: 'AlertDiamond',
|
|
26
|
+
mode: 'alert',
|
|
27
|
+
descriptionText: 'Please reload the page and try again',
|
|
28
|
+
firstButton: {
|
|
29
|
+
largeButton: true,
|
|
30
|
+
label: 'Reload',
|
|
31
|
+
type: 'primary',
|
|
32
|
+
'aria-label': 'Reload'
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
props.firstButton.handleOnclick();
|
|
36
|
+
});
|
|
37
|
+
test('should return error popin props if content calls fail', t => {
|
|
38
|
+
t.plan(2);
|
|
39
|
+
global.window = {
|
|
40
|
+
location: {
|
|
41
|
+
reload: () => {
|
|
42
|
+
t.pass();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const props = mapStateToErrorPopinProps({
|
|
47
|
+
dispatch: _identity
|
|
48
|
+
})({
|
|
49
|
+
data: {
|
|
50
|
+
contents: {
|
|
51
|
+
level: {
|
|
52
|
+
isFailure: true
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
t.deepEqual(_omit('firstButton.handleOnclick', props), {
|
|
58
|
+
content: 'An unexpected error has occurred',
|
|
59
|
+
icon: 'AlertDiamond',
|
|
60
|
+
mode: 'alert',
|
|
61
|
+
descriptionText: 'Please reload the page and try again',
|
|
62
|
+
firstButton: {
|
|
63
|
+
largeButton: true,
|
|
64
|
+
label: 'Reload',
|
|
65
|
+
type: 'primary',
|
|
66
|
+
'aria-label': 'Reload'
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
props.firstButton.handleOnclick();
|
|
70
|
+
});
|
|
71
|
+
test('should not return error popin props', t => {
|
|
72
|
+
const props = mapStateToErrorPopinProps({
|
|
73
|
+
dispatch: _identity
|
|
74
|
+
})({});
|
|
75
|
+
t.is(props, undefined);
|
|
76
|
+
});
|
|
77
|
+
//# sourceMappingURL=popin-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popin-error.js","names":["test","mapStateToErrorPopinProps","t","plan","global","window","location","reload","pass","props","dispatch","data","progressions","isFailure","deepEqual","content","icon","mode","descriptionText","firstButton","largeButton","label","type","handleOnclick","contents","level","is","undefined"],"sources":["../../../src/map-state-to-props/test/popin-error.js"],"sourcesContent":["import test from 'ava';\n\nimport {identity, omit} from 'lodash/fp';\n\nimport mapStateToErrorPopinProps from '../error-popin';\n\ntest('should return error popin props if any call fails', t => {\n t.plan(2);\n global.window = {\n location: {\n reload: () => {\n t.pass();\n }\n }\n };\n const props = mapStateToErrorPopinProps({dispatch: identity})({\n data: {\n progressions: {\n isFailure: true\n }\n }\n });\n\n t.deepEqual(omit('firstButton.handleOnclick', props), {\n content: 'An unexpected error has occurred',\n icon: 'AlertDiamond',\n mode: 'alert',\n descriptionText: 'Please reload the page and try again',\n firstButton: {\n largeButton: true,\n label: 'Reload',\n type: 'primary',\n 'aria-label': 'Reload'\n }\n });\n props.firstButton.handleOnclick();\n});\n\ntest('should return error popin props if content calls fail', t => {\n t.plan(2);\n global.window = {\n location: {\n reload: () => {\n t.pass();\n }\n }\n };\n const props = mapStateToErrorPopinProps({dispatch: identity})({\n data: {\n contents: {\n level: {\n isFailure: true\n }\n }\n }\n });\n\n t.deepEqual(omit('firstButton.handleOnclick', props), {\n content: 'An unexpected error has occurred',\n icon: 'AlertDiamond',\n mode: 'alert',\n descriptionText: 'Please reload the page and try again',\n firstButton: {\n largeButton: true,\n label: 'Reload',\n type: 'primary',\n 'aria-label': 'Reload'\n }\n });\n props.firstButton.handleOnclick();\n});\n\ntest('should not return error popin props', t => {\n const props = mapStateToErrorPopinProps({dispatch: identity})({});\n\n t.is(props, undefined);\n});\n"],"mappings":";;AAAA,OAAOA,IAAP,MAAiB,KAAjB;AAIA,OAAOC,yBAAP,MAAsC,gBAAtC;AAEAD,IAAI,CAAC,mDAAD,EAAsDE,CAAC,IAAI;EAC7DA,CAAC,CAACC,IAAF,CAAO,CAAP;EACAC,MAAM,CAACC,MAAP,GAAgB;IACdC,QAAQ,EAAE;MACRC,MAAM,EAAE,MAAM;QACZL,CAAC,CAACM,IAAF;MACD;IAHO;EADI,CAAhB;EAOA,MAAMC,KAAK,GAAGR,yBAAyB,CAAC;IAACS,QAAQ;EAAT,CAAD,CAAzB,CAAgD;IAC5DC,IAAI,EAAE;MACJC,YAAY,EAAE;QACZC,SAAS,EAAE;MADC;IADV;EADsD,CAAhD,CAAd;EAQAX,CAAC,CAACY,SAAF,CAAY,MAAK,2BAAL,EAAkCL,KAAlC,CAAZ,EAAsD;IACpDM,OAAO,EAAE,kCAD2C;IAEpDC,IAAI,EAAE,cAF8C;IAGpDC,IAAI,EAAE,OAH8C;IAIpDC,eAAe,EAAE,sCAJmC;IAKpDC,WAAW,EAAE;MACXC,WAAW,EAAE,IADF;MAEXC,KAAK,EAAE,QAFI;MAGXC,IAAI,EAAE,SAHK;MAIX,cAAc;IAJH;EALuC,CAAtD;EAYAb,KAAK,CAACU,WAAN,CAAkBI,aAAlB;AACD,CA9BG,CAAJ;AAgCAvB,IAAI,CAAC,uDAAD,EAA0DE,CAAC,IAAI;EACjEA,CAAC,CAACC,IAAF,CAAO,CAAP;EACAC,MAAM,CAACC,MAAP,GAAgB;IACdC,QAAQ,EAAE;MACRC,MAAM,EAAE,MAAM;QACZL,CAAC,CAACM,IAAF;MACD;IAHO;EADI,CAAhB;EAOA,MAAMC,KAAK,GAAGR,yBAAyB,CAAC;IAACS,QAAQ;EAAT,CAAD,CAAzB,CAAgD;IAC5DC,IAAI,EAAE;MACJa,QAAQ,EAAE;QACRC,KAAK,EAAE;UACLZ,SAAS,EAAE;QADN;MADC;IADN;EADsD,CAAhD,CAAd;EAUAX,CAAC,CAACY,SAAF,CAAY,MAAK,2BAAL,EAAkCL,KAAlC,CAAZ,EAAsD;IACpDM,OAAO,EAAE,kCAD2C;IAEpDC,IAAI,EAAE,cAF8C;IAGpDC,IAAI,EAAE,OAH8C;IAIpDC,eAAe,EAAE,sCAJmC;IAKpDC,WAAW,EAAE;MACXC,WAAW,EAAE,IADF;MAEXC,KAAK,EAAE,QAFI;MAGXC,IAAI,EAAE,SAHK;MAIX,cAAc;IAJH;EALuC,CAAtD;EAYAb,KAAK,CAACU,WAAN,CAAkBI,aAAlB;AACD,CAhCG,CAAJ;AAkCAvB,IAAI,CAAC,qCAAD,EAAwCE,CAAC,IAAI;EAC/C,MAAMO,KAAK,GAAGR,yBAAyB,CAAC;IAACS,QAAQ;EAAT,CAAD,CAAzB,CAAgD,EAAhD,CAAd;EAEAR,CAAC,CAACwB,EAAF,CAAKjB,KAAL,EAAYkB,SAAZ;AACD,CAJG,CAAJ"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import _identity from "lodash/fp/identity";
|
|
2
|
+
import _isArray from "lodash/fp/isArray";
|
|
3
|
+
import test from 'ava';
|
|
4
|
+
import { mockTranslate } from '@coorpacademy/translate';
|
|
5
|
+
import { getCurrentSlide } from '@coorpacademy/player-store';
|
|
6
|
+
import creategetResourcesProps from '../resources';
|
|
7
|
+
import unselected from './fixtures/slides/videos';
|
|
8
|
+
const options = {
|
|
9
|
+
translate: mockTranslate
|
|
10
|
+
};
|
|
11
|
+
const store = {
|
|
12
|
+
dispatch: _identity
|
|
13
|
+
};
|
|
14
|
+
const getResourcesProps = creategetResourcesProps(options, store);
|
|
15
|
+
|
|
16
|
+
const createAssertVideoShape = t => video => {
|
|
17
|
+
t.truthy(video.videoId);
|
|
18
|
+
t.truthy(video.description);
|
|
19
|
+
t.truthy(video.mimeType);
|
|
20
|
+
t.truthy(video.onClick);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
test('should create list of videos', t => {
|
|
24
|
+
const slide = getCurrentSlide(unselected);
|
|
25
|
+
const props = getResourcesProps(unselected, slide);
|
|
26
|
+
const assertVideoShape = createAssertVideoShape(t);
|
|
27
|
+
t.true(_isArray(props));
|
|
28
|
+
t.is(props.length, 2);
|
|
29
|
+
props.forEach(assertVideoShape);
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=resources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.js","names":["test","mockTranslate","getCurrentSlide","creategetResourcesProps","unselected","options","translate","store","dispatch","getResourcesProps","createAssertVideoShape","t","video","truthy","videoId","description","mimeType","onClick","slide","props","assertVideoShape","true","is","length","forEach"],"sources":["../../../src/map-state-to-props/test/resources.js"],"sourcesContent":["import test from 'ava';\nimport {isArray, identity} from 'lodash/fp';\n\nimport {mockTranslate} from '@coorpacademy/translate';\nimport {getCurrentSlide} from '@coorpacademy/player-store';\nimport creategetResourcesProps from '../resources';\nimport unselected from './fixtures/slides/videos';\n\nconst options = {translate: mockTranslate};\nconst store = {dispatch: identity};\nconst getResourcesProps = creategetResourcesProps(options, store);\n\nconst createAssertVideoShape = t => video => {\n t.truthy(video.videoId);\n t.truthy(video.description);\n t.truthy(video.mimeType);\n t.truthy(video.onClick);\n};\n\ntest('should create list of videos', t => {\n const slide = getCurrentSlide(unselected);\n const props = getResourcesProps(unselected, slide);\n const assertVideoShape = createAssertVideoShape(t);\n\n t.true(isArray(props));\n t.is(props.length, 2);\n\n props.forEach(assertVideoShape);\n});\n"],"mappings":";;AAAA,OAAOA,IAAP,MAAiB,KAAjB;AAGA,SAAQC,aAAR,QAA4B,yBAA5B;AACA,SAAQC,eAAR,QAA8B,4BAA9B;AACA,OAAOC,uBAAP,MAAoC,cAApC;AACA,OAAOC,UAAP,MAAuB,0BAAvB;AAEA,MAAMC,OAAO,GAAG;EAACC,SAAS,EAAEL;AAAZ,CAAhB;AACA,MAAMM,KAAK,GAAG;EAACC,QAAQ;AAAT,CAAd;AACA,MAAMC,iBAAiB,GAAGN,uBAAuB,CAACE,OAAD,EAAUE,KAAV,CAAjD;;AAEA,MAAMG,sBAAsB,GAAGC,CAAC,IAAIC,KAAK,IAAI;EAC3CD,CAAC,CAACE,MAAF,CAASD,KAAK,CAACE,OAAf;EACAH,CAAC,CAACE,MAAF,CAASD,KAAK,CAACG,WAAf;EACAJ,CAAC,CAACE,MAAF,CAASD,KAAK,CAACI,QAAf;EACAL,CAAC,CAACE,MAAF,CAASD,KAAK,CAACK,OAAf;AACD,CALD;;AAOAjB,IAAI,CAAC,8BAAD,EAAiCW,CAAC,IAAI;EACxC,MAAMO,KAAK,GAAGhB,eAAe,CAACE,UAAD,CAA7B;EACA,MAAMe,KAAK,GAAGV,iBAAiB,CAACL,UAAD,EAAac,KAAb,CAA/B;EACA,MAAME,gBAAgB,GAAGV,sBAAsB,CAACC,CAAD,CAA/C;EAEAA,CAAC,CAACU,IAAF,CAAO,SAAQF,KAAR,CAAP;EACAR,CAAC,CAACW,EAAF,CAAKH,KAAK,CAACI,MAAX,EAAmB,CAAnB;EAEAJ,KAAK,CAACK,OAAN,CAAcJ,gBAAd;AACD,CATG,CAAJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-timeout.js","names":["test","addTimeout","t","fun","Promise","resolve","pass"],"sources":["../../src/test/add-timeout.js"],"sourcesContent":["import test from 'ava';\nimport {addTimeout} from '../../sandbox/services';\n\ntest(\"should delay promise's fulfillment\", async t => {\n const fun = addTimeout(0, () => Promise.resolve());\n await fun();\n t.pass();\n});\n"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,SAAQC,UAAR,QAAyB,wBAAzB;AAEAD,IAAI,CAAC,oCAAD,EAAuC,MAAME,CAAN,IAAW;EACpD,MAAMC,GAAG,GAAGF,UAAU,CAAC,CAAD,EAAI,MAAMG,OAAO,CAACC,OAAR,EAAV,CAAtB;EACA,MAAMF,GAAG,EAAT;EACAD,CAAC,CAACI,IAAF;AACD,CAJG,CAAJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css-register.js","names":["cssRegister"],"sources":["../../../src/test/helpers/css-register.js"],"sourcesContent":["import cssRegister from '@coorpacademy/css-modules-require-hook';\n\ncssRegister();\n"],"mappings":"AAAA,OAAOA,WAAP,MAAwB,wCAAxB;AAEAA,WAAW"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"macro.js","names":["macro","t","reducer","state","action","expected","deepEqual","Object","freeze"],"sources":["../../../src/test/helpers/macro.js"],"sourcesContent":["const macro = (t, reducer, state, action, expected) => {\n t.deepEqual(reducer(Object.freeze(state), Object.freeze(action)), Object.freeze(expected));\n};\n\nexport default macro;\n"],"mappings":"AAAA,MAAMA,KAAK,GAAG,CAACC,CAAD,EAAIC,OAAJ,EAAaC,KAAb,EAAoBC,MAApB,EAA4BC,QAA5B,KAAyC;EACrDJ,CAAC,CAACK,SAAF,CAAYJ,OAAO,CAACK,MAAM,CAACC,MAAP,CAAcL,KAAd,CAAD,EAAuBI,MAAM,CAACC,MAAP,CAAcJ,MAAd,CAAvB,CAAnB,EAAkEG,MAAM,CAACC,MAAP,CAAcH,QAAd,CAAlE;AACD,CAFD;;AAIA,eAAeL,KAAf"}
|
package/es/test/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import browserEnv from 'browser-env';
|
|
3
|
+
import { mockTranslate } from '@coorpacademy/translate';
|
|
4
|
+
import { Analytics as AnalyticsService, Answers as AnswersService, Clues as CluesService, Coach as CoachService, Comments as CommentsService, Content as ContentService, ExitNodes as ExitNodesService, LeaderBoard as LeaderBoardService, Location as LocationService, Progressions as ProgressionsService, Recommendations as RecommendationsService } from '@coorpacademy/player-services';
|
|
5
|
+
import * as fixtures from '../../sandbox/fixtures';
|
|
6
|
+
import { create } from '..';
|
|
7
|
+
const services = {
|
|
8
|
+
Analytics: AnalyticsService,
|
|
9
|
+
Answers: AnswersService(fixtures),
|
|
10
|
+
Clues: CluesService(fixtures),
|
|
11
|
+
Coach: CoachService,
|
|
12
|
+
Comments: CommentsService,
|
|
13
|
+
Content: ContentService(fixtures),
|
|
14
|
+
ExitNodes: ExitNodesService(fixtures),
|
|
15
|
+
LeaderBoard: LeaderBoardService,
|
|
16
|
+
Location: LocationService,
|
|
17
|
+
Logger: console,
|
|
18
|
+
Progressions: ProgressionsService(fixtures),
|
|
19
|
+
Recommendations: RecommendationsService(fixtures)
|
|
20
|
+
};
|
|
21
|
+
browserEnv(['window', 'document', 'navigator']);
|
|
22
|
+
test('should create app', async t => {
|
|
23
|
+
const el = document.createElement('div');
|
|
24
|
+
const app = create({
|
|
25
|
+
translate: mockTranslate,
|
|
26
|
+
container: el,
|
|
27
|
+
services,
|
|
28
|
+
progression: '0'
|
|
29
|
+
});
|
|
30
|
+
await app.updateCoaches({
|
|
31
|
+
chatStarted: false,
|
|
32
|
+
coachForDiscipline: []
|
|
33
|
+
});
|
|
34
|
+
await app.selectProgression('1');
|
|
35
|
+
app.update();
|
|
36
|
+
app.unsubscribe();
|
|
37
|
+
t.pass();
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["test","browserEnv","mockTranslate","Analytics","AnalyticsService","Answers","AnswersService","Clues","CluesService","Coach","CoachService","Comments","CommentsService","Content","ContentService","ExitNodes","ExitNodesService","LeaderBoard","LeaderBoardService","Location","LocationService","Progressions","ProgressionsService","Recommendations","RecommendationsService","fixtures","create","services","Logger","console","t","el","document","createElement","app","translate","container","progression","updateCoaches","chatStarted","coachForDiscipline","selectProgression","update","unsubscribe","pass"],"sources":["../../src/test/index.js"],"sourcesContent":["import test from 'ava';\nimport browserEnv from 'browser-env';\nimport {mockTranslate} from '@coorpacademy/translate';\n\nimport {\n Analytics as AnalyticsService,\n Answers as AnswersService,\n Clues as CluesService,\n Coach as CoachService,\n Comments as CommentsService,\n Content as ContentService,\n ExitNodes as ExitNodesService,\n LeaderBoard as LeaderBoardService,\n Location as LocationService,\n Progressions as ProgressionsService,\n Recommendations as RecommendationsService\n} from '@coorpacademy/player-services';\n\nimport * as fixtures from '../../sandbox/fixtures';\nimport {create} from '..';\n\nconst services = {\n Analytics: AnalyticsService,\n Answers: AnswersService(fixtures),\n Clues: CluesService(fixtures),\n Coach: CoachService,\n Comments: CommentsService,\n Content: ContentService(fixtures),\n ExitNodes: ExitNodesService(fixtures),\n LeaderBoard: LeaderBoardService,\n Location: LocationService,\n Logger: console,\n Progressions: ProgressionsService(fixtures),\n Recommendations: RecommendationsService(fixtures)\n};\n\nbrowserEnv(['window', 'document', 'navigator']);\n\ntest('should create app', async t => {\n const el = document.createElement('div');\n const app = create({\n translate: mockTranslate,\n container: el,\n services,\n progression: '0'\n });\n\n await app.updateCoaches({\n chatStarted: false,\n coachForDiscipline: []\n });\n\n await app.selectProgression('1');\n\n app.update();\n app.unsubscribe();\n t.pass();\n});\n"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,OAAOC,UAAP,MAAuB,aAAvB;AACA,SAAQC,aAAR,QAA4B,yBAA5B;AAEA,SACEC,SAAS,IAAIC,gBADf,EAEEC,OAAO,IAAIC,cAFb,EAGEC,KAAK,IAAIC,YAHX,EAIEC,KAAK,IAAIC,YAJX,EAKEC,QAAQ,IAAIC,eALd,EAMEC,OAAO,IAAIC,cANb,EAOEC,SAAS,IAAIC,gBAPf,EAQEC,WAAW,IAAIC,kBARjB,EASEC,QAAQ,IAAIC,eATd,EAUEC,YAAY,IAAIC,mBAVlB,EAWEC,eAAe,IAAIC,sBAXrB,QAYO,+BAZP;AAcA,OAAO,KAAKC,QAAZ,MAA0B,wBAA1B;AACA,SAAQC,MAAR,QAAqB,IAArB;AAEA,MAAMC,QAAQ,GAAG;EACfxB,SAAS,EAAEC,gBADI;EAEfC,OAAO,EAAEC,cAAc,CAACmB,QAAD,CAFR;EAGflB,KAAK,EAAEC,YAAY,CAACiB,QAAD,CAHJ;EAIfhB,KAAK,EAAEC,YAJQ;EAKfC,QAAQ,EAAEC,eALK;EAMfC,OAAO,EAAEC,cAAc,CAACW,QAAD,CANR;EAOfV,SAAS,EAAEC,gBAAgB,CAACS,QAAD,CAPZ;EAQfR,WAAW,EAAEC,kBARE;EASfC,QAAQ,EAAEC,eATK;EAUfQ,MAAM,EAAEC,OAVO;EAWfR,YAAY,EAAEC,mBAAmB,CAACG,QAAD,CAXlB;EAYfF,eAAe,EAAEC,sBAAsB,CAACC,QAAD;AAZxB,CAAjB;AAeAxB,UAAU,CAAC,CAAC,QAAD,EAAW,UAAX,EAAuB,WAAvB,CAAD,CAAV;AAEAD,IAAI,CAAC,mBAAD,EAAsB,MAAM8B,CAAN,IAAW;EACnC,MAAMC,EAAE,GAAGC,QAAQ,CAACC,aAAT,CAAuB,KAAvB,CAAX;EACA,MAAMC,GAAG,GAAGR,MAAM,CAAC;IACjBS,SAAS,EAAEjC,aADM;IAEjBkC,SAAS,EAAEL,EAFM;IAGjBJ,QAHiB;IAIjBU,WAAW,EAAE;EAJI,CAAD,CAAlB;EAOA,MAAMH,GAAG,CAACI,aAAJ,CAAkB;IACtBC,WAAW,EAAE,KADS;IAEtBC,kBAAkB,EAAE;EAFE,CAAlB,CAAN;EAKA,MAAMN,GAAG,CAACO,iBAAJ,CAAsB,GAAtB,CAAN;EAEAP,GAAG,CAACQ,MAAJ;EACAR,GAAG,CAACS,WAAJ;EACAb,CAAC,CAACc,IAAF;AACD,CAnBG,CAAJ"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import test from 'ava';
|
|
2
|
+
import { createReducers } from '../store';
|
|
3
|
+
import macro from './helpers/macro';
|
|
4
|
+
test('should have initial value', macro, createReducers(), undefined, {}, {
|
|
5
|
+
data: {
|
|
6
|
+
answers: {
|
|
7
|
+
entities: {}
|
|
8
|
+
},
|
|
9
|
+
comments: {
|
|
10
|
+
entities: {}
|
|
11
|
+
},
|
|
12
|
+
configs: {},
|
|
13
|
+
contents: {},
|
|
14
|
+
clues: {
|
|
15
|
+
entities: {}
|
|
16
|
+
},
|
|
17
|
+
exitNodes: {
|
|
18
|
+
entities: {}
|
|
19
|
+
},
|
|
20
|
+
progressions: {
|
|
21
|
+
entities: {}
|
|
22
|
+
},
|
|
23
|
+
rank: {},
|
|
24
|
+
nextContent: {
|
|
25
|
+
entities: {}
|
|
26
|
+
},
|
|
27
|
+
recommendations: {
|
|
28
|
+
entities: {}
|
|
29
|
+
},
|
|
30
|
+
videos: {
|
|
31
|
+
entities: {}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
ui: {
|
|
35
|
+
answers: {},
|
|
36
|
+
coaches: {
|
|
37
|
+
availableCoaches: 0
|
|
38
|
+
},
|
|
39
|
+
comments: {
|
|
40
|
+
text: null
|
|
41
|
+
},
|
|
42
|
+
corrections: {},
|
|
43
|
+
current: {
|
|
44
|
+
progressionId: null
|
|
45
|
+
},
|
|
46
|
+
location: {},
|
|
47
|
+
route: {}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=init-reducers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-reducers.js","names":["test","createReducers","macro","undefined","data","answers","entities","comments","configs","contents","clues","exitNodes","progressions","rank","nextContent","recommendations","videos","ui","coaches","availableCoaches","text","corrections","current","progressionId","location","route"],"sources":["../../src/test/init-reducers.js"],"sourcesContent":["import test from 'ava';\nimport {createReducers} from '../store';\nimport macro from './helpers/macro';\n\ntest(\n 'should have initial value',\n macro,\n createReducers(),\n undefined,\n {},\n {\n data: {\n answers: {entities: {}},\n comments: {entities: {}},\n configs: {},\n contents: {},\n clues: {entities: {}},\n exitNodes: {entities: {}},\n progressions: {entities: {}},\n rank: {},\n nextContent: {entities: {}},\n recommendations: {entities: {}},\n videos: {entities: {}}\n },\n ui: {\n answers: {},\n coaches: {\n availableCoaches: 0\n },\n comments: {\n text: null\n },\n corrections: {},\n current: {\n progressionId: null\n },\n location: {},\n route: {}\n }\n }\n);\n"],"mappings":"AAAA,OAAOA,IAAP,MAAiB,KAAjB;AACA,SAAQC,cAAR,QAA6B,UAA7B;AACA,OAAOC,KAAP,MAAkB,iBAAlB;AAEAF,IAAI,CACF,2BADE,EAEFE,KAFE,EAGFD,cAAc,EAHZ,EAIFE,SAJE,EAKF,EALE,EAMF;EACEC,IAAI,EAAE;IACJC,OAAO,EAAE;MAACC,QAAQ,EAAE;IAAX,CADL;IAEJC,QAAQ,EAAE;MAACD,QAAQ,EAAE;IAAX,CAFN;IAGJE,OAAO,EAAE,EAHL;IAIJC,QAAQ,EAAE,EAJN;IAKJC,KAAK,EAAE;MAACJ,QAAQ,EAAE;IAAX,CALH;IAMJK,SAAS,EAAE;MAACL,QAAQ,EAAE;IAAX,CANP;IAOJM,YAAY,EAAE;MAACN,QAAQ,EAAE;IAAX,CAPV;IAQJO,IAAI,EAAE,EARF;IASJC,WAAW,EAAE;MAACR,QAAQ,EAAE;IAAX,CATT;IAUJS,eAAe,EAAE;MAACT,QAAQ,EAAE;IAAX,CAVb;IAWJU,MAAM,EAAE;MAACV,QAAQ,EAAE;IAAX;EAXJ,CADR;EAcEW,EAAE,EAAE;IACFZ,OAAO,EAAE,EADP;IAEFa,OAAO,EAAE;MACPC,gBAAgB,EAAE;IADX,CAFP;IAKFZ,QAAQ,EAAE;MACRa,IAAI,EAAE;IADE,CALR;IAQFC,WAAW,EAAE,EARX;IASFC,OAAO,EAAE;MACPC,aAAa,EAAE;IADR,CATP;IAYFC,QAAQ,EAAE,EAZR;IAaFC,KAAK,EAAE;EAbL;AAdN,CANE,CAAJ"}
|