From b0e37039d8cb40d22d3ab02e1cf7b80ac2c51e96 Mon Sep 17 00:00:00 2001 From: zkldi Date: Fri, 29 Oct 2021 00:47:24 +0100 Subject: [PATCH] Fix tests that no longer pass due to testdata change --- .../_game/_playtype/songs/_songID/router.test.ts | 2 +- .../games/_game/_playtype/pbs/router.test.ts | 14 +++++++++++++- .../games/_game/_playtype/scores/router.test.ts | 6 +++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/server/src/server/router/api/v1/games/_game/_playtype/songs/_songID/router.test.ts b/server/src/server/router/api/v1/games/_game/_playtype/songs/_songID/router.test.ts index 4c365046b..37a67d8d1 100644 --- a/server/src/server/router/api/v1/games/_game/_playtype/songs/_songID/router.test.ts +++ b/server/src/server/router/api/v1/games/_game/_playtype/songs/_songID/router.test.ts @@ -11,7 +11,7 @@ t.test("GET /api/v1/games/:game/:playtype/songs/:songID", (t) => { t.test("Should return the song at this ID and all of its charts.", async (t) => { const res = await mockApi.get("/api/v1/games/iidx/SP/songs/1"); - t.equal(res.body.body.charts.length, 14); + t.equal(res.body.body.charts.length, 4); t.equal(res.body.body.song.id, 1); diff --git a/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/pbs/router.test.ts b/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/pbs/router.test.ts index 025bb4f0b..a2788f0c9 100644 --- a/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/pbs/router.test.ts +++ b/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/pbs/router.test.ts @@ -112,9 +112,15 @@ t.test("GET /api/v1/users/:userID/games/:game/:playtype/pbs", (t) => { t.hasStrict(res.body, { success: true, - description: "Retrieved 2 personal bests.", + description: "Retrieved 4 personal bests.", body: { pbs: [ + { + chartID: "71865a2b6d3581decf076ae83c6621302c4bb271", + }, + { + chartID: "952805894d7d78257e87019426fa1d87aec834a5", + }, { chartID: "c2311194e3897ddb5745b1760d2c0141f933e683", }, @@ -131,9 +137,15 @@ t.test("GET /api/v1/users/:userID/games/:game/:playtype/pbs", (t) => { { chartID: "c2311194e3897ddb5745b1760d2c0141f933e683", }, + { + chartID: "71865a2b6d3581decf076ae83c6621302c4bb271", + }, { chartID: "c641238220d73faf82659513ba03bde71b0b45f0", }, + { + chartID: "952805894d7d78257e87019426fa1d87aec834a5", + }, ], }, }); diff --git a/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/scores/router.test.ts b/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/scores/router.test.ts index a30534d93..778fce5cd 100644 --- a/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/scores/router.test.ts +++ b/server/src/server/router/api/v1/users/_userID/games/_game/_playtype/scores/router.test.ts @@ -111,13 +111,13 @@ t.test("GET /api/v1/users/:userID/games/:game/:playtype/scores", (t) => { "/api/v1/users/test_zkldi/games/iidx/SP/scores?search=5.1.1." ); - t.equal(res.body.body.scores.length, 3); + t.equal(res.body.body.scores.length, 5); t.equal(res.body.body.songs.length, 1); - t.equal(res.body.body.charts.length, 2); + t.equal(res.body.body.charts.length, 4); t.hasStrict(res.body, { success: true, - description: "Retrieved 3 scores.", + description: "Retrieved 5 scores.", body: { scores: [ {