Skip to content

Commit

Permalink
PRMDR-436 UI RBACS Test Coverage (#141)
Browse files Browse the repository at this point in the history
Add RBACS test coverage for role based components
  • Loading branch information
RioKnightleyNHS authored Nov 9, 2023
1 parent 2d87145 commit 4f1eb92
Show file tree
Hide file tree
Showing 21 changed files with 801 additions and 463 deletions.
55 changes: 17 additions & 38 deletions app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import UploadDocumentsPage from './pages/uploadDocumentsPage/UploadDocumentsPage
import DocumentSearchResultsPage from './pages/documentSearchResultsPage/DocumentSearchResultsPage';
import AuthErrorPage from './pages/authErrorPage/AuthErrorPage';
import LloydGeorgeRecordPage from './pages/lloydGeorgeRecordPage/LloydGeorgeRecordPage';
import { REPOSITORY_ROLE } from './types/generic/authRole';

function App() {
return (
Expand All @@ -45,22 +44,15 @@ function App() {
</AuthGuard>
}
>
<Route
element={<PatientSearchPage role={REPOSITORY_ROLE.PCSE} />}
path={routes.DOWNLOAD_SEARCH}
/>
<Route
element={
<PatientSearchPage role={REPOSITORY_ROLE.GP_ADMIN} />
}
path={routes.UPLOAD_SEARCH}
/>
<Route
element={
<PatientSearchPage role={REPOSITORY_ROLE.GP_CLINICAL} />
}
path={routes.UPLOAD_SEARCH}
/>
{[routes.DOWNLOAD_SEARCH, routes.UPLOAD_SEARCH].map(
(searchRoute) => (
<Route
key={searchRoute}
element={<PatientSearchPage />}
path={searchRoute}
/>
),
)}

<Route element={<LogoutPage />} path={routes.LOGOUT} />
<Route
Expand All @@ -70,28 +62,15 @@ function App() {
</PatientGuard>
}
>
<Route
element={
<PatientResultPage role={REPOSITORY_ROLE.PCSE} />
}
path={routes.DOWNLOAD_VERIFY}
/>
<Route
element={
<PatientResultPage
role={REPOSITORY_ROLE.GP_ADMIN}
{[routes.DOWNLOAD_VERIFY, routes.UPLOAD_VERIFY].map(
(searchResultRoute) => (
<Route
key={searchResultRoute}
element={<PatientResultPage />}
path={searchResultRoute}
/>
}
path={routes.UPLOAD_VERIFY}
/>
<Route
element={
<PatientResultPage
role={REPOSITORY_ROLE.GP_CLINICAL}
/>
}
path={routes.UPLOAD_VERIFY}
/>
),
)}
<Route
element={<LloydGeorgeRecordPage />}
path={routes.LLOYD_GEORGE}
Expand Down
Loading

0 comments on commit 4f1eb92

Please sign in to comment.