diff --git a/src/user/getAchievementsEarnedBetween.test.ts b/src/user/getAchievementsEarnedBetween.test.ts index 16d391e..fc6279a 100644 --- a/src/user/getAchievementsEarnedBetween.test.ts +++ b/src/user/getAchievementsEarnedBetween.test.ts @@ -4,7 +4,10 @@ import { setupServer } from "msw/node"; import { apiBaseUrl } from "../utils/internal"; import { buildAuthorization } from "../utils/public"; import { getAchievementsEarnedBetween } from "./getAchievementsEarnedBetween"; -import type { DatedUserAchievementsResponse } from "./models"; +import type { + DatedUserAchievement, + DatedUserAchievementsResponse +} from "./models"; const server = setupServer(); @@ -42,7 +45,8 @@ describe("Function: getAchievementsEarnedBetween", () => { ConsoleName: "PlayStation Portable", CumulScore: 40, BadgeURL: "/Badge/193797.png", - GameURL: "/game/3571" + GameURL: "/game/3571", + Type: "progression" } ]; @@ -59,8 +63,7 @@ describe("Function: getAchievementsEarnedBetween", () => { toDate: new Date("2022-10-13") }); - // ASSERT - expect(response).toEqual([ + const expectedResponse: DatedUserAchievement[] = [ { date: "2022-10-12 07:36:31", hardcoreMode: true, @@ -76,8 +79,12 @@ describe("Function: getAchievementsEarnedBetween", () => { consoleName: "PlayStation Portable", cumulScore: 40, badgeUrl: "/Badge/193797.png", - gameUrl: "/game/3571" + gameUrl: "/game/3571", + type: "progression" } - ]); + ]; + + // ASSERT + expect(response).toEqual(expectedResponse); }); }); diff --git a/src/user/getAchievementsEarnedBetween.ts b/src/user/getAchievementsEarnedBetween.ts index 73db2d1..a166bf5 100644 --- a/src/user/getAchievementsEarnedBetween.ts +++ b/src/user/getAchievementsEarnedBetween.ts @@ -57,7 +57,8 @@ import type { * consoleName: 'PlayStation Portable', * cumulScore: 120, * badgeUrl: '/Badge/193756.png', - * gameUrl: '/game/3571' + * gameUrl: '/game/3571', + * type: 'progression' * } * ] * ``` diff --git a/src/user/getAchievementsEarnedOnDay.test.ts b/src/user/getAchievementsEarnedOnDay.test.ts index 9d72371..c583400 100644 --- a/src/user/getAchievementsEarnedOnDay.test.ts +++ b/src/user/getAchievementsEarnedOnDay.test.ts @@ -4,7 +4,10 @@ import { setupServer } from "msw/node"; import { apiBaseUrl } from "../utils/internal"; import { buildAuthorization } from "../utils/public"; import { getAchievementsEarnedOnDay } from "./getAchievementsEarnedOnDay"; -import type { DatedUserAchievementsResponse } from "./models"; +import type { + DatedUserAchievement, + DatedUserAchievementsResponse +} from "./models"; const server = setupServer(); @@ -42,7 +45,8 @@ describe("Function: getAchievementsEarnedOnDay", () => { ConsoleName: "PlayStation Portable", CumulScore: 40, BadgeURL: "/Badge/193797.png", - GameURL: "/game/3571" + GameURL: "/game/3571", + Type: null } ]; @@ -58,8 +62,7 @@ describe("Function: getAchievementsEarnedOnDay", () => { onDate: new Date("2022-10-12") }); - // ASSERT - expect(response).toEqual([ + const expectedResponse: DatedUserAchievement[] = [ { date: "2022-10-12 07:36:31", hardcoreMode: true, @@ -75,8 +78,12 @@ describe("Function: getAchievementsEarnedOnDay", () => { consoleName: "PlayStation Portable", cumulScore: 40, badgeUrl: "/Badge/193797.png", - gameUrl: "/game/3571" + gameUrl: "/game/3571", + type: null } - ]); + ]; + + // ASSERT + expect(response).toEqual(expectedResponse); }); }); diff --git a/src/user/getAchievementsEarnedOnDay.ts b/src/user/getAchievementsEarnedOnDay.ts index af815bd..dbed6cd 100644 --- a/src/user/getAchievementsEarnedOnDay.ts +++ b/src/user/getAchievementsEarnedOnDay.ts @@ -56,7 +56,8 @@ import type { * consoleName: 'PlayStation Portable', * cumulScore: 120, * badgeUrl: '/Badge/193756.png', - * gameUrl: '/game/3571' + * gameUrl: '/game/3571', + * type: 'progression' * } * ] * ``` diff --git a/src/user/models/dated-user-achievement.model.ts b/src/user/models/dated-user-achievement.model.ts index 20800b2..07df1c3 100644 --- a/src/user/models/dated-user-achievement.model.ts +++ b/src/user/models/dated-user-achievement.model.ts @@ -14,4 +14,5 @@ export type DatedUserAchievement = { cumulScore: number; badgeUrl: string; gameUrl: string; + type: "progression" | "win_condition" | "missable" | null; }; diff --git a/src/user/models/dated-user-achievements-response.model.ts b/src/user/models/dated-user-achievements-response.model.ts index 44a95cb..f464155 100644 --- a/src/user/models/dated-user-achievements-response.model.ts +++ b/src/user/models/dated-user-achievements-response.model.ts @@ -14,6 +14,7 @@ interface DatedUserAchievementResponseEntity { CumulScore: number; BadgeURL: string; GameURL: string; + Type: "progression" | "win_condition" | "missable" | null; } export type DatedUserAchievementsResponse =