diff --git a/src/client/pages/GarbageInformation/GarbageInformation.test.tsx b/src/client/pages/GarbageInformation/GarbageInformation.test.tsx index 7e61eaa34..8664a4895 100644 --- a/src/client/pages/GarbageInformation/GarbageInformation.test.tsx +++ b/src/client/pages/GarbageInformation/GarbageInformation.test.tsx @@ -8,6 +8,7 @@ import { jsonCopy } from '../../../universal/helpers/utils'; import { appStateAtom } from '../../hooks/useAppState'; import MockApp from '../MockApp'; import GarbageInformation from './GarbageInformation'; +import { AppState } from '../../../universal/types'; //const { BRP, AFVAL, AFVALPUNTEN, MY_LOCATION } = useAppStateGetter(); @@ -21,7 +22,7 @@ const afvalpunt = { website: 'http://example.org/afvalpunt', }; -const testState: any = { +const testState = { BRP: { status: 'OK', content: { @@ -117,7 +118,7 @@ const testState: any = { fractieCode: 'Textiel', }, ], - }, + } as unknown as AppState, AFVALPUNTEN: { status: 'OK', content: { centers: [afvalpunt] } }, MY_LOCATION: { status: 'OK', @@ -157,14 +158,16 @@ describe('', () => { const routeEntry = generatePath(AppRoutes.AFVAL); const routePath = AppRoutes.AFVAL; - const Component = () => ( - initializeState(snapshot)} - /> - ); + function Component() { + return ( + initializeState(snapshot)} + /> + ); + } it('Matches the Full Page snapshot', () => { const { asFragment } = render(); @@ -176,14 +179,16 @@ describe('', () => { testState2.MY_LOCATION.content[1].bagNummeraanduidingId = testState2.MY_LOCATION.content[0].bagNummeraanduidingId; - const Component = () => ( - initializeState(snapshot, testState2)} - /> - ); + function Component() { + return ( + initializeState(snapshot, testState2)} + /> + ); + } const { asFragment } = render(); expect(asFragment()).toMatchSnapshot(); @@ -198,32 +203,16 @@ describe('', () => { }) ); - const Component = () => ( - initializeState(snapshot, testState2)} - /> - ); - - const { asFragment } = render(); - expect(asFragment()).toMatchSnapshot(); - }); - - test('Full page snapshot for Weesp address', () => { - const weespState = jsonCopy(testState); - weespState.BRP.content.persoon.mokum = false; - weespState.MY_LOCATION.content[0].address.woonplaatsNaam = 'Weesp'; - - const Component = () => ( - initializeState(snapshot, weespState)} - /> - ); + function Component() { + return ( + initializeState(snapshot, testState2)} + /> + ); + } const { asFragment } = render(); expect(asFragment()).toMatchSnapshot();