From 3b058c38573fb253ed005e8a553dc149fbb673f6 Mon Sep 17 00:00:00 2001 From: Muhammed Tareq Aziz Date: Wed, 9 Oct 2024 06:49:42 +0600 Subject: [PATCH] CollectorForm test fixed for certified copies --- .../collectorForm/CollectorForm.test.tsx | 14 +++++++------- .../collectorForm/CollectorForm.tsx | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/client/src/views/PrintCertificate/collectorForm/CollectorForm.test.tsx b/packages/client/src/views/PrintCertificate/collectorForm/CollectorForm.test.tsx index 32b2dbf018..c2325c3583 100644 --- a/packages/client/src/views/PrintCertificate/collectorForm/CollectorForm.test.tsx +++ b/packages/client/src/views/PrintCertificate/collectorForm/CollectorForm.test.tsx @@ -229,7 +229,7 @@ describe('Certificate collector test for a birth registration without father det }) component.update() expect(history.location.pathname).toBe( - '/print/check/6a5fd35d-01ec-4c37-976e-e055107a74a1/birth/father' + '/print/check/6a5fd35d-01ec-4c37-976e-e055107a74a1/birth-certificate/father' ) }) @@ -270,7 +270,7 @@ describe('Certificate collector test for a birth registration without father det }) component.update() expect(history.location.pathname).toBe( - '/cert/collector/6a5fd35d-01ec-4c37-976e-e055107a74a1/birth/otherCertCollector' + '/cert/collector/6a5fd35d-01ec-4c37-976e-e055107a74a1/birth-certificate/otherCertCollector' ) }) }) @@ -387,7 +387,7 @@ describe('Certificate collector test for a birth registration without father det }) it('takes the user to affedavit view', async () => { expect(history.location.pathname).toBe( - '/cert/collector/6a5fd35d-01ec-4c37-976e-e055107a74a1/birth/affidavit' + '/cert/collector/6a5fd35d-01ec-4c37-976e-e055107a74a1/birth-certificate/affidavit' ) }) @@ -439,7 +439,7 @@ describe('Certificate collector test for a birth registration without father det component.find('#submit_confirm').hostNodes().simulate('click') expect(history.location.pathname).toBe( - '/print/payment/6a5fd35d-01ec-4c37-976e-e055107a74a1/birth' + '/print/payment/6a5fd35d-01ec-4c37-976e-e055107a74a1/birth-certificate' ) }) @@ -464,7 +464,7 @@ describe('Certificate collector test for a birth registration without father det ).toHaveLength(1) component.find('#submit_confirm').hostNodes().simulate('click') expect(history.location.pathname).toBe( - '/review/6a5fd35d-01ec-4c37-976e-e055107a74a1/birth' + '/review/6a5fd35d-01ec-4c37-976e-e055107a74a1/birth-certificate' ) }) @@ -575,7 +575,7 @@ describe('Certificate collector test for a death registration', () => { $confirm.hostNodes().simulate('click') expect(history.location.pathname).toBe( - '/review/16ff35e1-3f92-4db3-b812-c402e609fb00/death' + '/review/16ff35e1-3f92-4db3-b812-c402e609fb00/death-certificate' ) }) }) @@ -632,7 +632,7 @@ describe('Certificate collector test for a marriage registration', () => { $confirm.hostNodes().simulate('click') expect(history.location.pathname).toBe( - '/review/18ff35e1-3d92-4db3-b815-c4d2e609fb23/marriage' + '/review/18ff35e1-3d92-4db3-b815-c4d2e609fb23/marriage-certificate' ) }) }) diff --git a/packages/client/src/views/PrintCertificate/collectorForm/CollectorForm.tsx b/packages/client/src/views/PrintCertificate/collectorForm/CollectorForm.tsx index b680f0cba9..3b09790061 100644 --- a/packages/client/src/views/PrintCertificate/collectorForm/CollectorForm.tsx +++ b/packages/client/src/views/PrintCertificate/collectorForm/CollectorForm.tsx @@ -261,7 +261,7 @@ class CollectorFormComponent extends React.Component { this.setState({ ...this.state, - certTemplateId: collector.certTemplateId as string + certTemplateId: collector?.certTemplateId as string }) if (errLength > 0) { this.setState({ @@ -310,19 +310,19 @@ class CollectorFormComponent extends React.Component { if (isCertificateForPrintInAdvance(draft)) { this.props.goToReviewCertificate( declarationId, - collector.certTemplateId as string + collector?.certTemplateId as string ) } else { this.props.goToVerifyCollector( declarationId, - collector.certTemplateId as string, + collector?.certTemplateId as string, collector.type as string ) } } else { this.props.goToPrintCertificate( declarationId, - collector.certTemplateId as string, + collector?.certTemplateId as string, nextGroup ) }