Add fallback data structures for tests
cgen-1950d0b20f5d4eecb81b3d6aba0253bd
This commit is contained in:
parent
dfa13a0b3e
commit
79fdf396c8
1 changed files with 33 additions and 0 deletions
|
|
@ -221,6 +221,39 @@ export interface ActivateRewardsResponse {
|
|||
targetUserId?: string | null;
|
||||
}
|
||||
|
||||
const fallbackInterests = new Map<string, string[]>();
|
||||
|
||||
const fallbackAchievementCatalog: ReadonlyArray<AethexAchievement> = [
|
||||
{
|
||||
id: "welcome-to-aethex",
|
||||
name: "Welcome to AeThex",
|
||||
description: "Complete your AeThex passport to unlock the community.",
|
||||
icon: "sparkles",
|
||||
xp_reward: 150,
|
||||
badge_color: "#7C3AED",
|
||||
created_at: "2024-01-01T00:00:00.000Z",
|
||||
},
|
||||
{
|
||||
id: "aethex-explorer",
|
||||
name: "AeThex Explorer",
|
||||
description: "Link your favorite tools and showcase your craft.",
|
||||
icon: "compass",
|
||||
xp_reward: 200,
|
||||
badge_color: "#06B6D4",
|
||||
created_at: "2024-01-01T00:00:00.000Z",
|
||||
},
|
||||
];
|
||||
|
||||
const fallbackAchievementsById = new Map<string, AethexAchievement>(
|
||||
fallbackAchievementCatalog.map((achievement) => [achievement.id, achievement]),
|
||||
);
|
||||
|
||||
const fallbackAchievementsByName = new Map<string, AethexAchievement>(
|
||||
fallbackAchievementCatalog.map((achievement) => [achievement.name, achievement]),
|
||||
);
|
||||
|
||||
const fallbackUserAchievements = new Map<string, Set<string>>();
|
||||
|
||||
function isTableMissing(err: any): boolean {
|
||||
const msg = String(err?.message || err?.hint || err?.details || "");
|
||||
return (
|
||||
|
|
|
|||
Loading…
Reference in a new issue