Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tests): Add unit tests for consumption step no 1 #187

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions packages/client/src/modules/persona/consumption/computing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,13 @@ export const getFossilCarConsumption = (personalization: PersoForm) => {
}

return (
(((carDistanceAlone / DAYS_IN_YEAR +
((carDistanceAlone / DAYS_IN_YEAR +
carDistanceHoushold /
(DAYS_IN_YEAR * ((numberAdults > 0 ? numberAdults : 1) + numberKids))) *
carConsumption) /
100 +
(carConsumption / 100) +
(carDistanceCarsharing * transportCoeffs.MEAN_FOSSIL_CAR_CONSUMPTION) /
DAYS_IN_YEAR) *
10
transportCoeffs.FOSSIL_CAR
Baboo7 marked this conversation as resolved.
Show resolved Hide resolved
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const numericEquipment = {
export const transportCoeffs = {
ELECTRIC_CAR: 0.45,
MEAN_FOSSIL_CAR_CONSUMPTION: 0.07,
FOSSIL_CAR: 10,
TRAIN: 0.133,
PLANE: 0.41,
};
Expand Down
Loading