Restore leaderboard combat and total rounds columns

This commit is contained in:
2026-10-06 19:51:09 -04:00
parent 9d31fc0580
commit 2520735850
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -18,7 +18,7 @@
const number = new Intl.NumberFormat('en-US');
const pageSize = leaderboardPageSize;
const games = [{ key: 't5', label: 'Black Ops I' }, { key: 't6', label: 'Black Ops II' }];
const defaultColumns: PlayerStatMetric[] = ['kills', 'gamesPlayed'];
const defaultColumns: PlayerStatMetric[] = ['kills', 'roundsSurvived', 'headshots', 'revives', 'downs', 'gamesPlayed'];
const descriptions: Record<PlayerStatMetric, string> = {
highestRound: 'The highest round reached in a recorded game.',
kills: 'Cumulative kills across recorded games.',
+4 -4
View File
@@ -19,12 +19,12 @@ function scope(search = '') {
function html(data = report()) { return render(Leaderboard, { props: { data: { leaderboard: data, user: null, setupRequired: false } } }).body; }
beforeEach(() => scope());
it('shows prominent totals and five columns, preserving ranks and collapsed identity and evidence', () => {
it('shows prominent totals and restored stat columns, preserving ranks and collapsed identity and evidence', () => {
const body = html();
const headers = body.slice(body.indexOf('<thead'), body.indexOf('</thead>'));
expect(headers.match(/scope="col"/g)).toHaveLength(5);
expect(headers.match(/scope="col"/g)).toHaveLength(9);
expect(headers).toContain('Highest round'); expect(headers).toContain('Total kills'); expect(headers).toContain('Games played');
expect(headers).not.toContain('Headshots');
for (const label of ['Total rounds', 'Headshots', 'Revives', 'Downs']) expect(headers).toContain(label);
expect(body).toMatch(/<span[^>]*>27<\/span>/);
expect(body).toContain('26–26 of 60 players');
const overview = body.slice(body.indexOf('class="overview'), body.indexOf('class="rankings'));
@@ -43,7 +43,7 @@ it('deduplicates the selected metric and preserves scope and pagination on playe
const data = report(); data.metric = 'kills';
const body = html(data);
const headers = body.slice(body.indexOf('<thead'), body.indexOf('</thead>'));
expect(headers.match(/scope="col"/g)).toHaveLength(4);
expect(headers.match(/scope="col"/g)).toHaveLength(8);
expect(body).toContain('offset%3D25'); expect(body).toContain('q%3DCherry');
scope('?game=t5&map=t5%3Atheater&metric=highestRound&q=Cherry&offset=25');
const recordBody = html();