diff --git a/.claude/settings.local.json b/.claude/settings.local.json
index f3cdb7021..668c033d2 100644
--- a/.claude/settings.local.json
+++ b/.claude/settings.local.json
@@ -7,7 +7,8 @@
"Bash(node:*)",
"Bash(tail:*)",
"Bash(git add src/components/CompareResults/SubtestsResults/SubtestsRevisionRow.tsx && git rebase --continue 2>&1)",
- "Bash(grep:*)"
+ "Bash(grep:*)",
+ "Bash(npx jest *)"
]
}
}
diff --git a/src/__tests__/App.test.tsx b/src/__tests__/App.test.tsx
index a418178d9..c9c04bad8 100644
--- a/src/__tests__/App.test.tsx
+++ b/src/__tests__/App.test.tsx
@@ -3,7 +3,7 @@ import userEvent from '@testing-library/user-event';
import App, { router } from '../components/App';
import getTestData from './utils/fixtures';
-import { act, render, screen } from './utils/test-utils';
+import { act, render, screen, within } from './utils/test-utils';
describe('App', () => {
beforeEach(() => {
@@ -396,11 +396,13 @@ describe('App', () => {
// Wait for the page to load
await screen.findByText('a11yr');
- // Verify that Mann-Whitney-U specific columns are rendered
- // (this indicates the testVersion defaulted to mann-whitney-u)
- expect(screen.getByText('CD')).toBeInTheDocument();
- expect(screen.getByText('Sig')).toBeInTheDocument();
- expect(screen.getByText('CLES (%)')).toBeInTheDocument();
+ // Verify a Mann-Whitney-U specific column is rendered — "Δ Median %" is
+ // unique to the Mann-Whitney strategy (Student-T uses "Delta"), so its
+ // presence in the table header indicates the testVersion defaulted to
+ // mann-whitney-u. Scope to the header since the "How to read the results"
+ // panel also names it.
+ const tableHeader = screen.getByTestId('table-header');
+ expect(within(tableHeader).getByText('Δ Median %')).toBeInTheDocument();
// Verify the Stats Test Version dropdown shows Mann-Whitney-U as selected
const testVersionDropdown = screen.getByRole('combobox', {
diff --git a/src/__tests__/CompareResults/ResultsTable.test.tsx b/src/__tests__/CompareResults/ResultsTable.test.tsx
index c663ada1d..fa7dd9f7b 100644
--- a/src/__tests__/CompareResults/ResultsTable.test.tsx
+++ b/src/__tests__/CompareResults/ResultsTable.test.tsx
@@ -14,7 +14,13 @@ import getTestData, {
augmentCompareMannWhitneyDataWithSeveralRevisions,
augmentCompareMannWhitneyDataWithSeveralTests,
} from '../utils/fixtures';
-import { renderWithRouter, screen, waitFor, within } from '../utils/test-utils';
+import {
+ renderWithRouter,
+ screen,
+ waitFor,
+ within,
+ enableAdvancedColumns,
+} from '../utils/test-utils';
function renderWithRoute(component: ReactElement, extraParameters?: string) {
return renderWithRouter(component, {
@@ -48,7 +54,7 @@ function setupAndRender(
// This handy function parses the results page and returns an array of visible
// rows. It makes it easy to assert visible rows when filtering them in a
// user-friendly way without using snapshots.
-function summarizeVisibleRows(testVersion?: TestVersion) {
+function summarizeVisibleRows(testVersion?: TestVersion, advanced = false) {
const rowGroups = screen.getAllByRole('rowgroup');
const result = [];
@@ -83,17 +89,33 @@ function summarizeVisibleRows(testVersion?: TestVersion) {
for (const row of rows) {
const rowClasses =
testVersion === 'mann-whitney-u'
- ? [
- '.platform span',
- '.median-diff',
- '.status',
- '.delta',
- '.significance',
- '.effects',
- ]
+ ? advanced
+ ? [
+ '.platform span',
+ '.median-diff',
+ '.status-hint',
+ '.delta',
+ '.significance',
+ '.effects',
+ ]
+ : [
+ '.platform span',
+ '.median-diff',
+ '.status-hint',
+ '.significance',
+ ]
: ['.platform span', '.status', '.delta', '.confidence'];
const rowString = rowClasses
- .map((selector) => row.querySelector(selector)?.textContent?.trim())
+ .map((selector) => {
+ const cell = row.querySelector(selector);
+ if (!cell) return undefined;
+ // Strip icon
text (e.g. the median-diff normality warning)
+ // so the data-focused expectations stay stable; icon presence is
+ // asserted separately.
+ const clone = cell.cloneNode(true) as HTMLElement;
+ clone.querySelectorAll('svg').forEach((svg) => svg.remove());
+ return clone.textContent?.trim();
+ })
.join(', ');
result.push(' - ' + rowString);
@@ -690,6 +712,13 @@ describe('Results Table', () => {
});
describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersion', () => {
+ // These tests exercise the full (advanced) table — CD, CLES, Sig columns and
+ // their sort/filter behavior. The simplified default view (which hides those
+ // and shows Difference Size) is covered separately below.
+ beforeEach(() => {
+ enableAdvancedColumns();
+ });
+
it('Should match snapshot', async () => {
const { testCompareMannWhitneyData } = getTestData();
@@ -719,12 +748,12 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio
setupAndRender(simplerTestCompareData, 'test_version=mann-whitney-u');
await screen.findByText('a11yr');
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html opt e10s fission stylo webrender',
' rev: spam',
- ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.1, Noise, 25.00 %',
' rev: devilrabbit',
- ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.1, Noise, 25.00 %',
]);
expect(screen.getByRole('rowgroup')).toMatchSnapshot();
});
@@ -746,25 +775,25 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio
setupAndRender(testCompareMannWhitneyData, 'test_version=mann-whitney-u');
await screen.findByText('a11yr');
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html spam opt e10s fission stylo webrender',
- ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - inexistant, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - Windows 10, -, , -, , 100.00 %',
- ' - Windows 10, -2.401 %, , -, , 50.00 %',
+ ' - Android, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - inexistant, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - Linux 18.04, +1.85%, Regression, -, Noise, 45.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - Windows 10, -, , -, Real, 100.00 %',
+ ' - Windows 10, -2.40%, , -, Real, 50.00 %',
]);
expect(summarizeTableFiltersFromUrl()).toEqual({});
const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime });
await clickMenuItem(user, 'Platform', /Windows/);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html spam opt e10s fission stylo webrender',
- ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %',
+ ' - Android, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - Linux 18.04, +1.85%, Regression, -, Noise, 45.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.1, Noise, 25.00 %',
]);
expect(summarizeTableFiltersFromUrl()).toEqual({
platform: ['osx', 'linux', 'android', 'ios'],
@@ -773,78 +802,78 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio
// Clicking Windows again should remove the search param and make the
// "inexitant" platform visible again.
await clickMenuItem(user, 'Platform', /Windows/);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html spam opt e10s fission stylo webrender',
- ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - inexistant, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - Windows 10, -, , -, , 100.00 %',
- ' - Windows 10, -2.401 %, , -, , 50.00 %',
+ ' - Android, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - inexistant, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - Linux 18.04, +1.85%, Regression, -, Noise, 45.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - Windows 10, -, , -, Real, 100.00 %',
+ ' - Windows 10, -2.40%, , -, Real, 50.00 %',
]);
expect(summarizeTableFiltersFromUrl()).toEqual({});
await clickMenuItem(user, 'Platform', /Windows/);
await clickMenuItem(user, 'Platform', /Linux/);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html spam opt e10s fission stylo webrender',
- ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %',
+ ' - Android, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.1, Noise, 25.00 %',
]);
expect(summarizeTableFiltersFromUrl()).toEqual({
platform: ['osx', 'android', 'ios'],
});
await clickMenuItem(user, 'Platform', /Linux/);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html spam opt e10s fission stylo webrender',
- ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %',
+ ' - Android, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - Linux 18.04, +1.85%, Regression, -, Noise, 45.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.1, Noise, 25.00 %',
]);
expect(summarizeTableFiltersFromUrl()).toEqual({
platform: ['osx', 'android', 'ios', 'linux'],
});
await clickMenuItem(user, 'Platform', 'Select all values');
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html spam opt e10s fission stylo webrender',
- ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - inexistant, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - Windows 10, -, , -, , 100.00 %',
- ' - Windows 10, -2.401 %, , -, , 50.00 %',
+ ' - Android, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - inexistant, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - Linux 18.04, +1.85%, Regression, -, Noise, 45.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - Windows 10, -, , -, Real, 100.00 %',
+ ' - Windows 10, -2.40%, , -, Real, 50.00 %',
]);
expect(summarizeTableFiltersFromUrl()).toEqual({});
await clickMenuItem(user, 'Platform', /macOS/);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html spam opt e10s fission stylo webrender',
- ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %',
- ' - Windows 10, -, , -, , 100.00 %',
- ' - Windows 10, -2.401 %, , -, , 50.00 %',
+ ' - Android, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - Linux 18.04, +1.85%, Regression, -, Noise, 45.00 %',
+ ' - Windows 10, -, , -, Real, 100.00 %',
+ ' - Windows 10, -2.40%, , -, Real, 50.00 %',
]);
expect(summarizeTableFiltersFromUrl()).toEqual({
platform: ['windows', 'linux', 'android', 'ios'],
});
await clickMenuItem(user, 'Platform', /Android/);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html spam opt e10s fission stylo webrender',
- ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %',
- ' - Windows 10, -, , -, , 100.00 %',
- ' - Windows 10, -2.401 %, , -, , 50.00 %',
+ ' - Linux 18.04, +1.85%, Regression, -, Noise, 45.00 %',
+ ' - Windows 10, -, , -, Real, 100.00 %',
+ ' - Windows 10, -2.40%, , -, Real, 50.00 %',
]);
expect(summarizeTableFiltersFromUrl()).toEqual({
platform: ['windows', 'linux', 'ios'],
});
await clickMenuItem(user, 'Platform', /Select only.*Android/);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html spam opt e10s fission stylo webrender',
- ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %',
+ ' - Android, +1.08%, Improvement, 0.1, Noise, 25.00 %',
]);
expect(summarizeTableFiltersFromUrl()).toEqual({
platform: ['android'],
@@ -858,16 +887,16 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio
const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime });
- // Filter only "Significant"
+ // Filter only "Real" (significant)
const signifianceMenu = await screen.findByRole('button', {
name: /Sig.*filter/,
});
await user.click(signifianceMenu);
expect(signifianceMenu).toMatchSnapshot();
- // significant item 0 and Not significant item 1
+ // "Real" is item 0, "Noise" (not significant) is item 1
const significantOptions = await screen.findAllByRole('menuitemcheckbox', {
- name: /Significant/,
+ name: /Real|Noise/,
});
await user.click(significantOptions[1]);
await user.keyboard('[Escape]');
@@ -881,30 +910,30 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio
setupAndRender(testCompareMannWhitneyData, 'test_version=mann-whitney-u');
await screen.findByText('a11yr');
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html spam opt e10s fission stylo webrender',
- ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - Windows 10, -, , -, , 100.00 %',
- ' - Windows 10, -2.401 %, , -, , 50.00 %',
+ ' - Linux 18.04, +1.85%, Regression, -, Noise, 45.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - Windows 10, -, , -, Real, 100.00 %',
+ ' - Windows 10, -2.40%, , -, Real, 50.00 %',
]);
expect(summarizeTableFiltersFromUrl()).toEqual({});
const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime });
await clickMenuItem(user, 'Status', /No changes/);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html spam opt e10s fission stylo webrender',
- ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %',
+ ' - Linux 18.04, +1.85%, Regression, -, Noise, 45.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.1, Noise, 25.00 %',
]);
expect(summarizeTableFiltersFromUrl()).toEqual({
status: ['improvement', 'regression'],
});
await clickMenuItem(user, 'Status', /Improvement/);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html spam opt e10s fission stylo webrender',
- ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %',
+ ' - Linux 18.04, +1.85%, Regression, -, Noise, 45.00 %',
]);
expect(summarizeTableFiltersFromUrl()).toEqual({
status: ['regression'],
@@ -912,39 +941,39 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio
await clickMenuItem(user, 'Status', /Select all values/);
await clickMenuItem(user, 'Status', /Regression/);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html spam opt e10s fission stylo webrender',
- ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - Windows 10, -, , -, , 100.00 %',
- ' - Windows 10, -2.401 %, , -, , 50.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - Windows 10, -, , -, Real, 100.00 %',
+ ' - Windows 10, -2.40%, , -, Real, 50.00 %',
]);
expect(summarizeTableFiltersFromUrl()).toEqual({
status: ['none', 'improvement'],
});
await clickMenuItem(user, 'Status', /Regression/);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html spam opt e10s fission stylo webrender',
- ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - Windows 10, -, , -, , 100.00 %',
- ' - Windows 10, -2.401 %, , -, , 50.00 %',
+ ' - Linux 18.04, +1.85%, Regression, -, Noise, 45.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - Windows 10, -, , -, Real, 100.00 %',
+ ' - Windows 10, -2.40%, , -, Real, 50.00 %',
]);
expect(summarizeTableFiltersFromUrl()).toEqual({});
await clickMenuItem(user, 'Status', /Select only.*Regression/);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html spam opt e10s fission stylo webrender',
- ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %',
+ ' - Linux 18.04, +1.85%, Regression, -, Noise, 45.00 %',
]);
expect(summarizeTableFiltersFromUrl()).toEqual({
status: ['regression'],
});
await clickMenuItem(user, 'Status', /Select only.*Improvement/);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html spam opt e10s fission stylo webrender',
- ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.1, Noise, 25.00 %',
]);
expect(summarizeTableFiltersFromUrl()).toEqual({
status: ['improvement'],
@@ -959,14 +988,14 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio
);
await screen.findByText('dhtml.html');
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html spam opt e10s fission stylo webrender',
- ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.1, Noise, 25.00 %',
]);
const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime });
expect(await summarizeTableFiltersFromCheckboxes(user)).toEqual({
'Platform(2)': ['macOS', 'Android'],
- 'Sig(2)': ['Significant', 'Not Significant-'],
+ 'Sig(2)': ['Real', 'Noise'],
'Status(3)': ['No changes', 'Improvement', 'Regression'],
});
@@ -994,29 +1023,29 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio
expect(deltaButton).toMatchSnapshot();
// // Sort descending
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr aria.html opt e10s fission stylo webrender',
' rev: spam',
- ' - Linux 18.04, 1.849 %, Regression, 1.2, -, 44.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 1.3, -, 24.00 %',
- ' - Windows 10, -, , 1.2, , 99.00 %',
- ' - Windows 10, -2.401 %, , 1.2, , 49.00 %',
+ ' - Linux 18.04, +1.85%, Regression, 1.2, Noise, 44.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 1.3, Noise, 24.00 %',
+ ' - Windows 10, -, , 1.2, Real, 99.00 %',
+ ' - Windows 10, -2.40%, , 1.2, Real, 49.00 %',
' rev: tictactoe',
- ' - Linux 18.04, 1.849 %, Regression, 2, -, 43.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 2.1, -, 23.00 %',
- ' - Windows 10, -, , 2, , 98.00 %',
- ' - Windows 10, -2.401 %, , 2, , 48.00 %',
+ ' - Linux 18.04, +1.85%, Regression, 2, Noise, 43.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 2.1, Noise, 23.00 %',
+ ' - Windows 10, -, , 2, Real, 98.00 %',
+ ' - Windows 10, -2.40%, , 2, Real, 48.00 %',
'a11yr dhtml.html opt e10s fission stylo webrender',
' rev: spam',
- ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - Windows 10, -, , -, , 100.00 %',
- ' - Windows 10, -2.401 %, , -, , 50.00 %',
+ ' - Linux 18.04, +1.85%, Regression, -, Noise, 45.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - Windows 10, -, , -, Real, 100.00 %',
+ ' - Windows 10, -2.40%, , -, Real, 50.00 %',
' rev: tictactoe',
- ' - Linux 18.04, 1.849 %, Regression, 0.8, -, 44.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 0.9, -, 24.00 %',
- ' - Windows 10, -, , 0.8, , 99.00 %',
- ' - Windows 10, -2.401 %, , 0.8, , 49.00 %',
+ ' - Linux 18.04, +1.85%, Regression, 0.8, Noise, 44.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.9, Noise, 24.00 %',
+ ' - Windows 10, -, , 0.8, Real, 99.00 %',
+ ' - Windows 10, -2.40%, , 0.8, Real, 49.00 %',
]);
// It should have the "descending" SVG.
expect(deltaButton).toMatchSnapshot();
@@ -1025,29 +1054,29 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio
// sort ascending
await user.click(deltaButton);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr aria.html opt e10s fission stylo webrender',
' rev: tictactoe',
- ' - macOS 10.15, 1.078 %, Improvement, 2.1, -, 23.00 %',
- ' - Linux 18.04, 1.849 %, Regression, 2, -, 43.00 %',
- ' - Windows 10, -2.401 %, , 2, , 48.00 %',
- ' - Windows 10, -, , 2, , 98.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 2.1, Noise, 23.00 %',
+ ' - Linux 18.04, +1.85%, Regression, 2, Noise, 43.00 %',
+ ' - Windows 10, -2.40%, , 2, Real, 48.00 %',
+ ' - Windows 10, -, , 2, Real, 98.00 %',
' rev: spam',
- ' - macOS 10.15, 1.078 %, Improvement, 1.3, -, 24.00 %',
- ' - Linux 18.04, 1.849 %, Regression, 1.2, -, 44.00 %',
- ' - Windows 10, -2.401 %, , 1.2, , 49.00 %',
- ' - Windows 10, -, , 1.2, , 99.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 1.3, Noise, 24.00 %',
+ ' - Linux 18.04, +1.85%, Regression, 1.2, Noise, 44.00 %',
+ ' - Windows 10, -2.40%, , 1.2, Real, 49.00 %',
+ ' - Windows 10, -, , 1.2, Real, 99.00 %',
'a11yr dhtml.html opt e10s fission stylo webrender',
' rev: tictactoe',
- ' - macOS 10.15, 1.078 %, Improvement, 0.9, -, 24.00 %',
- ' - Linux 18.04, 1.849 %, Regression, 0.8, -, 44.00 %',
- ' - Windows 10, -2.401 %, , 0.8, , 49.00 %',
- ' - Windows 10, -, , 0.8, , 99.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.9, Noise, 24.00 %',
+ ' - Linux 18.04, +1.85%, Regression, 0.8, Noise, 44.00 %',
+ ' - Windows 10, -2.40%, , 0.8, Real, 49.00 %',
+ ' - Windows 10, -, , 0.8, Real, 99.00 %',
' rev: spam',
- ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %',
- ' - Windows 10, -2.401 %, , -, , 50.00 %',
- ' - Windows 10, -, , -, , 100.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - Linux 18.04, +1.85%, Regression, -, Noise, 45.00 %',
+ ' - Windows 10, -2.40%, , -, Real, 50.00 %',
+ ' - Windows 10, -, , -, Real, 100.00 %',
]);
// It should have the "ascending" SVG.
expect(deltaButton).toMatchSnapshot();
@@ -1059,29 +1088,29 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio
name: /Sig.*sort/,
});
await user.click(significanceButton);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr aria.html opt e10s fission stylo webrender',
' rev: tictactoe',
- ' - macOS 10.15, 1.078 %, Improvement, 2.1, -, 23.00 %',
- ' - Linux 18.04, 1.849 %, Regression, 2, -, 43.00 %',
- ' - Windows 10, -, , 2, , 98.00 %',
- ' - Windows 10, -2.401 %, , 2, , 48.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 2.1, Noise, 23.00 %',
+ ' - Linux 18.04, +1.85%, Regression, 2, Noise, 43.00 %',
+ ' - Windows 10, -, , 2, Real, 98.00 %',
+ ' - Windows 10, -2.40%, , 2, Real, 48.00 %',
' rev: spam',
- ' - macOS 10.15, 1.078 %, Improvement, 1.3, -, 24.00 %',
- ' - Linux 18.04, 1.849 %, Regression, 1.2, -, 44.00 %',
- ' - Windows 10, -, , 1.2, , 99.00 %',
- ' - Windows 10, -2.401 %, , 1.2, , 49.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 1.3, Noise, 24.00 %',
+ ' - Linux 18.04, +1.85%, Regression, 1.2, Noise, 44.00 %',
+ ' - Windows 10, -, , 1.2, Real, 99.00 %',
+ ' - Windows 10, -2.40%, , 1.2, Real, 49.00 %',
'a11yr dhtml.html opt e10s fission stylo webrender',
' rev: tictactoe',
- ' - macOS 10.15, 1.078 %, Improvement, 0.9, -, 24.00 %',
- ' - Linux 18.04, 1.849 %, Regression, 0.8, -, 44.00 %',
- ' - Windows 10, -, , 0.8, , 99.00 %',
- ' - Windows 10, -2.401 %, , 0.8, , 49.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.9, Noise, 24.00 %',
+ ' - Linux 18.04, +1.85%, Regression, 0.8, Noise, 44.00 %',
+ ' - Windows 10, -, , 0.8, Real, 99.00 %',
+ ' - Windows 10, -2.40%, , 0.8, Real, 49.00 %',
' rev: spam',
- ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %',
- ' - Windows 10, -, , -, , 100.00 %',
- ' - Windows 10, -2.401 %, , -, , 50.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - Linux 18.04, +1.85%, Regression, -, Noise, 45.00 %',
+ ' - Windows 10, -, , -, Real, 100.00 %',
+ ' - Windows 10, -2.40%, , -, Real, 50.00 %',
]);
// It should have the "descending" SVG.
expect(significanceButton).toMatchSnapshot();
@@ -1090,29 +1119,29 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio
// Sort by Significance ascending
await user.click(significanceButton);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html opt e10s fission stylo webrender',
' rev: spam',
- ' - Windows 10, -2.401 %, , -, , 50.00 %',
- ' - Windows 10, -, , -, , 100.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %',
+ ' - Windows 10, -2.40%, , -, Real, 50.00 %',
+ ' - Windows 10, -, , -, Real, 100.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - Linux 18.04, +1.85%, Regression, -, Noise, 45.00 %',
' rev: tictactoe',
- ' - Windows 10, -2.401 %, , 0.8, , 49.00 %',
- ' - Windows 10, -, , 0.8, , 99.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 0.9, -, 24.00 %',
- ' - Linux 18.04, 1.849 %, Regression, 0.8, -, 44.00 %',
+ ' - Windows 10, -2.40%, , 0.8, Real, 49.00 %',
+ ' - Windows 10, -, , 0.8, Real, 99.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.9, Noise, 24.00 %',
+ ' - Linux 18.04, +1.85%, Regression, 0.8, Noise, 44.00 %',
'a11yr aria.html opt e10s fission stylo webrender',
' rev: spam',
- ' - Windows 10, -2.401 %, , 1.2, , 49.00 %',
- ' - Windows 10, -, , 1.2, , 99.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 1.3, -, 24.00 %',
- ' - Linux 18.04, 1.849 %, Regression, 1.2, -, 44.00 %',
+ ' - Windows 10, -2.40%, , 1.2, Real, 49.00 %',
+ ' - Windows 10, -, , 1.2, Real, 99.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 1.3, Noise, 24.00 %',
+ ' - Linux 18.04, +1.85%, Regression, 1.2, Noise, 44.00 %',
' rev: tictactoe',
- ' - Windows 10, -2.401 %, , 2, , 48.00 %',
- ' - Windows 10, -, , 2, , 98.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 2.1, -, 23.00 %',
- ' - Linux 18.04, 1.849 %, Regression, 2, -, 43.00 %',
+ ' - Windows 10, -2.40%, , 2, Real, 48.00 %',
+ ' - Windows 10, -, , 2, Real, 98.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 2.1, Noise, 23.00 %',
+ ' - Linux 18.04, +1.85%, Regression, 2, Noise, 43.00 %',
]);
// It should have the "descending" SVG.
expect(significanceButton).toMatchSnapshot();
@@ -1121,32 +1150,32 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio
// Sort by Effect Size (%) descending
const effectSizeButton = screen.getByRole('button', {
- name: /CLES \(%\).*sort/,
+ name: /CLES %.*sort/,
});
await user.click(effectSizeButton);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html opt e10s fission stylo webrender',
' rev: spam',
- ' - Windows 10, -, , -, , 100.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %',
- ' - Windows 10, -2.401 %, , -, , 50.00 %',
+ ' - Windows 10, -, , -, Real, 100.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - Linux 18.04, +1.85%, Regression, -, Noise, 45.00 %',
+ ' - Windows 10, -2.40%, , -, Real, 50.00 %',
' rev: tictactoe',
- ' - Windows 10, -, , 0.8, , 99.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 0.9, -, 24.00 %',
- ' - Linux 18.04, 1.849 %, Regression, 0.8, -, 44.00 %',
- ' - Windows 10, -2.401 %, , 0.8, , 49.00 %',
+ ' - Windows 10, -, , 0.8, Real, 99.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.9, Noise, 24.00 %',
+ ' - Linux 18.04, +1.85%, Regression, 0.8, Noise, 44.00 %',
+ ' - Windows 10, -2.40%, , 0.8, Real, 49.00 %',
'a11yr aria.html opt e10s fission stylo webrender',
' rev: spam',
- ' - Windows 10, -, , 1.2, , 99.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 1.3, -, 24.00 %',
- ' - Linux 18.04, 1.849 %, Regression, 1.2, -, 44.00 %',
- ' - Windows 10, -2.401 %, , 1.2, , 49.00 %',
+ ' - Windows 10, -, , 1.2, Real, 99.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 1.3, Noise, 24.00 %',
+ ' - Linux 18.04, +1.85%, Regression, 1.2, Noise, 44.00 %',
+ ' - Windows 10, -2.40%, , 1.2, Real, 49.00 %',
' rev: tictactoe',
- ' - Windows 10, -, , 2, , 98.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 2.1, -, 23.00 %',
- ' - Linux 18.04, 1.849 %, Regression, 2, -, 43.00 %',
- ' - Windows 10, -2.401 %, , 2, , 48.00 %',
+ ' - Windows 10, -, , 2, Real, 98.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 2.1, Noise, 23.00 %',
+ ' - Linux 18.04, +1.85%, Regression, 2, Noise, 43.00 %',
+ ' - Windows 10, -2.40%, , 2, Real, 48.00 %',
]);
expect(effectSizeButton).toMatchSnapshot();
@@ -1155,46 +1184,46 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio
// Sort by Effect Size (%) ascending
await user.click(effectSizeButton);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
'a11yr dhtml.html opt e10s fission stylo webrender',
' rev: spam',
- ' - Windows 10, -2.401 %, , -, , 50.00 %',
- ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %',
- ' - Windows 10, -, , -, , 100.00 %',
+ ' - Windows 10, -2.40%, , -, Real, 50.00 %',
+ ' - Linux 18.04, +1.85%, Regression, -, Noise, 45.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.1, Noise, 25.00 %',
+ ' - Windows 10, -, , -, Real, 100.00 %',
' rev: tictactoe',
- ' - Windows 10, -2.401 %, , 0.8, , 49.00 %',
- ' - Linux 18.04, 1.849 %, Regression, 0.8, -, 44.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 0.9, -, 24.00 %',
- ' - Windows 10, -, , 0.8, , 99.00 %',
+ ' - Windows 10, -2.40%, , 0.8, Real, 49.00 %',
+ ' - Linux 18.04, +1.85%, Regression, 0.8, Noise, 44.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 0.9, Noise, 24.00 %',
+ ' - Windows 10, -, , 0.8, Real, 99.00 %',
'a11yr aria.html opt e10s fission stylo webrender',
' rev: spam',
- ' - Windows 10, -2.401 %, , 1.2, , 49.00 %',
- ' - Linux 18.04, 1.849 %, Regression, 1.2, -, 44.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 1.3, -, 24.00 %',
- ' - Windows 10, -, , 1.2, , 99.00 %',
+ ' - Windows 10, -2.40%, , 1.2, Real, 49.00 %',
+ ' - Linux 18.04, +1.85%, Regression, 1.2, Noise, 44.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 1.3, Noise, 24.00 %',
+ ' - Windows 10, -, , 1.2, Real, 99.00 %',
' rev: tictactoe',
- ' - Windows 10, -2.401 %, , 2, , 48.00 %',
- ' - Linux 18.04, 1.849 %, Regression, 2, -, 43.00 %',
- ' - macOS 10.15, 1.078 %, Improvement, 2.1, -, 23.00 %',
- ' - Windows 10, -, , 2, , 98.00 %',
+ ' - Windows 10, -2.40%, , 2, Real, 48.00 %',
+ ' - Linux 18.04, +1.85%, Regression, 2, Noise, 43.00 %',
+ ' - macOS 10.15, +1.08%, Improvement, 2.1, Noise, 23.00 %',
+ ' - Windows 10, -, , 2, Real, 98.00 %',
]);
expect(effectSizeButton).toMatchSnapshot();
// It should be persisted in the URL
expectParameterToHaveValue('sort', 'effects|asc');
- // Sort by MD(%) descending
+ // Sort by Δ Median % descending
const medianDiffButton = screen.getByRole('button', {
- name: /MD \(%\).*sort/,
+ name: /Δ Median %.*sort/,
});
await user.click(medianDiffButton);
- expect(summarizeVisibleRows('mann-whitney-u')).toMatchSnapshot();
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toMatchSnapshot();
expect(medianDiffButton).toMatchSnapshot();
expectParameterToHaveValue('sort', 'median-diff|desc');
// Sort by MD(%) ascending
await user.click(medianDiffButton);
- expect(summarizeVisibleRows('mann-whitney-u')).toMatchSnapshot();
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toMatchSnapshot();
expect(medianDiffButton).toMatchSnapshot();
expectParameterToHaveValue('sort', 'median-diff|asc');
});
@@ -1248,3 +1277,29 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio
});
});
});
+
+describe('Advanced-columns toggle for mann-whitney-u testVersion', () => {
+ it('shows Sig but hides CD/CLES in the simplified (default) view', async () => {
+ const { testCompareMannWhitneyData } = getTestData();
+ setupAndRender(testCompareMannWhitneyData, 'test_version=mann-whitney-u');
+ await screen.findByText('a11yr');
+
+ const header = screen.getByTestId('table-header');
+ // Sig is shown in both views; CD/CLES are advanced-only.
+ expect(header.querySelector('.significance-header')).toBeTruthy();
+ expect(header.querySelector('.delta-header')).toBeFalsy();
+ expect(header.querySelector('.effects-header')).toBeFalsy();
+ });
+
+ it('reveals CD/CLES when advanced columns are enabled (Sig stays)', async () => {
+ enableAdvancedColumns();
+ const { testCompareMannWhitneyData } = getTestData();
+ setupAndRender(testCompareMannWhitneyData, 'test_version=mann-whitney-u');
+ await screen.findByText('a11yr');
+
+ const header = screen.getByTestId('table-header');
+ expect(header.querySelector('.delta-header')).toBeTruthy();
+ expect(header.querySelector('.effects-header')).toBeTruthy();
+ expect(header.querySelector('.significance-header')).toBeTruthy();
+ });
+});
diff --git a/src/__tests__/CompareResults/ResultsView.test.tsx b/src/__tests__/CompareResults/ResultsView.test.tsx
index 9d6bb7f31..dd494e8cf 100644
--- a/src/__tests__/CompareResults/ResultsView.test.tsx
+++ b/src/__tests__/CompareResults/ResultsView.test.tsx
@@ -566,4 +566,24 @@ describe('Results View', () => {
expect(screen.queryAllByTestId(/ExpandLessIcon/)).toHaveLength(0);
});
});
+
+ it('shows the "How to read the results" panel by default and lets the user dismiss it', async () => {
+ renderWithRoute();
+ await screen.findByText('a11yr');
+
+ // Shown by default.
+ const panel = screen.getByTestId('how-to-read-results');
+ expect(panel).toBeInTheDocument();
+
+ // Dismiss via the panel's close button.
+ const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime });
+ await user.click(screen.getByRole('button', { name: /close/i }));
+ expect(screen.queryByTestId('how-to-read-results')).not.toBeInTheDocument();
+
+ // The "How to read the results" checkbox brings it back.
+ await user.click(
+ screen.getByRole('checkbox', { name: /How to read the results/i }),
+ );
+ expect(screen.getByTestId('how-to-read-results')).toBeInTheDocument();
+ });
});
diff --git a/src/__tests__/CompareResults/RevisionRow.test.tsx b/src/__tests__/CompareResults/RevisionRow.test.tsx
index ae86e4950..6f542eab5 100644
--- a/src/__tests__/CompareResults/RevisionRow.test.tsx
+++ b/src/__tests__/CompareResults/RevisionRow.test.tsx
@@ -11,7 +11,11 @@ import { useSubtestRegressionCount } from '../../hooks/useSubtestRegressionCount
import { CompareResultsItem, MannWhitneyResultsItem } from '../../types/state';
import { Platform } from '../../types/types';
import getTestData from '../utils/fixtures';
-import { screen, renderWithRouter } from '../utils/test-utils';
+import {
+ screen,
+ renderWithRouter,
+ enableAdvancedColumns,
+} from '../utils/test-utils';
jest.mock('../../hooks/useSubtestRegressionCount');
const mockUseSubtestRegressionCount = useSubtestRegressionCount as jest.Mock;
@@ -427,6 +431,7 @@ describe('Expanded row', () => {
});
it('should display mean for base or new in row headers for mann-whitney-u testVersion', async () => {
+ enableAdvancedColumns();
const { testCompareMannWhitneyData: rowData } = getTestData();
renderWithRoute(
{
};
}
- it('shows dash when neither distribution is normal', async () => {
+ it('shows value with warning icon when neither distribution is normal', async () => {
const result = makeResult(tooFewRuns, tooFewRuns);
expect(isDistributionNormal(result)).toBe(false);
renderWithRoute(
@@ -555,7 +560,10 @@ describe('Expanded row', () => {
/>,
);
const roles = await screen.findAllByRole('cell');
- expect(roles[4]).toHaveTextContent('-');
+ // The median difference is rank-based, so it's shown even for non-normal
+ // data; only a warning icon flags the shape.
+ expect(roles[4]).toHaveTextContent('%');
+ expect(roles[4].querySelector('svg[role="img"]')).toBeTruthy();
});
it('shows value with warning icon when only one distribution is normal', async () => {
@@ -572,7 +580,7 @@ describe('Expanded row', () => {
/>,
);
const roles = await screen.findAllByRole('cell');
- expect(roles[4]).not.toHaveTextContent('-');
+ expect(roles[4]).toHaveTextContent('%');
expect(roles[4].querySelector('svg[role="img"]')).toBeTruthy();
});
@@ -590,7 +598,7 @@ describe('Expanded row', () => {
/>,
);
const roles = await screen.findAllByRole('cell');
- expect(roles[4]).not.toHaveTextContent('-');
+ expect(roles[4]).toHaveTextContent('%');
expect(roles[4].querySelector('svg[role="img"]')).toBeFalsy();
});
});
diff --git a/src/__tests__/CompareResults/SubtestsResultsView.test.tsx b/src/__tests__/CompareResults/SubtestsResultsView.test.tsx
index 87e1b9081..d5737351a 100644
--- a/src/__tests__/CompareResults/SubtestsResultsView.test.tsx
+++ b/src/__tests__/CompareResults/SubtestsResultsView.test.tsx
@@ -10,7 +10,11 @@ import type { CombinedResultsItemType } from '../../types/state';
import { TestVersion } from '../../types/types';
import { getLocationOrigin } from '../../utils/location';
import getTestData from '../utils/fixtures';
-import { renderWithRouter, screen } from '../utils/test-utils';
+import {
+ renderWithRouter,
+ screen,
+ enableAdvancedColumns,
+} from '../utils/test-utils';
jest.mock('../../utils/location');
const mockedGetLocationOrigin = getLocationOrigin as jest.Mock;
@@ -48,7 +52,7 @@ const setup = ({
// This handy function parses the results page and returns an array of visible
// rows. It makes it easy to assert visible rows when filtering them in a
// user-friendly way without using snapshots.
-function summarizeVisibleRows(testVersion?: TestVersion) {
+function summarizeVisibleRows(testVersion?: TestVersion, advanced = false) {
const rows = screen.getAllByRole('row');
const result = [];
for (const row of rows) {
@@ -59,10 +63,19 @@ function summarizeVisibleRows(testVersion?: TestVersion) {
}
const rowClasses =
testVersion === 'mann-whitney-u'
- ? ['.median-diff', '.delta', '.significance', '.effects']
+ ? advanced
+ ? ['.median-diff', '.delta', '.significance', '.effects']
+ : ['.median-diff', '.status-hint', '.significance']
: ['.delta', '.confidence'];
const rowString = rowClasses
- .map((selector) => row.querySelector(selector)?.textContent.trim())
+ .map((selector) => {
+ const cell = row.querySelector(selector);
+ if (!cell) return undefined;
+ // Strip icon text (e.g. the median-diff normality warning).
+ const clone = cell.cloneNode(true) as HTMLElement;
+ clone.querySelectorAll('svg').forEach((svg) => svg.remove());
+ return clone.textContent?.trim();
+ })
.join(', ');
result.push(`${subtest}: ${rowString}`);
}
@@ -499,6 +512,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', (
});
describe('table sorting', () => {
+ // These sort by CD and Significance, which are advanced-only columns.
+ beforeEach(() => {
+ enableAdvancedColumns();
+ });
+
async function setupForSorting({
extraParameters,
}: Partial<{
@@ -526,12 +544,12 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', (
it('can sort the table and persist the information to the URL of mann-whitney-u values', async () => {
await setupForSorting();
// Initial view (alphabetical ordered, even if "sort by subtests" isn't specified
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
- 'browser.html: 0.963 %, -0.04, -, 15.00%',
- 'dhtml.html: 1.135 %, 0.02, , 60.00%',
- 'improvement.html: 0.963 %, -0.05, , 50.00%',
- 'regression.html: 1.135 %, 0.12, , 25.00%',
- 'tablemutation.html: 0.98 %, 0.01, -, 45.00%',
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
+ 'browser.html: +1.14%, -0.04, Noise, 15.00%',
+ 'dhtml.html: +1.14%, 0.02, Real, 60.00%',
+ 'improvement.html: +1.14%, -0.05, Real, 50.00%',
+ 'regression.html: +1.14%, 0.12, Real, 25.00%',
+ 'tablemutation.html: +0.98%, 0.01, -, 45.00%',
]);
// Sort by Delta
@@ -541,12 +559,12 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', (
expect(window.location.search).not.toContain('sort=');
// Sort descending
await user.click(deltaButton);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
- 'regression.html: 1.135 %, 0.12, , 25.00%',
- 'improvement.html: 0.963 %, -0.05, , 50.00%',
- 'browser.html: 0.963 %, -0.04, -, 15.00%',
- 'dhtml.html: 1.135 %, 0.02, , 60.00%',
- 'tablemutation.html: 0.98 %, 0.01, -, 45.00%',
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
+ 'regression.html: +1.14%, 0.12, Real, 25.00%',
+ 'improvement.html: +1.14%, -0.05, Real, 50.00%',
+ 'browser.html: +1.14%, -0.04, Noise, 15.00%',
+ 'dhtml.html: +1.14%, 0.02, Real, 60.00%',
+ 'tablemutation.html: +0.98%, 0.01, -, 45.00%',
]);
// It should have the "descending" SVG.
@@ -556,12 +574,12 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', (
// Sort ascending
await user.click(deltaButton);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
- 'tablemutation.html: 0.98 %, 0.01, -, 45.00%',
- 'dhtml.html: 1.135 %, 0.02, , 60.00%',
- 'browser.html: 0.963 %, -0.04, -, 15.00%',
- 'improvement.html: 0.963 %, -0.05, , 50.00%',
- 'regression.html: 1.135 %, 0.12, , 25.00%',
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
+ 'tablemutation.html: +0.98%, 0.01, -, 45.00%',
+ 'dhtml.html: +1.14%, 0.02, Real, 60.00%',
+ 'browser.html: +1.14%, -0.04, Noise, 15.00%',
+ 'improvement.html: +1.14%, -0.05, Real, 50.00%',
+ 'regression.html: +1.14%, 0.12, Real, 25.00%',
]);
// It should have the "ascending" SVG.
expect(deltaButton).toMatchSnapshot();
@@ -573,12 +591,12 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', (
name: /Sig.*sort/,
});
await user.click(significanceButton);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
- 'browser.html: 0.963 %, -0.04, -, 15.00%',
- 'tablemutation.html: 0.98 %, 0.01, -, 45.00%',
- 'dhtml.html: 1.135 %, 0.02, , 60.00%',
- 'regression.html: 1.135 %, 0.12, , 25.00%',
- 'improvement.html: 0.963 %, -0.05, , 50.00%',
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
+ 'browser.html: +1.14%, -0.04, Noise, 15.00%',
+ 'tablemutation.html: +0.98%, 0.01, -, 45.00%',
+ 'dhtml.html: +1.14%, 0.02, Real, 60.00%',
+ 'regression.html: +1.14%, 0.12, Real, 25.00%',
+ 'improvement.html: +1.14%, -0.05, Real, 50.00%',
]);
// It should have the "no sort" SVG.
expect(deltaButton).toMatchSnapshot();
@@ -589,26 +607,26 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', (
// Sort by Significance ascending
await user.click(significanceButton);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
- 'improvement.html: 0.963 %, -0.05, , 50.00%',
- 'regression.html: 1.135 %, 0.12, , 25.00%',
- 'dhtml.html: 1.135 %, 0.02, , 60.00%',
- 'tablemutation.html: 0.98 %, 0.01, -, 45.00%',
- 'browser.html: 0.963 %, -0.04, -, 15.00%',
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
+ 'improvement.html: +1.14%, -0.05, Real, 50.00%',
+ 'regression.html: +1.14%, 0.12, Real, 25.00%',
+ 'dhtml.html: +1.14%, 0.02, Real, 60.00%',
+ 'tablemutation.html: +0.98%, 0.01, -, 45.00%',
+ 'browser.html: +1.14%, -0.04, Noise, 15.00%',
]);
expectParameterToHaveValue('sort', 'significance|asc');
// Sort by Effect Size descending
const effectButton = screen.getByRole('button', {
- name: /CLES \(%\).*sort/,
+ name: /CLES %.*sort/,
});
await user.click(effectButton);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
- 'browser.html: 0.963 %, -0.04, -, 15.00%',
- 'regression.html: 1.135 %, 0.12, , 25.00%',
- 'dhtml.html: 1.135 %, 0.02, , 60.00%',
- 'tablemutation.html: 0.98 %, 0.01, -, 45.00%',
- 'improvement.html: 0.963 %, -0.05, , 50.00%',
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
+ 'browser.html: +1.14%, -0.04, Noise, 15.00%',
+ 'regression.html: +1.14%, 0.12, Real, 25.00%',
+ 'dhtml.html: +1.14%, 0.02, Real, 60.00%',
+ 'tablemutation.html: +0.98%, 0.01, -, 45.00%',
+ 'improvement.html: +1.14%, -0.05, Real, 50.00%',
]);
// It should have the "descending" SVG.
@@ -618,12 +636,12 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', (
// Sort by Effect Size ascending
await user.click(effectButton);
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
- 'improvement.html: 0.963 %, -0.05, , 50.00%',
- 'tablemutation.html: 0.98 %, 0.01, -, 45.00%',
- 'dhtml.html: 1.135 %, 0.02, , 60.00%',
- 'regression.html: 1.135 %, 0.12, , 25.00%',
- 'browser.html: 0.963 %, -0.04, -, 15.00%',
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
+ 'improvement.html: +1.14%, -0.05, Real, 50.00%',
+ 'tablemutation.html: +0.98%, 0.01, -, 45.00%',
+ 'dhtml.html: +1.14%, 0.02, Real, 60.00%',
+ 'regression.html: +1.14%, 0.12, Real, 25.00%',
+ 'browser.html: +1.14%, -0.04, Noise, 15.00%',
]);
expectParameterToHaveValue('sort', 'effects|asc');
});
@@ -631,12 +649,12 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', (
it('initializes the sort from the URL at load time for an ascending sort', async () => {
await setupForSorting({ extraParameters: 'sort=delta|asc' });
await screen.findByText('dhtml.html');
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
- 'tablemutation.html: 0.98 %, 0.01, -, 45.00%',
- 'dhtml.html: 1.135 %, 0.02, , 60.00%',
- 'browser.html: 0.963 %, -0.04, -, 15.00%',
- 'improvement.html: 0.963 %, -0.05, , 50.00%',
- 'regression.html: 1.135 %, 0.12, , 25.00%',
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
+ 'tablemutation.html: +0.98%, 0.01, -, 45.00%',
+ 'dhtml.html: +1.14%, 0.02, Real, 60.00%',
+ 'browser.html: +1.14%, -0.04, Noise, 15.00%',
+ 'improvement.html: +1.14%, -0.05, Real, 50.00%',
+ 'regression.html: +1.14%, 0.12, Real, 25.00%',
]);
// It should have the "ascending" SVG.
expect(screen.getByRole('button', { name: /CD/ })).toMatchSnapshot();
@@ -645,12 +663,12 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', (
it('initializes the sort from the URL at load time for an implicit descending sort', async () => {
await setupForSorting({ extraParameters: 'sort=delta' });
await screen.findByText('dhtml.html');
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
- 'regression.html: 1.135 %, 0.12, , 25.00%',
- 'improvement.html: 0.963 %, -0.05, , 50.00%',
- 'browser.html: 0.963 %, -0.04, -, 15.00%',
- 'dhtml.html: 1.135 %, 0.02, , 60.00%',
- 'tablemutation.html: 0.98 %, 0.01, -, 45.00%',
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
+ 'regression.html: +1.14%, 0.12, Real, 25.00%',
+ 'improvement.html: +1.14%, -0.05, Real, 50.00%',
+ 'browser.html: +1.14%, -0.04, Noise, 15.00%',
+ 'dhtml.html: +1.14%, 0.02, Real, 60.00%',
+ 'tablemutation.html: +0.98%, 0.01, -, 45.00%',
]);
// It should have the "descending" SVG.
expect(screen.getByRole('button', { name: /CD/ })).toMatchSnapshot();
@@ -658,12 +676,12 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', (
it('initializes the sort from the URL at load time for a descending sort', async () => {
await setupForSorting({ extraParameters: 'sort=delta|desc' });
- expect(summarizeVisibleRows('mann-whitney-u')).toEqual([
- 'regression.html: 1.135 %, 0.12, , 25.00%',
- 'improvement.html: 0.963 %, -0.05, , 50.00%',
- 'browser.html: 0.963 %, -0.04, -, 15.00%',
- 'dhtml.html: 1.135 %, 0.02, , 60.00%',
- 'tablemutation.html: 0.98 %, 0.01, -, 45.00%',
+ expect(summarizeVisibleRows('mann-whitney-u', true)).toEqual([
+ 'regression.html: +1.14%, 0.12, Real, 25.00%',
+ 'improvement.html: +1.14%, -0.05, Real, 50.00%',
+ 'browser.html: +1.14%, -0.04, Noise, 15.00%',
+ 'dhtml.html: +1.14%, 0.02, Real, 60.00%',
+ 'tablemutation.html: +0.98%, 0.01, -, 45.00%',
]);
// It should have the "descending" SVG.
expect(screen.getByRole('button', { name: /CD/ })).toMatchSnapshot();
diff --git a/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx b/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx
index d8941e030..1b328e56a 100644
--- a/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx
+++ b/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx
@@ -7,7 +7,11 @@ import { loader } from '../../components/CompareResults/loader';
import SubtestsRevisionRow from '../../components/CompareResults/SubtestsResults/SubtestsRevisionRow';
import { MannWhitneyResultsItem } from '../../types/state';
import getTestData from '../utils/fixtures';
-import { screen, renderWithRouter } from '../utils/test-utils';
+import {
+ screen,
+ renderWithRouter,
+ enableAdvancedColumns,
+} from '../utils/test-utils';
function renderWithRoute(component: ReactElement) {
fetchMock
@@ -178,6 +182,7 @@ describe('SubtestsRevisionRow Component', () => {
});
it('should display cliffs delta, significance, and effects size in subtests for mann-whitney-u testVersion', async () => {
+ enableAdvancedColumns();
const { subtestsMannWhitneyResult } = getTestData();
const mockGridTemplateColumns = '1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr';
renderWithRoute(
@@ -194,7 +199,7 @@ describe('SubtestsRevisionRow Component', () => {
expect(effects).toHaveTextContent('60.00%');
const significanceCell = roles[8];
- expect(significanceCell?.querySelector('svg')).not.toBeNull();
+ expect(significanceCell).toHaveTextContent('Real');
const cliffs_delta = roles[6]?.childNodes[1];
expect(cliffs_delta).toHaveTextContent('0.02');
@@ -213,7 +218,7 @@ describe('SubtestsRevisionRow Component', () => {
);
const roles = await screen.findAllByRole('cell');
- const status = roles[5]?.childNodes[0];
+ const status = roles[5]?.querySelector('.status-hint');
expect(status).toHaveTextContent('Regression');
expect(status).toHaveClass('status-hint-regression');
});
@@ -231,7 +236,7 @@ describe('SubtestsRevisionRow Component', () => {
);
const roles1 = await screen.findAllByRole('cell');
- const status1 = roles1[5]?.childNodes[0];
+ const status1 = roles1[5]?.querySelector('.status-hint');
expect(status1).toHaveTextContent('Improvement');
expect(status1).toHaveClass('status-hint-improvement');
});
@@ -253,7 +258,7 @@ describe('SubtestsRevisionRow Component', () => {
};
}
- it('shows dash when neither distribution is normal', async () => {
+ it('shows value with warning icon when neither distribution is normal', async () => {
renderWithRoute(
{
/>,
);
const roles = await screen.findAllByRole('cell');
- expect(roles[4]).toHaveTextContent('-');
+ // The median difference is rank-based, so it's shown even for non-normal
+ // data; only a warning icon flags the shape.
+ expect(roles[4]).toHaveTextContent('%');
+ expect(roles[4].querySelector('svg[role="img"]')).toBeTruthy();
});
it('shows value with warning icon when only one distribution is normal', async () => {
@@ -276,7 +284,7 @@ describe('SubtestsRevisionRow Component', () => {
/>,
);
const roles = await screen.findAllByRole('cell');
- expect(roles[4]).not.toHaveTextContent('-');
+ expect(roles[4]).toHaveTextContent('%');
expect(roles[4].querySelector('svg[role="img"]')).toBeTruthy();
});
@@ -290,7 +298,7 @@ describe('SubtestsRevisionRow Component', () => {
/>,
);
const roles = await screen.findAllByRole('cell');
- expect(roles[4]).not.toHaveTextContent('-');
+ expect(roles[4]).toHaveTextContent('%');
expect(roles[4].querySelector('svg[role="img"]')).toBeFalsy();
});
});
diff --git a/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap b/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap
index dbd059e14..128181692 100644
--- a/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap
+++ b/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap
@@ -52,7 +52,7 @@ exports[`Results View The table should match snapshot and other elements should
aria-invalid="false"
aria-label="Search by title, platform, revision or options"
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall MuiInputBase-inputAdornedStart MuiInputBase-inputAdornedEnd css-3v3un6-MuiInputBase-input-MuiOutlinedInput-input"
- id="_r_a_"
+ id="_r_b_"
placeholder="Filter results"
type="search"
value=""
@@ -217,7 +217,7 @@ exports[`Results View The table should match snapshot and other elements should
@@ -417,12 +484,12 @@ exports[`Results View The table should match snapshot and other elements should
role="columnheader"
>
- Not sorted by MD (%)
+ Not sorted by Δ Median %
- MD (%)
+ Δ Median %
@@ -479,70 +546,6 @@ exports[`Results View The table should match snapshot and other elements should
-
-