Skip to content

Commit

Permalink
Missing term in calculation of TOTAL_VALUES. (anuraghazra#2116)
Browse files Browse the repository at this point in the history
* fix: added missing term in calculation of TOTAL_VALUES.

* fix: fix rank test

* refactor: update code formatting

* refactor: update code formatting

Co-authored-by: rickstaa <rick.staa@outlook.com>
  • Loading branch information
2 people authored and devantler committed May 1, 2023
1 parent 653de7c commit 9497cd7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/calculateRank.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ function calculateRank({
const RANK_B_VALUE = 100;

const TOTAL_VALUES =
RANK_S_VALUE + RANK_A2_VALUE + RANK_A3_VALUE + RANK_B_VALUE;
RANK_S_VALUE +
RANK_DOUBLE_A_VALUE +
RANK_A2_VALUE +
RANK_A3_VALUE +
RANK_B_VALUE;

// prettier-ignore
const score = (
Expand Down
2 changes: 1 addition & 1 deletion tests/calculateRank.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ describe("Test calculateRank", () => {
prs: 300,
issues: 200,
}),
).toStrictEqual({ level: "A+", score: 49.16605417270399 });
).toStrictEqual({ level: "A+", score: 49.25629684876535 });
});
});
2 changes: 1 addition & 1 deletion tests/e2e/e2e.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const STATS_DATA = {
contributedTo: 2,
rank: {
level: "A+",
score: 51.01013099671447,
score: 50.900829325065935,
},
};

Expand Down

0 comments on commit 9497cd7

Please sign in to comment.