Skip to content

Commit c8146e8

Browse files
committed
fixes Type output format
1 parent 51f7cbc commit c8146e8

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

lib/documentProcessor.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ it('Expect AZ diver license to be detected and processed', async () => {
3535
const response = processDocument(ocr.keyValues, ocr.rawText);
3636

3737
expect(response.found).toBe(true);
38-
expect(response.documentType).toBe('AZDL');
38+
expect(response.documentType).toBe('Arizona\'s Driver License');
3939
expect(response.extracted.first_name).toBe('SAMPLE');
4040
expect(response.extracted.last_name).toBe('JELANI');
4141
expect(response.extracted.street_address_line_1).toBe('123 MAIN ST');
@@ -73,7 +73,7 @@ it('Expect SOUTHWESTGAS bill to be detected and processed', async () => {
7373
const response = await inputFromFile(`${__dirname}/../_samples/textract_output_southwest_gas_bill.json`);
7474

7575
expect(response.found).toBe(true);
76-
expect(response.documentType).toBe('SOUTHWESTGAS');
76+
expect(response.documentType).toBe('Southwest Gas');
7777
expect(response.extracted.first_name).toBe('CHARLES');
7878
expect(response.extracted.last_name).toBe('DOE');
7979
expect(response.extracted.street_address_line_1).toBe('2561 W ARCADIA LN 85310');
@@ -90,7 +90,7 @@ it('Expect CITYOFPHOENIXWATER bill to be detected and processed', async () => {
9090
const response = await inputFromFile(`${__dirname}/../_samples/textract_output_city_of_phoenix_water_bill.json`);
9191

9292
expect(response.found).toBe(true);
93-
expect(response.documentType).toBe('CITYOFPHOENIXWATER');
93+
expect(response.documentType).toBe('City of Phoenix Water');
9494
expect(response.extracted.first_name).toBe('MARY A');
9595
expect(response.extracted.last_name).toBe('GREGORY');
9696
expect(response.extracted.street_address_line_1).toBe('2560 E FIFTH AVE');

lib/documentTypes/arizonaDriverLicense.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable camelcase */
22
module.exports = {
33

4-
name: 'AZDL',
4+
name: 'Arizona\'s Driver License',
55

66
matcher: (keyValues, rawText) => {
77
const tests = [

lib/documentTypes/cityOfPhoenixWaterBill.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const moment = require('moment');
33

44
module.exports = {
55

6-
name: 'CITYOFPHOENIXWATER',
6+
name: 'City of Phoenix Water',
77

88
matcher: (keyValues, rawText) => {
99
const tests = [

lib/documentTypes/southwestGasBill.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const moment = require('moment');
33

44
module.exports = {
55

6-
name: 'SOUTHWESTGAS',
6+
name: 'Southwest Gas',
77

88
matcher: (keyValues, rawText) => {
99
const tests = [

lib/validatedNormalizator.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const { normalizer: southwestGasNormalizer } = require('./documentTypes/southwes
77

88
it('Expect AZ diver license data to be normalized', async () => {
99
const validated = {
10-
type: 'AZDL',
10+
type: 'Arizona\'s Driver License',
1111
first_name: 'SAMPLE',
1212
last_name: 'JELANI',
1313
street_address_line_1: '123 MAIN ST',
@@ -19,7 +19,7 @@ it('Expect AZ diver license data to be normalized', async () => {
1919

2020
const response = normalizeValidated(validated);
2121

22-
expect(response['Type']).toBe('AZDL');
22+
expect(response['Type']).toBe('Arizona\'s Driver License');
2323
expect(response['First Name']).toBe('SAMPLE');
2424
expect(response['Last Name']).toBe('JELANI');
2525
expect(response['Street Address Line 1']).toBe('123 MAIN ST');
@@ -93,7 +93,7 @@ it('Expect APS bill data to be normalized', async () => {
9393

9494
it('Expect CITYOFPHOENIXWATER bill data to be normalized', async () => {
9595
const validated = {
96-
type: 'CITYOFPHOENIXWATER',
96+
type: 'City of Phoenix Water',
9797
first_name: 'MARY A',
9898
last_name: 'GREGORY',
9999
street_address_line_1: '2560 E FIFTH AVE',
@@ -109,7 +109,7 @@ it('Expect CITYOFPHOENIXWATER bill data to be normalized', async () => {
109109
};
110110

111111
const response = normalizeValidated(validated, cityOfPhoenixNormalizer);
112-
expect(response['Type']).toBe('CITYOFPHOENIXWATER');
112+
expect(response['Type']).toBe('City of Phoenix Water');
113113
expect(response['First Name']).toBe('MARY A');
114114
expect(response['Last Name']).toBe('GREGORY');
115115
expect(response['Street Address Line 1']).toBe('2560 E FIFTH AVE');
@@ -125,7 +125,7 @@ it('Expect CITYOFPHOENIXWATER bill data to be normalized', async () => {
125125

126126
it('Expect SOUTHWESTGAS bill data to be normalized', async () => {
127127
const validated = {
128-
type: 'SOUTHWESTGAS',
128+
type: 'Southwest Gas',
129129
first_name: 'CHARLES',
130130
last_name: 'DOE',
131131
street_address_line_1: '2561 W ARCADIA LN 85310',
@@ -141,7 +141,7 @@ it('Expect SOUTHWESTGAS bill data to be normalized', async () => {
141141
};
142142

143143
const response = normalizeValidated(validated, southwestGasNormalizer);
144-
expect(response['Type']).toBe('SOUTHWESTGAS');
144+
expect(response['Type']).toBe('Southwest Gas');
145145
expect(response['First Name']).toBe('CHARLES');
146146
expect(response['Last Name']).toBe('DOE');
147147
expect(response['Street Address Line 1']).toBe('2561 W ARCADIA LN 85310');

0 commit comments

Comments
 (0)