Skip to content

Commit

Permalink
corrected dummy user
Browse files Browse the repository at this point in the history
  • Loading branch information
PeeyushPrashant committed Sep 10, 2024
1 parent fb6669a commit b114f99
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
20 changes: 10 additions & 10 deletions tests/fixtures/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const user = {
incompleteUserDetails: false,
discordJoinedAt: "2023-08-08T11:40:42.522000+00:00",
discordId: "858838385330487336",
github_display_name: "Sunny Sahsi",
github_display_name: "John Doe",
updated_at: 1694888822719,
roles: {
archived: false,
Expand All @@ -12,10 +12,10 @@ export const user = {
super_user: false,
archive: false,
},
last_name: "Sahsi",
github_id: "sahsisunny",
first_name: "Sunny",
username: "sunny",
last_name: "Doe",
github_id: "johndoe",
first_name: "John",
username: "johndoe",
state: "ACTIVE",
};

Expand Down Expand Up @@ -179,7 +179,7 @@ export const userWithoutDiscordJoinedAt = {
incompleteUserDetails: false,
discordJoinedAt: "",
discordId: "504855562094247953",
github_display_name: "Jyotsna Mehta",
github_display_name: "John Doe",
updated_at: 1694888822719,
roles: {
archived: false,
Expand All @@ -188,10 +188,10 @@ export const userWithoutDiscordJoinedAt = {
super_user: false,
archive: false,
},
last_name: "Mehta",
github_id: "j24m",
first_name: "Jyotsna",
username: "jyotsna",
last_name: "Doe",
github_id: "johndoe",
first_name: "John",
username: "johndoe",
state: "IDLE",
};

Expand Down
9 changes: 5 additions & 4 deletions tests/unit/utils/formatUserDetails.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ describe("formatUserDetails function", () => {
it("should format user details correctly", () => {
const formattedDetails = formatUserDetails(userResponse).trim();

const userFullName = `**Full Name :** Sunny Sahsi`;
const userFullName = `**Full Name :** John Doe`;
const discordJoinedAt = `**Joined Server on :** ${convertTimeStamp(
userResponse
)}`;
const userState = `**State :** ACTIVE`;
const userName = `**UserName :** sunny`;
const userName = `**UserName :** johndoe`;
const userId = `**UserId :** iODXB6ns8jaZB9p0XlBw`;

const expectedFormattedDetails = `## User Details\n${userFullName}\n${discordJoinedAt}\n${userState}\n${userName}\n${userId}`;
Expand All @@ -32,12 +32,13 @@ describe("formatUserDetails function", () => {
const formattedDetails = formatUserDetails(
userWithoutDiscordJoinedAtResponse
).trim();
const userFullName = `**Full Name :** Jyotsna Mehta`;

const userFullName = `**Full Name :** John Doe`;
const discordJoinedAt = `**Joined Server on :** ${convertTimeStamp(
userWithoutDiscordJoinedAtResponse
)}`;
const userState = `**State :** IDLE`;
const userName = `**UserName :** jyotsna`;
const userName = `**UserName :** johndoe`;
const userId = `**UserId :** DWcTUhbC5lRXfDjZRp06`;
const expectedFormattedDetails = `## User Details\n${userFullName}\n${discordJoinedAt}\n${userState}\n${userName}\n${userId}`;
expect(formattedDetails).toEqual(expectedFormattedDetails);
Expand Down

0 comments on commit b114f99

Please sign in to comment.