From 51131414de81c28438e284e78f43a3952f37a659 Mon Sep 17 00:00:00 2001 From: tareq89 Date: Wed, 23 Oct 2024 19:11:00 +0600 Subject: [PATCH] test code related to certTemplateId fixed --- packages/client/src/forms/register/mappings/mutation/utils.ts | 2 +- packages/client/src/tests/schema.graphql | 1 + .../IssueCollectorForm/IssueCollectorForm.tsx | 1 - .../registration/__snapshots__/type-resolvers.test.ts.snap | 3 +++ packages/workflow/src/records/handler/certify.test.ts | 4 ++-- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/client/src/forms/register/mappings/mutation/utils.ts b/packages/client/src/forms/register/mappings/mutation/utils.ts index d49f0bdd158..edd391cf674 100644 --- a/packages/client/src/forms/register/mappings/mutation/utils.ts +++ b/packages/client/src/forms/register/mappings/mutation/utils.ts @@ -10,7 +10,7 @@ */ import type { GQLRelatedPersonInput } from '@client/utils/gateway-deprecated-do-not-use' -import { ICertificate, IFileValue, TransformedData } from '@client/forms' +import { ICertificate, IFileValue } from '@client/forms' import { omit } from 'lodash' export function stripTypename(obj: any): any { diff --git a/packages/client/src/tests/schema.graphql b/packages/client/src/tests/schema.graphql index 0900809bdfe..999cde10f46 100644 --- a/packages/client/src/tests/schema.graphql +++ b/packages/client/src/tests/schema.graphql @@ -772,6 +772,7 @@ type History { system: IntegratedSystem location: Location office: Location + certTemplateId: String dhis2Notification: Boolean comments: [Comment] input: [InputOutput] diff --git a/packages/client/src/views/IssueCertificate/IssueCollectorForm/IssueCollectorForm.tsx b/packages/client/src/views/IssueCertificate/IssueCollectorForm/IssueCollectorForm.tsx index 9a0774042e0..81636b34397 100644 --- a/packages/client/src/views/IssueCertificate/IssueCollectorForm/IssueCollectorForm.tsx +++ b/packages/client/src/views/IssueCertificate/IssueCollectorForm/IssueCollectorForm.tsx @@ -77,7 +77,6 @@ export function IssueCollectorForm({ function continueButtonHandler() { const relationship = declaration.data.registration.certificates[0].collector?.type - const event = declaration.event if (!relationship) return if (relationship === 'OTHER') { dispatch(goToIssueCertificate(declaration.id, 'otherCollector')) diff --git a/packages/gateway/src/features/registration/__snapshots__/type-resolvers.test.ts.snap b/packages/gateway/src/features/registration/__snapshots__/type-resolvers.test.ts.snap index 02451a6d6a3..c39945a204b 100644 --- a/packages/gateway/src/features/registration/__snapshots__/type-resolvers.test.ts.snap +++ b/packages/gateway/src/features/registration/__snapshots__/type-resolvers.test.ts.snap @@ -170,6 +170,7 @@ Object { "foetalDeathsToMother": null, "history": Array [ Object { + "certTemplateId": null, "certificates": Array [ null, ], @@ -655,6 +656,7 @@ Object { "femaleDependentsOfDeceased": 4, "history": Array [ Object { + "certTemplateId": null, "certificates": Array [], "comments": Array [], "date": "2023-09-22T11:52:48.611+00:00", @@ -1203,6 +1205,7 @@ Object { }, "history": Array [ Object { + "certTemplateId": null, "certificates": Array [], "comments": Array [], "date": "2023-09-22T08:54:57.825+00:00", diff --git a/packages/workflow/src/records/handler/certify.test.ts b/packages/workflow/src/records/handler/certify.test.ts index 56a9af5e170..749f20a54c6 100644 --- a/packages/workflow/src/records/handler/certify.test.ts +++ b/packages/workflow/src/records/handler/certify.test.ts @@ -111,7 +111,7 @@ describe('Certify record endpoint', () => { event: 'BIRTH', certificate: { hasShowedVerifiedDocument: true, - data: 'data:application/pdf;base64,AXDWYZ', + certTemplateId: 'birth-certificate', collector: { relationship: 'INFORMANT' } @@ -215,7 +215,7 @@ describe('Certify record endpoint', () => { event: 'BIRTH', certificate: { hasShowedVerifiedDocument: true, - data: 'data:application/pdf;base64,AXDWYZ', + certTemplateId: 'birth-certificate', collector: { relationship: 'Other', otherRelationship: 'Uncle',