Skip to content

Commit

Permalink
chore: update left over test
Browse files Browse the repository at this point in the history
  • Loading branch information
leangseu-edx committed Jan 31, 2024
1 parent e81b84d commit bb3e439
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
16 changes: 5 additions & 11 deletions src/hooks/actions/useLoadNextAction.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import React from 'react';
import { useIntl } from '@edx/frontend-platform/i18n';

import {
usePageDataStatus,
useRefreshPageData,
useStepInfo,
} from 'hooks/app';
import { usePageDataStatus, useRefreshPageData, useStepInfo } from 'hooks/app';
import { useResetAssessment } from 'hooks/assessment';
import { useEffectiveStep } from 'hooks/routing';
import { useIsMounted } from 'hooks/utils';
Expand All @@ -22,16 +18,14 @@ export default () => {
const stepInfo = useStepInfo();
const step = useEffectiveStep();
if (
!(
step === stepNames.studentTraining
|| (step === stepNames.peer)
|| (step === stepNames.peer && !stepInfo.peer?.isWaitingForSubmissions)
)
![stepNames.studentTraining, stepNames.peer].includes(step) ||

Check failure on line 21 in src/hooks/actions/useLoadNextAction.js

View workflow job for this annotation

GitHub Actions / test

'||' should be placed at the beginning of the line
(step === stepNames.peer && stepInfo.peer?.isWaitingForSubmissions)
) {
return null;
}

const label = (message) => `${formatMessage(message)} ${formatMessage(loadNextSteps[step])}`;
const label = (message) =>
`${formatMessage(message)} ${formatMessage(loadNextSteps[step])}`;

Check failure on line 28 in src/hooks/actions/useLoadNextAction.js

View workflow job for this annotation

GitHub Actions / test

Expected no linebreak before this expression

return {
action: {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Object.assign(hooks, {
useEffectiveStep: () => {
const viewStep = hooks.useViewStep();
const activeStep = useActiveStepName();
return hooks.isXblockStep(isXblockStep) ? activeStep : viewStep;
return hooks.isXblockStep(viewStep) ? activeStep : viewStep;
},
});
export const {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"components": ["components/*"],
"constants": ["constants/*"],
"views": ["views/*"],
"utils": ["utils/*"]
"utils": ["utils/*"],
"hooks": ["hooks/*"],
}
},
"include": ["src"],
Expand Down

0 comments on commit bb3e439

Please sign in to comment.