Fix checkBlockCompletion parameters

We were assuming a prop named unitId existed in CoursewareContainer - it doesn’t.  unitId is not in redux.  What we do have, is the unitId in the route params - what we refer to as routeUnitId.  If we use this instead of the non-existent unitId, then life is good.

I wrote a test (that breaks!) prior to implementing the fix.  The fix satisfies the test. 🎉
This commit is contained in:
David Joy
2020-08-12 12:13:46 -04:00
committed by David Joy
parent a975b8ae70
commit cc7142e5c1
3 changed files with 37 additions and 8 deletions

View File

@@ -60,7 +60,11 @@ export default function UnitNavigation(props) {
UnitNavigation.propTypes = {
sequenceId: PropTypes.string.isRequired,
unitId: PropTypes.string.isRequired,
unitId: PropTypes.string,
onClickPrevious: PropTypes.func.isRequired,
onClickNext: PropTypes.func.isRequired,
};
UnitNavigation.defaultProps = {
unitId: null,
};