Skip to content

Commit

Permalink
Add screenwrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
tgolen committed Dec 27, 2023
1 parent c744ec1 commit 9d960f3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/pages/iou/request/IOURequestRedirectToStartPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import PropTypes from 'prop-types';
import React, {useEffect} from 'react';
import _ from 'underscore';
import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView';
import ScreenWrapper from '@components/ScreenWrapper';
import Navigation from '@libs/Navigation/Navigation';
import * as ReportUtils from '@libs/ReportUtils';
import CONST from '@src/CONST';
Expand All @@ -26,8 +27,8 @@ function IOURequestRedirectToStartPage({
params: {iouType, iouRequestType},
},
}) {
const isIouTypeValid = _.values(CONST.IOU.TYPE).indexOf(iouType) > -1;
const isIouRequestTypeValid = _.values(CONST.IOU.REQUEST_TYPE).indexOf(iouRequestType) > -1;
const isIouTypeValid = _.values(CONST.IOU.TYPE).includes(iouType);
const isIouRequestTypeValid = _.values(CONST.IOU.REQUEST_TYPE).includes(iouRequestType);

useEffect(() => {
if (!isIouTypeValid || !isIouRequestTypeValid) {
Expand All @@ -52,7 +53,11 @@ function IOURequestRedirectToStartPage({
}, []);

if (!isIouTypeValid || !isIouRequestTypeValid) {
return <FullPageNotFoundView shouldShow />;
return (
<ScreenWrapper testID={IOURequestRedirectToStartPage.displayName}>
<FullPageNotFoundView shouldShow />
</ScreenWrapper>
);
}

return null;
Expand Down

0 comments on commit 9d960f3

Please sign in to comment.