feat: implement user profiles with achievements and primary badge system #58

Merged
naomi merged 17 commits from feat/user-profiles into main 2026-02-19 22:21:18 -08:00
Showing only changes of commit 198fe240f7 - Show all commits
+46 -42
View File
@@ -10,30 +10,32 @@ describe("auth Types", () => {
describe("user interface", () => { describe("user interface", () => {
it("should accept valid user objects", () => { it("should accept valid user objects", () => {
const userWithAvatar: User = { const userWithAvatar: User = {
avatar: "https://example.com/avatar.png", avatar: "https://example.com/avatar.png",
discordId: "discord123", discordId: "discord123",
email: "test@example.com", email: "test@example.com",
id: "user123", id: "user123",
inDiscord: true, inDiscord: true,
isAdmin: true, isAdmin: true,
isBanned: false, isBanned: false,
isMod: true, isMod: true,
isStaff: true, isStaff: true,
isVip: false, isVip: false,
username: "testuser", profilePublic: true,
username: "testuser",
}; };
const userWithoutAvatar: User = { const userWithoutAvatar: User = {
discordId: "discord456", discordId: "discord456",
email: "another@example.com", email: "another@example.com",
id: "user456", id: "user456",
inDiscord: false, inDiscord: false,
isAdmin: false, isAdmin: false,
isBanned: false, isBanned: false,
isMod: false, isMod: false,
isStaff: false, isStaff: false,
isVip: true, isVip: true,
username: "anotheruser", profilePublic: false,
username: "anotheruser",
}; };
expect(userWithAvatar.avatar).toBe("https://example.com/avatar.png"); expect(userWithAvatar.avatar).toBe("https://example.com/avatar.png");
@@ -44,16 +46,17 @@ describe("auth Types", () => {
it("should handle all boolean flags correctly", () => { it("should handle all boolean flags correctly", () => {
const bannedUser: User = { const bannedUser: User = {
discordId: "discord789", discordId: "discord789",
email: "banned@example.com", email: "banned@example.com",
id: "banned123", id: "banned123",
inDiscord: false, inDiscord: false,
isAdmin: false, isAdmin: false,
isBanned: true, isBanned: true,
isMod: false, isMod: false,
isStaff: false, isStaff: false,
isVip: false, isVip: false,
username: "banneduser", profilePublic: false,
username: "banneduser",
}; };
expect(bannedUser.isBanned).toBeTruthy(); expect(bannedUser.isBanned).toBeTruthy();
@@ -97,17 +100,18 @@ describe("auth Types", () => {
const authResponse: AuthResponse = { const authResponse: AuthResponse = {
accessToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", accessToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
user: { user: {
avatar: "https://example.com/avatar.png", avatar: "https://example.com/avatar.png",
discordId: "discord123", discordId: "discord123",
email: "test@example.com", email: "test@example.com",
id: "user123", id: "user123",
inDiscord: true, inDiscord: true,
isAdmin: false, isAdmin: false,
isBanned: false, isBanned: false,
isMod: false, isMod: false,
isStaff: false, isStaff: false,
isVip: false, isVip: false,
username: "testuser", profilePublic: true,
username: "testuser",
}, },
}; };