Skip to content

Commit 2ae61a3

Browse files
authored
NRPT-188-2: QA updates. (#478)
* NRPT-188-2: QA updates. * NRPT-188-2: update api unit tests * NRPT-188-2: update angular unit tests
1 parent f532f20 commit 2ae61a3

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

angular/projects/admin-nrpti/src/app/import/import-csv/import-csv.component.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,17 +475,19 @@ describe('ImportCSVComponent', () => {
475475
const { component } = testBedHelper.createComponent();
476476

477477
const transformedRow: string[] = component.transformDateFields(
478-
['2019/12/30', '12/30/2019'],
478+
['2019/12/30', '12/30/2019', '30-Dec-2019'],
479479
[
480480
{ field: 'headerA', format: 'YYYY/MM/DD' },
481-
{ field: 'headerB', format: 'MM/DD/YYYY' }
481+
{ field: 'headerB', format: 'MM/DD/YYYY' },
482+
{ field: 'headerC', format: 'DD-MMM-YYYY' }
482483
],
483-
['headerA', 'headerB']
484+
['headerA', 'headerB', 'headerC']
484485
);
485486

486-
expect(transformedRow.length).toEqual(2);
487+
expect(transformedRow.length).toEqual(3);
487488
expect(transformedRow[0]).toEqual(moment('2019/12/30', 'YYYY/MM/DD').toISOString());
488489
expect(transformedRow[1]).toEqual(moment('12/30/2019', 'MM/DD/YYYY').toISOString());
490+
expect(transformedRow[2]).toEqual(moment('30-Dec-2019', 'DD-MMM-YYYY').toISOString());
489491
}));
490492
});
491493

angular/projects/admin-nrpti/src/app/utils/constants/csv-constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export class CsvConstants {
130130
* @memberof CsvConstants
131131
*/
132132
public static readonly ogcInspectionCsvRequiredFormats: IRequiredFormat[] = [
133-
{ field: 'Inspection Date', type: 'date', format: 'DD-MMM-YY' }
133+
{ field: 'Inspection Date', type: 'date', format: 'DD-MMM-YYYY' }
134134
];
135135

136136
/**
@@ -141,7 +141,7 @@ export class CsvConstants {
141141
* @memberof CsvConstants
142142
*/
143143
public static readonly ogcInspectionCsvDateFields: IDateField[] = [
144-
{ field: 'Inspection Date', format: 'DD-MMM-YY' }
144+
{ field: 'Inspection Date', format: 'DD-MMM-YYYY' }
145145
];
146146

147147
/**

api/src/importers/bcogc/inspections-utils.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,14 @@ class Inspections extends BaseRecordUtils {
4343
inspection['recordType'] = 'Inspection';
4444
inspection['dateIssued'] = csvRow['inspection date'] || null;
4545
inspection['issuingAgency'] = 'BC Oil and Gas Commission';
46-
inspection['author'] = 'BC Government';
46+
inspection['author'] = 'BC Oil and Gas Commission';
4747

4848
inspection['recordName'] = `Inspection Number ${csvRow['inspection number'] || '-'}`;
4949

5050
inspection['legislation'] = {
5151
act: 'Oil and Gas Activities Act',
5252
section: '57',
53-
subSection: '4',
54-
regulation: CsvUtils.getRegulation(csvRow) || ''
53+
subSection: '4'
5554
};
5655

5756
inspection['issuedTo'] = {

api/src/importers/bcogc/inspections-utils.test.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ describe('transformRecord', () => {
2121
dateIssued: null,
2222
issuedTo: { companyName: '', type: 'Company' },
2323
issuingAgency: 'BC Oil and Gas Commission',
24-
author: 'BC Government',
24+
author: 'BC Oil and Gas Commission',
2525
recordName: 'Inspection Number -',
26-
legislation: { act: 'Oil and Gas Activities Act', regulation: '', section: '57', subSection: '4' },
26+
legislation: { act: 'Oil and Gas Activities Act', section: '57', subSection: '4' },
2727
location: 'British Columbia',
2828
legislationDescription: 'Inspection to verify compliance with regulatory requirement',
2929
description:
@@ -57,11 +57,10 @@ describe('transformRecord', () => {
5757
dateIssued: expect.any(String),
5858
issuedTo: { companyName: 'Coastal GasLink Pipeline Ltd.', type: 'Company' },
5959
issuingAgency: 'BC Oil and Gas Commission',
60-
author: 'BC Government',
60+
author: 'BC Oil and Gas Commission',
6161
recordName: 'Inspection Number 123456',
6262
legislation: {
6363
act: 'Oil and Gas Activities Act',
64-
regulation: 'Oil and Gas activities Act',
6564
section: '57',
6665
subSection: '4'
6766
},

0 commit comments

Comments
 (0)