Skip to content

Commit

Permalink
fix: removed type casting and use explicit definition of expectedResult
Browse files Browse the repository at this point in the history
  • Loading branch information
minhaferzz committed Feb 27, 2024
1 parent ed207ec commit ba86a0d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/feed/getAchievementOfTheWeek.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ describe("Function: getAchievementOfTheWeek", () => {
// ACT
const response = await getAchievementOfTheWeek(authorization);

// ASSERT
expect(response).toEqual({
const expectedResponse: AchievementOfTheWeek = {
achievement: {
id: 165_062,
title: "The True Hero",
Expand All @@ -97,7 +96,10 @@ describe("Function: getAchievementOfTheWeek", () => {
}
],
unlocksCount: 40
} as AchievementOfTheWeek);
};

// ASSERT
expect(response).toEqual(expectedResponse);
});

it("properly sets the hardcore boolean value when cleaning properties", async () => {
Expand Down Expand Up @@ -145,8 +147,7 @@ describe("Function: getAchievementOfTheWeek", () => {
// ACT
const response = await getAchievementOfTheWeek(authorization);

// ASSERT
expect(response).toEqual({
const expectedResponse: AchievementOfTheWeek = {
achievement: {
id: 165_062,
title: "The True Hero",
Expand All @@ -173,6 +174,9 @@ describe("Function: getAchievementOfTheWeek", () => {
}
],
unlocksCount: 40
} as AchievementOfTheWeek);
};

// ASSERT
expect(response).toEqual(expectedResponse);
});
});

0 comments on commit ba86a0d

Please sign in to comment.