test: add regression tests for players endpoint

This commit is contained in:
zkldi
2022-07-03 13:10:07 +01:00
parent 02964e6519
commit 0bf635754e
2 changed files with 70 additions and 0 deletions
+14
View File
@@ -22,6 +22,7 @@ import type {
PublicUserDocument,
ScoreDocument,
UGPTSettings,
UserGameStats,
} from "tachi-common";
/**
@@ -103,3 +104,16 @@ export function mkFakeGoal(modifant: Partial<GoalDocument> = {}) {
export function mkFakeGoalSub(modifant: Partial<GoalSubscriptionDocument> = {}) {
return dmf(HC511UserGoal, modifant);
}
export function mkFakeGameStats(userID: integer, modifant: Partial<UserGameStats> = {}) {
return dmf(
{
userID,
game: "iidx",
playtype: "SP",
classes: {},
ratings: {},
},
modifant
);
}