@@ -29,26 +29,29 @@ describe('transformRecord', () => {
29
29
outcomeDescription : '' ,
30
30
sourceSystemRef : 'agri-cmdb-csv' ,
31
31
issuingAgency : 'Ministry of Agriculture Food and Fisheries' ,
32
- legislation : {
33
- act : 'Fish and Seafood Act' ,
34
- section : 22
35
- } ,
36
- legislationDescription : descriptionString ,
32
+ legislation : [
33
+ {
34
+ act : 'Fish and Seafood Act' ,
35
+ section : 22 ,
36
+ legislationDescription : descriptionString
37
+ }
38
+ ] ,
37
39
location : null ,
38
- recordName : '' ,
40
+ recordName : ''
39
41
} ) ;
40
42
} ) ;
41
43
42
44
it ( 'transforms csv row fields into NRPTI record fields' , ( ) => {
43
- const result = inspections . transformRecord ( {
44
- 'company name' : 'Company 5' ,
45
- 'date issued' : '10-07-20' ,
46
- 'inspection id' : '1303' ,
47
- 'inspection type' : 'Higher Risk Inspection' ,
48
- 'location' :'Test Region' ,
49
- 'regulation section' : 'FSLR-s.34'
50
- } ,
51
- 'Compliance issue(s) identified under the following acts or regulations: FSLR-s.34'
45
+ const result = inspections . transformRecord (
46
+ {
47
+ 'company name' : 'Company 5' ,
48
+ 'date issued' : '10-07-20' ,
49
+ 'inspection id' : '1303' ,
50
+ 'inspection type' : 'Higher Risk Inspection' ,
51
+ location : 'Test Region' ,
52
+ 'regulation section' : 'FSLR-s.34'
53
+ } ,
54
+ 'Compliance issue(s) identified under the following acts or regulations: FSLR-s.34'
52
55
) ;
53
56
54
57
expect ( result ) . toEqual ( {
@@ -65,11 +68,13 @@ describe('transformRecord', () => {
65
68
type : MiscConstants . IssuedToEntityTypes . Company
66
69
} ,
67
70
issuingAgency : 'Ministry of Agriculture Food and Fisheries' ,
68
- legislation : {
69
- act : 'Fish and Seafood Act' ,
70
- section : 22
71
- } ,
72
- legislationDescription : descriptionString ,
71
+ legislation : [
72
+ {
73
+ act : 'Fish and Seafood Act' ,
74
+ section : 22 ,
75
+ legislationDescription : descriptionString
76
+ }
77
+ ] ,
73
78
location : 'Test Region' ,
74
79
outcomeDescription : 'Compliance issue(s) identified under the following acts or regulations: FSLR-s.34' ,
75
80
0 commit comments