Skip to content

Commit

Permalink
Add bewoners/bedrijven conditionally for Parkeren (#1683)
Browse files Browse the repository at this point in the history
  • Loading branch information
OscarBakker authored Dec 19, 2024
1 parent aaaf8ee commit 5a5bccc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
16 changes: 12 additions & 4 deletions src/client/pages/Parkeren/Parkeren.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ describe('Parkeren', () => {
);
}

function initializeState(snapshot: MutableSnapshot) {
snapshot.set(appStateAtom, testState);
}
beforeAll(() => {
window.scrollTo = vi.fn();
});
Expand Down Expand Up @@ -80,7 +77,14 @@ describe('determinePageContentTop', () => {

test('Renders button with parkeer vergunningen', () => {
const PageContentTop = determinePageContentTop(true, EXTERNAL_PARKEREN_URL);
const screen = render(<PageContentTop />);
const screen = render(
<MockApp
routeEntry="/"
routePath="/"
component={PageContentTop}
initializeState={initializeState}
/>
);
expect(screen.queryByText(linkButtonTxt)).toBeInTheDocument();
});

Expand All @@ -94,6 +98,10 @@ describe('determinePageContentTop', () => {
});
});

function initializeState(snapshot: MutableSnapshot) {
snapshot.set(appStateAtom, testState);
}

const testState = {
PARKEREN: {
content: {
Expand Down
15 changes: 12 additions & 3 deletions src/client/pages/Parkeren/Parkeren.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { VergunningFrontendV2 } from '../../../server/services/vergunningen-v2/c
import { AppRoutes } from '../../../universal/config/routes';
import { MaButtonLink } from '../../components/MaLink/MaLink';
import { ThemaTitles } from '../../config/thema';
import { useProfileTypeValue } from '../../hooks/useProfileType';
import ThemaPagina from '../ThemaPagina/ThemaPagina';
import ThemaPaginaTable from '../ThemaPagina/ThemaPaginaTable';

Expand Down Expand Up @@ -63,12 +64,20 @@ function determinePageContentTop(
parkerenUrlSSO: string
) {
if (hasMijnParkerenVergunningen) {
const profileType = useProfileTypeValue();

const profileTypeLabel =
profileType === 'commercial' ? 'bedrijven' : 'bewoners';

return (
<>
<Alert severity="info" heading="Parkeervergunning voor bewoners">
<Alert
severity="info"
heading={`Parkeervergunning voor ${profileTypeLabel}`}
>
<Paragraph>
Het inzien, aanvragen of wijzigen van een parkeervergunning voor
bewoners kan via Mijn Parkeren.
Het inzien, aanvragen of wijzigen van een parkeervergunning voor{' '}
{profileTypeLabel} kan via Mijn Parkeren.
</Paragraph>
<Paragraph>
<MaButtonLink href={parkerenUrlSSO}>
Expand Down

0 comments on commit 5a5bccc

Please sign in to comment.