fix: some tests and snapshots

This commit is contained in:
zkldi
2023-01-19 16:39:52 +00:00
parent 64d83c2e9f
commit 6822118a4a
5 changed files with 22 additions and 22 deletions
@@ -28,13 +28,11 @@ import type { GPTStrings, GradeBoundary, integer, SpecificUserGameStats } from "
export const EX_SCORE_CHECK: ChartSpecificMetricValidator<IIDXLikes> = (exScore, chart) => {
if (exScore < 0) {
return `EX Score cannot be negative. Got ${exScore}.`;
return `EX Score cannot be negative.`;
}
if (exScore > chart.data.notecount * 2) {
return `EX Score cannot be greater than ${
chart.data.notecount * 2
} for this chart. Got ${exScore}.`;
return `EX Score cannot be greater than ${chart.data.notecount * 2} for this chart.`;
}
return true;
@@ -108,7 +108,7 @@ function ValidateMetrics(
}
if (typeof err === "string") {
errs.push(`Invalid value for ${metric}, ${err}`);
errs.push(`Invalid value for ${metric}, ${err} Got ${scoreVal}.`);
}
break;
@@ -193,8 +193,9 @@ t.test("POST /ir/direct-manual/import", async (t) => {
[
{
type: "InvalidDatapoint",
message: `Got 1 error when validating score:
Invalid value for score, EX Score cannot be greater than 1572 for this chart. Got 9000.`,
message: `Got 2 errors when validating score:
Invalid value for score, EX Score cannot be greater than 1572 for this chart. Got 9000.
Invalid value for percent, Expected a number between 0 and 100. Got 572.5190839694657.`,
},
],
"Should have one failed score."
@@ -456,8 +456,9 @@ t.test("POST /ir/fervidex/score/submit", (t) => {
t.strictSame(imp?.errors, [
{
type: "InvalidDatapoint",
message: `Got 1 error when validating score:
Invalid value for score, EX Score cannot be greater than 1572 for this chart. Got 9999.`,
message: `Got 2 errors when validating score:
Invalid value for score, EX Score cannot be greater than 1572 for this chart. Got 9999.
Invalid value for percent, Expected a number between 0 and 100. Got 636.0687022900763.`,
},
]);
@@ -27,7 +27,7 @@
"Invalid Goal: folder-score for iidx is illegal": "Creating score goals on multiple charts where the maximum value is relative to the chart is a terrible idea, and has been disabled.",
"Invalid Goal: any-score for iidx is illegal": "Invalid key for iidx with multiple charts. Creating score goals on multiple charts where score is relative to notecount is a terrible idea, and has been disabled.",
"Invalid Goal: charts single but criteria not.": "Invalid countNum for goal with criteria.mode of 'absolute'. Expected a whole number less than the total amount of charts available and greater than 1. (Got 2, while total charts was 1.)",
"Invalid Goal: too big score": "Invalid value 9000 for score, EX Score cannot be greater than 1572 for this chart. Got 9000.",
"Invalid Goal: too big score": "Invalid value 9000 for score, EX Score cannot be greater than 1572 for this chart.",
"Invalid Goal: LampIndex:Multi:Proportion Case": "Criteria Mode must be 'single' or 'absolute' if Charts Type is 'multi'. Doesn't make sense to have proportional goals when you're capped at 10 charts.",
"Invalid Goal: GradeIndex:Multi:Proportion Case": "Criteria Mode must be 'single' or 'absolute' if Charts Type is 'multi'. Doesn't make sense to have proportional goals when you're capped at 10 charts.",
"Invalid Goal: Percent:Multi:Proportion Case": "Criteria Mode must be 'single' or 'absolute' if Charts Type is 'multi'. Doesn't make sense to have proportional goals when you're capped at 10 charts.",
@@ -35,17 +35,17 @@
"Jubeat Music Rate Validator: negative": "Expected a number between 0 and 100.",
"Jubeat Music Rate Validator: too big": "Expected a number between 0 and 100.",
"Jubeat Music Rate Validator: too big (hard)": "Expected a number between 0 and 120.",
"EX Score Validator SP: negative": "EX Score cannot be negative. Got -1.",
"EX Score Validator SP: excessive": "EX Score cannot be greater than 1572 for this chart. Got 1573.",
"EX Score Validator DP: negative": "EX Score cannot be negative. Got -1.",
"EX Score Validator DP: excessive": "EX Score cannot be greater than 1572 for this chart. Got 1573.",
"EX Score Validator SP: negative": "EX Score cannot be negative.",
"EX Score Validator SP: excessive": "EX Score cannot be greater than 1572 for this chart.",
"EX Score Validator DP: negative": "EX Score cannot be negative.",
"EX Score Validator DP: excessive": "EX Score cannot be greater than 1572 for this chart.",
"EX Score Validator SDVX: negative": "EX Score must be non-negative. Got -1",
"EX Score Validator 7K: negative": "EX Score cannot be negative. Got -1.",
"EX Score Validator 7K: excessive": "EX Score cannot be greater than 4512 for this chart. Got 4513.",
"EX Score Validator 14K: negative": "EX Score cannot be negative. Got -1.",
"EX Score Validator 14K: excessive": "EX Score cannot be greater than 4512 for this chart. Got 4513.",
"EX Score Validator Controller: negative": "EX Score cannot be negative. Got -1.",
"EX Score Validator Controller: excessive": "EX Score cannot be greater than 4512 for this chart. Got 4513.",
"EX Score Validator Keyboard: negative": "EX Score cannot be negative. Got -1.",
"EX Score Validator Keyboard: excessive": "EX Score cannot be greater than 4512 for this chart. Got 4513."
"EX Score Validator 7K: negative": "EX Score cannot be negative.",
"EX Score Validator 7K: excessive": "EX Score cannot be greater than 4512 for this chart.",
"EX Score Validator 14K: negative": "EX Score cannot be negative.",
"EX Score Validator 14K: excessive": "EX Score cannot be greater than 4512 for this chart.",
"EX Score Validator Controller: negative": "EX Score cannot be negative.",
"EX Score Validator Controller: excessive": "EX Score cannot be greater than 4512 for this chart.",
"EX Score Validator Keyboard: negative": "EX Score cannot be negative.",
"EX Score Validator Keyboard: excessive": "EX Score cannot be greater than 4512 for this chart."
}