@@ -4,6 +4,7 @@ import { actionHandler, useRouter } from "@bciers/testConfig/mocks";
44import { dummyNavigationInformation } from "../taskList/utils" ;
55import userEvent from "@testing-library/user-event" ;
66import { EmissionAllocationResponse } from "@reporting/src/app/utils/getEmissionAllocations" ;
7+ import { RegulatedProduct } from "@reporting/src/app/components/operations/types" ;
78
89// ✨ Mocks
910const mockRouterPush = vi . fn ( ) ;
@@ -13,6 +14,27 @@ useRouter.mockReturnValue({
1314 refresh : mockRouterRefresh ,
1415} ) ;
1516
17+ const mockRegulatedProducts : RegulatedProduct [ ] = [
18+ {
19+ id : 1 ,
20+ name : "Product 1" ,
21+ unit : "t" ,
22+ is_regulated : true ,
23+ valid_from : "2023-01-01" ,
24+ valid_to : "2099-01-01" ,
25+ } ,
26+ {
27+ id : 2 ,
28+ name : "Product 2" ,
29+ unit : "t" ,
30+ is_regulated : true ,
31+ valid_from : "2023-01-01" ,
32+ valid_to : "2099-01-01" ,
33+ } ,
34+ ] ;
35+
36+ const mockReportingYear = 2024 ;
37+
1638// 🏷 Constants
1739const config = {
1840 buttons : {
@@ -115,6 +137,8 @@ describe("FacilityEmissionAllocationForm component", () => {
115137 facilityType = ""
116138 isPulpAndPaper = { false }
117139 overlappingIndustrialProcessEmissions = { 0 }
140+ reportingYear = { mockReportingYear }
141+ regulatedProducts = { mockRegulatedProducts }
118142 /> ,
119143 ) ;
120144
@@ -158,6 +182,8 @@ describe("FacilityEmissionAllocationForm component", () => {
158182 isPulpAndPaper = { false }
159183 overlappingIndustrialProcessEmissions = { 0 }
160184 facilityType = { "" }
185+ reportingYear = { mockReportingYear }
186+ regulatedProducts = { mockRegulatedProducts }
161187 /> ,
162188 ) ;
163189 expect (
@@ -177,6 +203,8 @@ describe("FacilityEmissionAllocationForm component", () => {
177203 facilityType = "Large Facility"
178204 isPulpAndPaper = { false }
179205 overlappingIndustrialProcessEmissions = { 0 }
206+ reportingYear = { mockReportingYear }
207+ regulatedProducts = { mockRegulatedProducts }
180208 /> ,
181209 ) ;
182210
@@ -204,6 +232,8 @@ describe("FacilityEmissionAllocationForm component", () => {
204232 facilityType = "Large Facility"
205233 isPulpAndPaper = { false }
206234 overlappingIndustrialProcessEmissions = { 0 }
235+ reportingYear = { mockReportingYear }
236+ regulatedProducts = { mockRegulatedProducts }
207237 /> ,
208238 ) ;
209239 // POST submit and assert the result
@@ -221,6 +251,8 @@ describe("FacilityEmissionAllocationForm component", () => {
221251 facilityType = "Large Facility"
222252 isPulpAndPaper = { false }
223253 overlappingIndustrialProcessEmissions = { 0 }
254+ reportingYear = { mockReportingYear }
255+ regulatedProducts = { mockRegulatedProducts }
224256 /> ,
225257 ) ;
226258
@@ -252,6 +284,8 @@ describe("FacilityEmissionAllocationForm component", () => {
252284 } }
253285 isPulpAndPaper = { false }
254286 overlappingIndustrialProcessEmissions = { 0 }
287+ reportingYear = { mockReportingYear }
288+ regulatedProducts = { mockRegulatedProducts }
255289 /> ,
256290 ) ;
257291
@@ -292,6 +326,8 @@ describe("FacilityEmissionAllocationForm component", () => {
292326 isPulpAndPaper = { false }
293327 overlappingIndustrialProcessEmissions = { 0 }
294328 operationType = "Single Facility Operation"
329+ reportingYear = { mockReportingYear }
330+ regulatedProducts = { mockRegulatedProducts }
295331 /> ,
296332 ) ;
297333
@@ -336,6 +372,8 @@ describe("FacilityEmissionAllocationForm component", () => {
336372 isPulpAndPaper = { false }
337373 overlappingIndustrialProcessEmissions = { 0 }
338374 operationType = "Single Facility Operation"
375+ reportingYear = { mockReportingYear }
376+ regulatedProducts = { mockRegulatedProducts }
339377 /> ,
340378 ) ;
341379
@@ -363,6 +401,8 @@ describe("FacilityEmissionAllocationForm component", () => {
363401 } }
364402 isPulpAndPaper = { false }
365403 overlappingIndustrialProcessEmissions = { 0 }
404+ reportingYear = { mockReportingYear }
405+ regulatedProducts = { mockRegulatedProducts }
366406 /> ,
367407 ) ;
368408
0 commit comments