refactor(user): remove unused view fields
This commit is contained in:
@@ -10,25 +10,13 @@ describe("toView", () => {
|
||||
expect(toView({ id: "user-1", username: "Luna" })).toEqual({
|
||||
id: "user-1",
|
||||
username: "Luna",
|
||||
email: "",
|
||||
country: "",
|
||||
countryCode: "",
|
||||
avatarUrl: "",
|
||||
intimacy: 0,
|
||||
dolBalance: 0,
|
||||
creditBalance: 0,
|
||||
dailyFreeChatLimit: 0,
|
||||
dailyFreeChatUsed: 0,
|
||||
dailyFreeChatRemaining: 0,
|
||||
dailyFreePrivateLimit: 0,
|
||||
dailyFreePrivateUsed: 0,
|
||||
dailyFreePrivateRemaining: 0,
|
||||
vipExpiresAt: null,
|
||||
relationshipStage: "",
|
||||
currentMood: "",
|
||||
isGuest: false,
|
||||
isVip: false,
|
||||
voiceMinutesRemaining: 0,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -37,48 +25,25 @@ describe("toView", () => {
|
||||
toView({
|
||||
id: "user-2",
|
||||
username: "Elio",
|
||||
email: "elio@example.com",
|
||||
country: "Hong Kong",
|
||||
countryCode: "HK",
|
||||
avatarUrl: "https://example.com/avatar.png",
|
||||
intimacy: 42,
|
||||
dolBalance: 12,
|
||||
creditBalance: 120,
|
||||
dailyFreeChatLimit: 30,
|
||||
dailyFreeChatUsed: 4,
|
||||
dailyFreeChatRemaining: 26,
|
||||
dailyFreePrivateLimit: 2,
|
||||
dailyFreePrivateUsed: 1,
|
||||
dailyFreePrivateRemaining: 1,
|
||||
vipExpiresAt: "2026-07-26T00:00:00+00:00",
|
||||
relationshipStage: "close_friend",
|
||||
currentMood: "playful",
|
||||
isGuest: true,
|
||||
isVip: true,
|
||||
voiceMinutesRemaining: 30,
|
||||
}),
|
||||
).toEqual({
|
||||
id: "user-2",
|
||||
username: "Elio",
|
||||
email: "elio@example.com",
|
||||
country: "Hong Kong",
|
||||
countryCode: "HK",
|
||||
avatarUrl: "https://example.com/avatar.png",
|
||||
intimacy: 42,
|
||||
dolBalance: 12,
|
||||
creditBalance: 120,
|
||||
dailyFreeChatLimit: 30,
|
||||
dailyFreeChatUsed: 4,
|
||||
dailyFreeChatRemaining: 26,
|
||||
dailyFreePrivateLimit: 2,
|
||||
dailyFreePrivateUsed: 1,
|
||||
dailyFreePrivateRemaining: 1,
|
||||
vipExpiresAt: "2026-07-26T00:00:00+00:00",
|
||||
relationshipStage: "close_friend",
|
||||
currentMood: "playful",
|
||||
isGuest: true,
|
||||
isVip: true,
|
||||
voiceMinutesRemaining: 30,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -93,7 +58,6 @@ describe("toView", () => {
|
||||
).toMatchObject({
|
||||
isVip: true,
|
||||
creditBalance: 120,
|
||||
dolBalance: 120,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -12,25 +12,13 @@ function makeUser(overrides: Partial<UserView> = {}): UserView {
|
||||
return {
|
||||
id: "user-1",
|
||||
username: "Elio Fan",
|
||||
email: "user@example.com",
|
||||
country: "Hong Kong",
|
||||
countryCode: "HK",
|
||||
avatarUrl: "https://example.com/avatar.png",
|
||||
intimacy: 42,
|
||||
dolBalance: 7,
|
||||
creditBalance: 7,
|
||||
dailyFreeChatLimit: 30,
|
||||
dailyFreeChatUsed: 0,
|
||||
dailyFreeChatRemaining: 30,
|
||||
dailyFreePrivateLimit: 2,
|
||||
dailyFreePrivateUsed: 0,
|
||||
dailyFreePrivateRemaining: 2,
|
||||
vipExpiresAt: null,
|
||||
relationshipStage: "close_friend",
|
||||
currentMood: "happy",
|
||||
isGuest: false,
|
||||
isVip: false,
|
||||
voiceMinutesRemaining: 12,
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user