Honest baseline after removing 45 gaming suppressions. Structural: lib/game plus root hooks extraction, CORS origin echo, DEV_ORIGINS layering. Fixes: error-cause binding, discord 5xx split, null-cache guard, co-located tests, rejecting-fetch coverage, naming and typing cleanup, socket controller, cache bound, cascade helpers, latch resets. Hardening: per-IP rate limit on API routes, deterministic-miss UX, retry cooldown plus cap. Suite 140 green, build plus lint clean.
67 lines
1.8 KiB
TypeScript
67 lines
1.8 KiB
TypeScript
import type { GiteaRepo } from "@/lib/gitea";
|
|
import type { GameProfile } from "@/lib/game/game-profile-types";
|
|
import type { LanyardData } from "@/lib/game/lanyard";
|
|
|
|
export function profileFixture(overrides: Partial<GameProfile> = {}): GameProfile {
|
|
return {
|
|
applicationId: "1",
|
|
gameId: "1",
|
|
gameUrl: "https://discord.com/games/1",
|
|
name: "Test Game",
|
|
genres: ["RPG"],
|
|
description: "A test game",
|
|
developers: ["Dev"],
|
|
publishers: ["Pub"],
|
|
releaseDate: "2024-01-15",
|
|
platforms: ["Windows"],
|
|
links: [],
|
|
coverUrl: null,
|
|
artworkUrl: null,
|
|
screenshots: [],
|
|
steamId: "100",
|
|
steamUrl: "https://store.steampowered.com/app/100/",
|
|
igdbUrl: null,
|
|
steamReviews: null,
|
|
itad: null,
|
|
sources: { igdb: false, steam: true, itad: false },
|
|
...overrides,
|
|
};
|
|
}
|
|
|
|
export function lanyardFixture(overrides: Partial<LanyardData> = {}): LanyardData {
|
|
return {
|
|
discord_user: {
|
|
id: "1",
|
|
username: "testuser",
|
|
global_name: "Test User",
|
|
display_name: "Test User",
|
|
discriminator: "0",
|
|
avatar: null,
|
|
bot: false,
|
|
},
|
|
activities: [],
|
|
discord_status: "online",
|
|
active_on_discord_desktop: true,
|
|
active_on_discord_mobile: false,
|
|
active_on_discord_web: false,
|
|
listening_to_spotify: false,
|
|
spotify: null,
|
|
...overrides,
|
|
};
|
|
}
|
|
|
|
export function repoFixture(): GiteaRepo {
|
|
return {
|
|
id: 1,
|
|
name: "demo",
|
|
fullName: "fristy/demo",
|
|
description: "A demo repo",
|
|
language: "TypeScript",
|
|
htmlUrl: "https://git.fristy.net/fristy/demo",
|
|
website: null,
|
|
stars: 3,
|
|
forks: 1,
|
|
updatedAt: "2026-01-01T00:00:00Z",
|
|
};
|
|
}
|