Skip to content
Snippets Groups Projects
Commit 9213c0a6 authored by Yoan VALLET's avatar Yoan VALLET
Browse files

Merge branch 'features/unit-tests' of...

Merge branch 'features/unit-tests' of https://forge.grandlyon.com/web-et-numerique/llle_project/ecolyo into features/unit-tests
parents b668c858 5c5aedfa
Branches
Tags
1 merge request!139Features/unit tests
......@@ -52,7 +52,18 @@ describe('Consuption service', () => {
},
]
describe('getGraphData method', () => {
it('should return null', async () => {
const result = await consumptionDataManager.getGraphData(
mockTimePeriod,
TimeStep.DAY,
[],
mockTimePeriodComparison,
false
)
expect(result).toBeNull()
})
it('shoud return a mapped data for one fluid', async () => {
console.log(fluidTypes)
mockFetchFluidData.mockResolvedValueOnce(mockFetchDataActual)
mockFetchFluidData.mockResolvedValueOnce(mockFetchDataComparison)
const mockResult = {
......
......@@ -56,7 +56,6 @@ export default class ConsumptionDataManager {
fluidTypes[0],
compareTimePeriod
)
// formatting data
const formattedData = this.formatGraphDataManage(
fetchedData,
......@@ -69,6 +68,7 @@ export default class ConsumptionDataManager {
// mapping result to contract
mappedData = formattedData
return mappedData
} else if (fluidTypes.length > 1 || isHome) {
const toBeAgreggatedData: ISingleFluidChartData[] = []
for (const fluidType of fluidTypes) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment