mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-12 06:27:10 +03:00
assert fixed value
This commit is contained in:
@@ -118,7 +118,6 @@ describe("reputation", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("user with high downvote ratio", async () => {
|
it("user with high downvote ratio", async () => {
|
||||||
// -2.125
|
|
||||||
const metrics = {
|
const metrics = {
|
||||||
totalSubmissions: 8,
|
totalSubmissions: 8,
|
||||||
downvotedSubmissions: 5,
|
downvotedSubmissions: 5,
|
||||||
@@ -131,10 +130,10 @@ describe("reputation", () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
assert.strictEqual(await getReputation(getHash(userIDHighDownvotes)), calculateReputationFromMetrics(metrics));
|
assert.strictEqual(await getReputation(getHash(userIDHighDownvotes)), calculateReputationFromMetrics(metrics));
|
||||||
|
assert.strictEqual(await getReputation(getHash(userIDHighDownvotes)), -2.125);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("user with high non self downvote ratio", async () => {
|
it("user with high non self downvote ratio", async () => {
|
||||||
// -1.6428571428571428
|
|
||||||
const metrics = {
|
const metrics = {
|
||||||
totalSubmissions: 8,
|
totalSubmissions: 8,
|
||||||
downvotedSubmissions: 2,
|
downvotedSubmissions: 2,
|
||||||
@@ -146,6 +145,7 @@ describe("reputation", () => {
|
|||||||
mostUpvotedInLockedVideoSum: 0
|
mostUpvotedInLockedVideoSum: 0
|
||||||
};
|
};
|
||||||
assert.strictEqual(await getReputation(getHash(userIDHighNonSelfDownvotes)), calculateReputationFromMetrics(metrics));
|
assert.strictEqual(await getReputation(getHash(userIDHighNonSelfDownvotes)), calculateReputationFromMetrics(metrics));
|
||||||
|
assert.strictEqual(await getReputation(getHash(userIDHighNonSelfDownvotes)), -1.6428571428571428);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("user with mostly new submissions", async () => {
|
it("user with mostly new submissions", async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user