This commit is contained in:
@@ -102,4 +102,60 @@ it('shows the same ranks in the desktop profile with lifetime map scope explaine
|
||||
'Lifetime personal bests across all squad sizes, ranked against other players on each map.'
|
||||
);
|
||||
expect(body).toContain('Tied records share a rank.');
|
||||
expect(body).not.toContain('No qualifying match history yet');
|
||||
expect(body).toContain('Show all completed matches');
|
||||
});
|
||||
|
||||
it('renders a known player without qualifying history with identity and unavailable personal bests', () => {
|
||||
const profile: PlayerProfile = {
|
||||
guid: '101',
|
||||
name: 'New player',
|
||||
firstSeen: evidence.startedAt,
|
||||
lastSeen: evidence.startedAt,
|
||||
stats: {
|
||||
highestRound: 0,
|
||||
bestKills: 0,
|
||||
bestScore: 0,
|
||||
kills: 0,
|
||||
roundsSurvived: 0,
|
||||
headshots: 0,
|
||||
revives: 0,
|
||||
downs: 0,
|
||||
gamesPlayed: 0,
|
||||
gamesCompleted: 0
|
||||
},
|
||||
records: null,
|
||||
maps: [],
|
||||
matches: [],
|
||||
matchesTotal: 0,
|
||||
limit: 25,
|
||||
offset: 0
|
||||
};
|
||||
const body = render(PlayerProfilePage, {
|
||||
props: {
|
||||
data: {
|
||||
profile,
|
||||
returnTo: '/leaderboard',
|
||||
scope: { game: '', map: '', players: '', metric: 'highestRound', entry: null }
|
||||
}
|
||||
}
|
||||
}).body;
|
||||
const text = body.replace(/<[^>]*>/g, ' ').replace(/\s+/g, ' ');
|
||||
expect(text).toContain('New player');
|
||||
expect(text).toContain('No qualifying match history yet');
|
||||
expect(text).toContain('Stats appear after a recorded game ends');
|
||||
expect(text).toContain('observed at round 2 or later');
|
||||
expect(text).toContain('Lifetime best round —');
|
||||
expect(text).toContain('Best game kills —');
|
||||
expect(text).toContain('Highest reported score —');
|
||||
expect(text).toContain('Lifetime games played 0');
|
||||
expect(text).toContain('No map records yet');
|
||||
expect(text).toContain('No qualifying matches recorded');
|
||||
expect(text).toContain('First seen');
|
||||
expect(text).toContain('Last seen');
|
||||
expect(body).toContain('Player GUID');
|
||||
expect(body).not.toContain('/matches/');
|
||||
expect(body).not.toContain('Show all completed matches');
|
||||
expect(body).not.toContain('<table');
|
||||
expect(body).not.toContain('NaN');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user