Skip to content

Commit f1ade24

Browse files
committed
Add new test data
1 parent f3386af commit f1ade24

File tree

1 file changed

+49
-1
lines changed

1 file changed

+49
-1
lines changed

test/testingData/actions.js

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,37 @@ function parentAsyncActionCreator() {
4343
};
4444
}
4545

46+
const anotherAsyncStart = () => { return { type: 'another-test-action-start' }; };
47+
const anotherAsyncFinish = () => { return { type: 'another-test-action-finish' }; };
48+
const anotherAsyncFail = () => { return { type: 'another-test-action-fail' }; };
49+
50+
function anotherAsyncActionCreator() {
51+
return dispatch => {
52+
dispatch(anotherAsyncStart());
53+
return asyncFunction().then(() => {
54+
dispatch(anotherAsyncFinish());
55+
}).catch(() => {
56+
dispatch(anotherAsyncFail());
57+
});
58+
};
59+
}
60+
61+
const anotherParentAsyncStart = () => { return { type: 'another-parent-test-action-start' }; };
62+
const anotherParentAsyncFinish = () => { return { type: 'another-parent-test-action-finish' }; };
63+
const anotherParentAsyncFail = () => { return { type: 'another-parent-test-action-fail' }; };
64+
65+
function anotherParentAsyncActionCreator() {
66+
return dispatch => {
67+
dispatch(anotherParentAsyncStart());
68+
return asyncFunction().then(() => {
69+
dispatch(anotherAsyncActionCreator());
70+
dispatch(anotherParentAsyncFinish());
71+
}, () => {
72+
dispatch(anotherParentAsyncFail());
73+
});
74+
};
75+
}
76+
4677
const expectedActions = [
4778
start(),
4879
anotherStart(),
@@ -55,6 +86,19 @@ const expectedParentActions = [
5586
parentFinish()
5687
];
5788

89+
90+
const anotherExpectedActions = [
91+
anotherAsyncStart(),
92+
anotherAsyncFinish()
93+
];
94+
95+
const anotherParentExpectedActions = [
96+
anotherParentAsyncStart(),
97+
anotherAsyncActionCreator(),
98+
anotherParentAsyncFail()
99+
];
100+
101+
58102
export default {
59103
start,
60104
anotherStart,
@@ -68,5 +112,9 @@ export default {
68112
parentFail,
69113
parentAsyncActionCreator,
70114
expectedActions,
71-
expectedParentActions
115+
expectedParentActions,
116+
anotherAsyncActionCreator,
117+
anotherParentAsyncActionCreator,
118+
anotherExpectedActions,
119+
anotherParentExpectedActions
72120
};

0 commit comments

Comments
 (0)