Files
gold_land_user/test/fixtures/me.fixture.ts
T
safavimohadeseh78andCursor e3f0457dc9
Frontend CI / unit (test, type-check, build) (push) Successful in 1m11s
Frontend CI / browser E2E (frontend + pinned backend) (push) Failing after 2m48s
feat: complete server-backed six-lesson app and trial tooling
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-12 14:40:37 +03:30

57 lines
1.2 KiB
TypeScript

import type { MeResponse } from '../../src/api/client'
export function createMeFixture(overrides?: {
xp?: number
coins?: number
totalStars?: number
name?: string
}): MeResponse {
const xp = overrides?.xp ?? 10
const coins = overrides?.coins ?? 100
const totalStars = overrides?.totalStars ?? 0
return {
user: {
id: 'user-1',
name: overrides?.name ?? 'Test User',
level: 1,
xp,
maxXp: 100,
coins,
missionProgress: 0,
missionTarget: 3,
},
wallet: { cash: 500, goldGrams: 0 },
progress: {
completedChallenges: [],
completedLessons: [],
completedGames: [],
claimedRewards: [],
ownedItems: [],
mapLevels: [
{
id: 1,
title: 'L1',
stars: totalStars > 0 ? 3 : 0,
maxStars: 3,
status: totalStars > 0 ? 'completed' : 'current',
x: 50,
y: 50,
},
],
totalStars,
maxStars: 18,
},
achievements: [],
transactions: [],
market: { selectedRange: '1d' },
}
}
export function createAuthLoginBody(token: string, me: MeResponse) {
return {
token,
user: { id: me.user.id, name: me.user.name, username: 'testuser' },
me,
}
}