Skip to content

Commit

Permalink
fix(app): fix a logic error that prevented recovery from running (#15583
Browse files Browse the repository at this point in the history
)

#15560 introduced a logic bug that prevented ER from launching on ODD,
this fixes it.
  • Loading branch information
sfoster1 committed Jul 5, 2024
1 parent bfd1f9e commit f756e90
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/src/organisms/ErrorRecoveryFlows/RunPausedSplash.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function useRunPausedSplash(
showERWizard: boolean
): boolean {
// Don't show the splash when desktop ER wizard is active.
return !(!isOnDevice && showERWizard)
return isOnDevice && !showERWizard
}

type RunPausedSplashProps = ERUtilsResults & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,20 @@ describe('useRunPausedSplash', () => {
)
})

it('returns true if on the ODD', () => {
const { result } = renderHook(() => useRunPausedSplash(true, true), {
wrapper,
const IS_WIZARD_SHOWN = [false, true]
IS_WIZARD_SHOWN.forEach(val => {
it(`returns ${!val} if on the ODD and showERWizard is ${val}`, () => {
const { result } = renderHook(() => useRunPausedSplash(true, val), {
wrapper,
})
expect(result.current).toEqual(!val)
})
it(`always returns false if on desktop and showERWizard is ${val}`, () => {
const { result } = renderHook(() => useRunPausedSplash(false, val), {
wrapper,
})
expect(result.current).toEqual(false)
})
expect(result.current).toEqual(true)
})
})

Expand Down

0 comments on commit f756e90

Please sign in to comment.