mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-11 08:48:15 +03:00
Add tests for the new batch manual behaviour.
This commit is contained in:
@@ -358,6 +358,38 @@ t.test("#ConverterFn", (t) => {
|
||||
t.end();
|
||||
});
|
||||
|
||||
t.test("Should produce a with timeAchieved null if timeAchieved is 0", async (t) => {
|
||||
const res = await ConverterBatchManual(
|
||||
deepmerge(baseBatchManualScore, { timeAchieved: 0 }),
|
||||
{ game: "iidx", service: "foo", playtype: "SP", version: null },
|
||||
importType,
|
||||
logger
|
||||
);
|
||||
|
||||
t.hasStrict(res, {
|
||||
chart: Testing511SPA,
|
||||
song: { id: 1 },
|
||||
dryScore: {
|
||||
game: "iidx",
|
||||
service: "foo (BATCH-MANUAL)",
|
||||
comment: null,
|
||||
importType: "file/batch-manual",
|
||||
timeAchieved: null,
|
||||
scoreData: {
|
||||
lamp: "HARD CLEAR",
|
||||
score: 500,
|
||||
grade: "E",
|
||||
// percent: 31.5, -- ish, FPA is hard.
|
||||
judgements: {},
|
||||
hitMeta: {},
|
||||
},
|
||||
scoreMeta: {},
|
||||
},
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
t.test("Should reject a score with > 100%", (t) => {
|
||||
t.rejects(
|
||||
() =>
|
||||
|
||||
@@ -402,6 +402,32 @@ t.test("#ParserFn", (t) => {
|
||||
t.end();
|
||||
});
|
||||
|
||||
t.test("TimeAchieved of 0 should be legal.", (t) => {
|
||||
const res = ParserFn(dm({ timeAchieved: 0 }), "file/batch-manual", logger);
|
||||
|
||||
t.hasStrict(res, {
|
||||
game: "iidx",
|
||||
context: {
|
||||
service: "foo",
|
||||
game: "iidx",
|
||||
playtype: "SP",
|
||||
version: null,
|
||||
},
|
||||
iterable: [
|
||||
{
|
||||
score: 1000,
|
||||
lamp: "HARD CLEAR",
|
||||
matchType: "tachiSongID",
|
||||
identifier: "123",
|
||||
difficulty: "ANOTHER",
|
||||
timeAchieved: 0,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
t.test("Invalid Identifier", (t) => {
|
||||
// this is not a valid playtype for IIDX
|
||||
const fn = () => ParserFn(dm({ identifier: null }), "file/batch-manual", logger);
|
||||
|
||||
Reference in New Issue
Block a user