Skip to content

Commit cd123b8

Browse files
committed
chore: update test to provide more coverage
1 parent 901c97d commit cd123b8

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

app/tests/pages/applicantportal/form/[id]/rfi/[applicantRfiId].test.tsx

+19-4
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ describe('The applicantRfiId Page', () => {
589589
finalEligibleHouseholds: 4,
590590
};
591591
const mockFetchPromiseTemplateOne = Promise.resolve({
592-
ok: false,
592+
ok: true,
593593
status: 200,
594594
json: () => Promise.resolve({ result: mockSuccessResponseTemplateOne }),
595595
});
@@ -599,7 +599,7 @@ describe('The applicantRfiId Page', () => {
599599
totalProjectCosts: 101230,
600600
};
601601
const mockFetchPromiseTemplateTwo = Promise.resolve({
602-
ok: false,
602+
ok: true,
603603
status: 200,
604604
json: () => Promise.resolve({ result: mockSuccessResponseTemplateTwo }),
605605
});
@@ -681,7 +681,7 @@ describe('The applicantRfiId Page', () => {
681681
});
682682
});
683683

684-
expect(global.fetch).toHaveBeenCalledTimes(5);
684+
expect(global.fetch).toHaveBeenCalledTimes(3);
685685
expect(global.fetch).toHaveBeenCalledWith(
686686
'/api/applicant/template?templateNumber=1',
687687
{ body: expect.any(FormData), method: 'POST' }
@@ -702,7 +702,7 @@ describe('The applicantRfiId Page', () => {
702702
});
703703

704704
pageTestingHelper.expectMutationToBeCalled(
705-
'updateRfiAndCreateTemplateNineDataMutation',
705+
'updateFormRfiAndCreateTemplateNineDataMutation',
706706
{
707707
rfiInput: {
708708
jsonData: {
@@ -773,6 +773,21 @@ describe('The applicantRfiId Page', () => {
773773
},
774774
_errors: [],
775775
},
776+
formInput: {
777+
applicationRowId: 1,
778+
jsonData: {
779+
benefits: {
780+
householdsImpactedIndigenous: 60,
781+
numberOfHouseholds: 4,
782+
},
783+
budgetDetails: {
784+
totalEligibleCosts: 92455,
785+
totalProjectCost: 101230,
786+
},
787+
},
788+
reasonForChange: 'Auto updated from upload for RFI: CCBC-01001-01',
789+
formSchemaId: 'test',
790+
},
776791
}
777792
);
778793
});

0 commit comments

Comments
 (0)