Skip to content
This repository was archived by the owner on Feb 19, 2024. It is now read-only.

Commit f11640a

Browse files
ciremusyokakahummer
authored andcommitted
modified aggregateFormData test
1 parent 6e4f65b commit f11640a

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

test/connectors/aggregateFormData.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ import { aggregateLayerOutput1, aggregateLayerOutput2 } from '../fixtures/output
55

66
describe('aggregateFormData', () => {
77
test('should return correct aggregated data', () => {
8-
expect(aggregateFormData(aggregateLayerInput, {}, undefined, undefined)).toEqual(aggregateLayerOutput1)
8+
const output = aggregateFormData(aggregateLayerInput, {}, undefined, undefined);
9+
delete output.features[0].properties.disaggregatedData[0]["period-date"];
10+
expect(output).toEqual(aggregateLayerOutput1)
911
})
1012
})
1113

1214
describe('processFormData', () => {
1315
test('should return correct processed data', () => {
14-
expect(processFormData(aggregateLayerInput.mergedData, aggregateLayerInput)).toEqual(aggregateLayerOutput1)
16+
const output = processFormData(aggregateLayerInput.mergedData, aggregateLayerInput)
17+
delete output.features[0].properties.disaggregatedData[0]["period-date"]
18+
expect(output).toEqual(aggregateLayerOutput1)
1519
})
1620

1721
test('should return correct processed data if aggragation has isUsingaday parameter', () => {

test/fixtures/outputs/aggregateLayer-output.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ export const aggregateLayerOutput1 = {
130130
"total_screened_muac_oedema": "3701",
131131
"submission/reporting_period": "September 6 to September 19",
132132
"total_boysscreened_muac_oedema": "1888",
133-
"total_girlsscreened_muac_oedema": "1813",
134-
"period-date": new Date("2001-09-05T21:00:00.000Z")
133+
"total_girlsscreened_muac_oedema": "1813"
135134
}
136135
]
137136
},

0 commit comments

Comments
 (0)