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", () => {
|
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",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user