This commit is contained in:
@@ -123,7 +123,7 @@ describe('completed match details', () => {
|
||||
name: 'Player 303',
|
||||
hasStats: false,
|
||||
presentAtEnd: false,
|
||||
canViewProfile: false,
|
||||
canViewProfile: true,
|
||||
firstSeenAt: timestamp(0),
|
||||
lastSeenAt: timestamp(0),
|
||||
highestRound: null,
|
||||
@@ -232,28 +232,29 @@ describe('completed match details', () => {
|
||||
expect(participants.find((entry) => entry.guid === '202')).toMatchObject({
|
||||
hasStats: true,
|
||||
highestRound: 1,
|
||||
canViewProfile: false
|
||||
canViewProfile: true
|
||||
});
|
||||
expect(participants.find((entry) => entry.guid === '303')).toMatchObject({
|
||||
hasStats: false,
|
||||
canViewProfile: false
|
||||
canViewProfile: true
|
||||
});
|
||||
for (const participant of participants)
|
||||
expect(participant.canViewProfile).toBe(getPlayerProfile(participant.guid) !== null);
|
||||
|
||||
// A start-only participant can still have a valid profile from another match.
|
||||
// A start-only participant has an empty profile until another match qualifies.
|
||||
await report('game_start', 0, [player('303')]);
|
||||
await report('heartbeat', 3, [player('303')]);
|
||||
expect(getMatchDetail(1)!.players.find((entry) => entry.guid === '303')).toMatchObject({
|
||||
canViewProfile: false
|
||||
canViewProfile: true
|
||||
});
|
||||
expect(getPlayerProfile('303')).toBeNull();
|
||||
expect(getPlayerProfile('303')).toMatchObject({ records: null, matches: [] });
|
||||
await report('game_end', 3, [player('303')]);
|
||||
participants = getMatchDetail(1)!.players;
|
||||
expect(participants.find((entry) => entry.guid === '303')).toMatchObject({
|
||||
hasStats: false,
|
||||
canViewProfile: true
|
||||
});
|
||||
expect(getPlayerProfile('303')).toMatchObject({ stats: { gamesPlayed: 1 } });
|
||||
|
||||
// Missing identities must not discard a saved roster row or produce a dead link.
|
||||
handle.prepare("DELETE FROM leaderboard_players WHERE guid = '101'").run();
|
||||
|
||||
Reference in New Issue
Block a user