Restore leaderboard combat and total rounds columns
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
const number = new Intl.NumberFormat('en-US');
|
const number = new Intl.NumberFormat('en-US');
|
||||||
const pageSize = leaderboardPageSize;
|
const pageSize = leaderboardPageSize;
|
||||||
const games = [{ key: 't5', label: 'Black Ops I' }, { key: 't6', label: 'Black Ops II' }];
|
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> = {
|
const descriptions: Record<PlayerStatMetric, string> = {
|
||||||
highestRound: 'The highest round reached in a recorded game.',
|
highestRound: 'The highest round reached in a recorded game.',
|
||||||
kills: 'Cumulative kills across recorded games.',
|
kills: 'Cumulative kills across recorded games.',
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ function scope(search = '') {
|
|||||||
function html(data = report()) { return render(Leaderboard, { props: { data: { leaderboard: data, user: null, setupRequired: false } } }).body; }
|
function html(data = report()) { return render(Leaderboard, { props: { data: { leaderboard: data, user: null, setupRequired: false } } }).body; }
|
||||||
beforeEach(() => scope());
|
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 body = html();
|
||||||
const headers = body.slice(body.indexOf('<thead'), body.indexOf('</thead>'));
|
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).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).toMatch(/<span[^>]*>27<\/span>/);
|
||||||
expect(body).toContain('26–26 of 60 players');
|
expect(body).toContain('26–26 of 60 players');
|
||||||
const overview = body.slice(body.indexOf('class="overview'), body.indexOf('class="rankings'));
|
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 data = report(); data.metric = 'kills';
|
||||||
const body = html(data);
|
const body = html(data);
|
||||||
const headers = body.slice(body.indexOf('<thead'), body.indexOf('</thead>'));
|
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');
|
expect(body).toContain('offset%3D25'); expect(body).toContain('q%3DCherry');
|
||||||
scope('?game=t5&map=t5%3Atheater&metric=highestRound&q=Cherry&offset=25');
|
scope('?game=t5&map=t5%3Atheater&metric=highestRound&q=Cherry&offset=25');
|
||||||
const recordBody = html();
|
const recordBody = html();
|
||||||
|
|||||||
Reference in New Issue
Block a user