generated from nhcarrigan/template
test: add profilePublic field to User test fixtures
Updates all User test objects in auth.types.spec.ts to include the profilePublic field that was added to the User interface. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,30 +10,32 @@ describe("auth Types", () => {
|
||||
describe("user interface", () => {
|
||||
it("should accept valid user objects", () => {
|
||||
const userWithAvatar: User = {
|
||||
avatar: "https://example.com/avatar.png",
|
||||
discordId: "discord123",
|
||||
email: "test@example.com",
|
||||
id: "user123",
|
||||
inDiscord: true,
|
||||
isAdmin: true,
|
||||
isBanned: false,
|
||||
isMod: true,
|
||||
isStaff: true,
|
||||
isVip: false,
|
||||
username: "testuser",
|
||||
avatar: "https://example.com/avatar.png",
|
||||
discordId: "discord123",
|
||||
email: "test@example.com",
|
||||
id: "user123",
|
||||
inDiscord: true,
|
||||
isAdmin: true,
|
||||
isBanned: false,
|
||||
isMod: true,
|
||||
isStaff: true,
|
||||
isVip: false,
|
||||
profilePublic: true,
|
||||
username: "testuser",
|
||||
};
|
||||
|
||||
const userWithoutAvatar: User = {
|
||||
discordId: "discord456",
|
||||
email: "another@example.com",
|
||||
id: "user456",
|
||||
inDiscord: false,
|
||||
isAdmin: false,
|
||||
isBanned: false,
|
||||
isMod: false,
|
||||
isStaff: false,
|
||||
isVip: true,
|
||||
username: "anotheruser",
|
||||
discordId: "discord456",
|
||||
email: "another@example.com",
|
||||
id: "user456",
|
||||
inDiscord: false,
|
||||
isAdmin: false,
|
||||
isBanned: false,
|
||||
isMod: false,
|
||||
isStaff: false,
|
||||
isVip: true,
|
||||
profilePublic: false,
|
||||
username: "anotheruser",
|
||||
};
|
||||
|
||||
expect(userWithAvatar.avatar).toBe("https://example.com/avatar.png");
|
||||
@@ -44,16 +46,17 @@ describe("auth Types", () => {
|
||||
|
||||
it("should handle all boolean flags correctly", () => {
|
||||
const bannedUser: User = {
|
||||
discordId: "discord789",
|
||||
email: "banned@example.com",
|
||||
id: "banned123",
|
||||
inDiscord: false,
|
||||
isAdmin: false,
|
||||
isBanned: true,
|
||||
isMod: false,
|
||||
isStaff: false,
|
||||
isVip: false,
|
||||
username: "banneduser",
|
||||
discordId: "discord789",
|
||||
email: "banned@example.com",
|
||||
id: "banned123",
|
||||
inDiscord: false,
|
||||
isAdmin: false,
|
||||
isBanned: true,
|
||||
isMod: false,
|
||||
isStaff: false,
|
||||
isVip: false,
|
||||
profilePublic: false,
|
||||
username: "banneduser",
|
||||
};
|
||||
|
||||
expect(bannedUser.isBanned).toBeTruthy();
|
||||
@@ -97,17 +100,18 @@ describe("auth Types", () => {
|
||||
const authResponse: AuthResponse = {
|
||||
accessToken: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
|
||||
user: {
|
||||
avatar: "https://example.com/avatar.png",
|
||||
discordId: "discord123",
|
||||
email: "test@example.com",
|
||||
id: "user123",
|
||||
inDiscord: true,
|
||||
isAdmin: false,
|
||||
isBanned: false,
|
||||
isMod: false,
|
||||
isStaff: false,
|
||||
isVip: false,
|
||||
username: "testuser",
|
||||
avatar: "https://example.com/avatar.png",
|
||||
discordId: "discord123",
|
||||
email: "test@example.com",
|
||||
id: "user123",
|
||||
inDiscord: true,
|
||||
isAdmin: false,
|
||||
isBanned: false,
|
||||
isMod: false,
|
||||
isStaff: false,
|
||||
isVip: false,
|
||||
profilePublic: true,
|
||||
username: "testuser",
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user