* Add test for fetchCourse * Add tests for fetchDatesTab, fetchOutlineTab, fetchSequence and resetDeadlines * Implement fetch tabs tests * Add fail test case for fetchSequence * Add success test for fetchSequence * Add test for resetDeadlines * Update test group name * Add empty tests for courseware and bookmarks * Fix wrong field in saveSequencePosition thunk * Add tests for courseware data layer * Temporary commit * Split tests after rebase * Revert "Fix wrong field in saveSequencePosition thunk" This reverts commit 4394d363c58ad929f81e587ce4da2241528494b5. * Fix test for position * Move executeThunk into utils * Add test for all reducers * Add expect statements for logs * Remove redundant snapshot tests and add some specific checks * Polishing * Remove redundant checks * Fix bug in normalizer and update test * Upgrade @edx/frontend-platform dependency * Utilize MockAuthService instead of manual auth package mocking * Update tests after breaking changes in master * Remove redundant snapshot check
9 lines
271 B
JavaScript
9 lines
271 B
JavaScript
// Helper, that is used to forcibly finalize all promises
|
|
// in thunk before running matcher against state.
|
|
const executeThunk = async (thunk, dispatch, getState) => {
|
|
await thunk(dispatch, getState);
|
|
await new Promise(setImmediate);
|
|
};
|
|
|
|
export default executeThunk;
|