Skip to content

Commit 9497cd7

Browse files
fjoswrickstaa
authored andcommitted
Missing term in calculation of TOTAL_VALUES. (anuraghazra#2116)
* 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 <[email protected]>
1 parent 653de7c commit 9497cd7

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

Diff for: src/calculateRank.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ function calculateRank({
7070
const RANK_B_VALUE = 100;
7171

7272
const TOTAL_VALUES =
73-
RANK_S_VALUE + RANK_A2_VALUE + RANK_A3_VALUE + RANK_B_VALUE;
73+
RANK_S_VALUE +
74+
RANK_DOUBLE_A_VALUE +
75+
RANK_A2_VALUE +
76+
RANK_A3_VALUE +
77+
RANK_B_VALUE;
7478

7579
// prettier-ignore
7680
const score = (

Diff for: tests/calculateRank.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ describe("Test calculateRank", () => {
1313
prs: 300,
1414
issues: 200,
1515
}),
16-
).toStrictEqual({ level: "A+", score: 49.16605417270399 });
16+
).toStrictEqual({ level: "A+", score: 49.25629684876535 });
1717
});
1818
});

Diff for: tests/e2e/e2e.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const STATS_DATA = {
2222
contributedTo: 2,
2323
rank: {
2424
level: "A+",
25-
score: 51.01013099671447,
25+
score: 50.900829325065935,
2626
},
2727
};
2828

0 commit comments

Comments
 (0)