Improve application responsiveness and background processing
This commit is contained in:
@@ -123,7 +123,7 @@ it('qualifies before competition ranking, then searches and paginates without ch
|
||||
expect(page).toMatchObject({ total: 3, entries: [{ guid: 'Blake', rank: 1 }], summary: full.summary });
|
||||
expect(getLeaderboard({ metric: 'averageKills', offset: 3 })).toMatchObject({ total: 3, entries: [], summary: full.summary });
|
||||
const { GET } = await import('../../src/routes/api/leaderboard/+server.js');
|
||||
const response = GET({ url: new URL('http://localhost/api/leaderboard?metric=averageKills&game=t5&q=current&limit=1') });
|
||||
const response = await GET({ url: new URL('http://localhost/api/leaderboard?metric=averageKills&game=t5&q=current&limit=1') });
|
||||
expect(response.status).toBe(200);
|
||||
expect(await response.json()).toMatchObject({ metric: 'averageKills', total: 1,
|
||||
entries: [{ guid: 'Casey', rank: 3, averageKills: 10, gamesPlayed: 5 }], summary: full.summary });
|
||||
@@ -135,7 +135,7 @@ it('accepts each efficiency metric through the API when the qualified group is e
|
||||
const { efficiencyMetrics } = await import('../../src/lib/leaderboard-efficiency.js');
|
||||
const { GET } = await import('../../src/routes/api/leaderboard/+server.js');
|
||||
for (const { key } of efficiencyMetrics) {
|
||||
const response = GET({ url: new URL(`http://localhost/api/leaderboard?metric=${key}`) });
|
||||
const response = await GET({ url: new URL(`http://localhost/api/leaderboard?metric=${key}`) });
|
||||
expect(response.status).toBe(200);
|
||||
expect(await response.json()).toMatchObject({ metric: key, entries: [], total: 0,
|
||||
summary: { players: 1, matches: 4, kills: 80 } });
|
||||
|
||||
Reference in New Issue
Block a user