diff --git a/src/__tests__/CompareResults/ResultsTable.test.tsx b/src/__tests__/CompareResults/ResultsTable.test.tsx index c663ada1d..5fb5c3adb 100644 --- a/src/__tests__/CompareResults/ResultsTable.test.tsx +++ b/src/__tests__/CompareResults/ResultsTable.test.tsx @@ -85,7 +85,7 @@ function summarizeVisibleRows(testVersion?: TestVersion) { testVersion === 'mann-whitney-u' ? [ '.platform span', - '.median-diff', + '.mode-delta', '.status', '.delta', '.significance', @@ -722,9 +722,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).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, -, 25.00 %', ' rev: devilrabbit', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 0.1, -, 25.00 %', ]); expect(screen.getByRole('rowgroup')).toMatchSnapshot(); }); @@ -748,12 +748,12 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await screen.findByText('a11yr'); expect(summarizeVisibleRows('mann-whitney-u')).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, -, 25.00 %', + ' - inexistant, ~1.08 %, Improvement, 0.1, -, 25.00 %', + ' - Linux 18.04, ~1.85 %, Regression, -, -, 45.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 0.1, -, 25.00 %', + ' - Windows 10, ~0.00 %, , -, , 100.00 %', + ' - Windows 10, ~-2.40 %, , -, , 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); @@ -762,9 +762,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Windows/); expect(summarizeVisibleRows('mann-whitney-u')).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, -, 25.00 %', + ' - Linux 18.04, ~1.85 %, Regression, -, -, 45.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 0.1, -, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['osx', 'linux', 'android', 'ios'], @@ -775,12 +775,12 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Windows/); expect(summarizeVisibleRows('mann-whitney-u')).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, -, 25.00 %', + ' - inexistant, ~1.08 %, Improvement, 0.1, -, 25.00 %', + ' - Linux 18.04, ~1.85 %, Regression, -, -, 45.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 0.1, -, 25.00 %', + ' - Windows 10, ~0.00 %, , -, , 100.00 %', + ' - Windows 10, ~-2.40 %, , -, , 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); @@ -788,8 +788,8 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Linux/); expect(summarizeVisibleRows('mann-whitney-u')).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, -, 25.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 0.1, -, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['osx', 'android', 'ios'], @@ -798,9 +798,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Linux/); expect(summarizeVisibleRows('mann-whitney-u')).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, -, 25.00 %', + ' - Linux 18.04, ~1.85 %, Regression, -, -, 45.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 0.1, -, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['osx', 'android', 'ios', 'linux'], @@ -809,22 +809,22 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', 'Select all values'); expect(summarizeVisibleRows('mann-whitney-u')).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, -, 25.00 %', + ' - inexistant, ~1.08 %, Improvement, 0.1, -, 25.00 %', + ' - Linux 18.04, ~1.85 %, Regression, -, -, 45.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 0.1, -, 25.00 %', + ' - Windows 10, ~0.00 %, , -, , 100.00 %', + ' - Windows 10, ~-2.40 %, , -, , 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); await clickMenuItem(user, 'Platform', /macOS/); expect(summarizeVisibleRows('mann-whitney-u')).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, -, 25.00 %', + ' - Linux 18.04, ~1.85 %, Regression, -, -, 45.00 %', + ' - Windows 10, ~0.00 %, , -, , 100.00 %', + ' - Windows 10, ~-2.40 %, , -, , 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['windows', 'linux', 'android', 'ios'], @@ -833,9 +833,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Android/); expect(summarizeVisibleRows('mann-whitney-u')).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, -, -, 45.00 %', + ' - Windows 10, ~0.00 %, , -, , 100.00 %', + ' - Windows 10, ~-2.40 %, , -, , 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['windows', 'linux', 'ios'], @@ -844,7 +844,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Platform', /Select only.*Android/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - Android, ~1.08 %, Improvement, 0.1, -, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['android'], @@ -883,10 +883,10 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await screen.findByText('a11yr'); expect(summarizeVisibleRows('mann-whitney-u')).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, -, -, 45.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 0.1, -, 25.00 %', + ' - Windows 10, ~0.00 %, , -, , 100.00 %', + ' - Windows 10, ~-2.40 %, , -, , 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); @@ -894,8 +894,8 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /No changes/); expect(summarizeVisibleRows('mann-whitney-u')).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, -, -, 45.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 0.1, -, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['improvement', 'regression'], @@ -904,7 +904,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Improvement/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', + ' - Linux 18.04, ~1.85 %, Regression, -, -, 45.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['regression'], @@ -914,9 +914,9 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Regression/); expect(summarizeVisibleRows('mann-whitney-u')).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, -, 25.00 %', + ' - Windows 10, ~0.00 %, , -, , 100.00 %', + ' - Windows 10, ~-2.40 %, , -, , 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['none', 'improvement'], @@ -925,17 +925,17 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Regression/); expect(summarizeVisibleRows('mann-whitney-u')).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, -, -, 45.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 0.1, -, 25.00 %', + ' - Windows 10, ~0.00 %, , -, , 100.00 %', + ' - Windows 10, ~-2.40 %, , -, , 50.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({}); await clickMenuItem(user, 'Status', /Select only.*Regression/); expect(summarizeVisibleRows('mann-whitney-u')).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, 1.849 %, Regression, -, -, 45.00 %', + ' - Linux 18.04, ~1.85 %, Regression, -, -, 45.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['regression'], @@ -944,7 +944,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio await clickMenuItem(user, 'Status', /Select only.*Improvement/); expect(summarizeVisibleRows('mann-whitney-u')).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, -, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['improvement'], @@ -961,7 +961,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).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, -, 25.00 %', ]); const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime }); expect(await summarizeTableFiltersFromCheckboxes(user)).toEqual({ @@ -997,26 +997,26 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).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, -, 44.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 1.3, -, 24.00 %', + ' - Windows 10, ~0.00 %, , 1.2, , 99.00 %', + ' - Windows 10, ~-2.40 %, , 1.2, , 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, -, 43.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 2.1, -, 23.00 %', + ' - Windows 10, ~0.00 %, , 2, , 98.00 %', + ' - Windows 10, ~-2.40 %, , 2, , 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, -, -, 45.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 0.1, -, 25.00 %', + ' - Windows 10, ~0.00 %, , -, , 100.00 %', + ' - Windows 10, ~-2.40 %, , -, , 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, -, 44.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 0.9, -, 24.00 %', + ' - Windows 10, ~0.00 %, , 0.8, , 99.00 %', + ' - Windows 10, ~-2.40 %, , 0.8, , 49.00 %', ]); // It should have the "descending" SVG. expect(deltaButton).toMatchSnapshot(); @@ -1028,26 +1028,26 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).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, -, 23.00 %', + ' - Linux 18.04, ~1.85 %, Regression, 2, -, 43.00 %', + ' - Windows 10, ~-2.40 %, , 2, , 48.00 %', + ' - Windows 10, ~0.00 %, , 2, , 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, -, 24.00 %', + ' - Linux 18.04, ~1.85 %, Regression, 1.2, -, 44.00 %', + ' - Windows 10, ~-2.40 %, , 1.2, , 49.00 %', + ' - Windows 10, ~0.00 %, , 1.2, , 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, -, 24.00 %', + ' - Linux 18.04, ~1.85 %, Regression, 0.8, -, 44.00 %', + ' - Windows 10, ~-2.40 %, , 0.8, , 49.00 %', + ' - Windows 10, ~0.00 %, , 0.8, , 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, -, 25.00 %', + ' - Linux 18.04, ~1.85 %, Regression, -, -, 45.00 %', + ' - Windows 10, ~-2.40 %, , -, , 50.00 %', + ' - Windows 10, ~0.00 %, , -, , 100.00 %', ]); // It should have the "ascending" SVG. expect(deltaButton).toMatchSnapshot(); @@ -1062,26 +1062,26 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).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, -, 23.00 %', + ' - Linux 18.04, ~1.85 %, Regression, 2, -, 43.00 %', + ' - Windows 10, ~0.00 %, , 2, , 98.00 %', + ' - Windows 10, ~-2.40 %, , 2, , 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, -, 24.00 %', + ' - Linux 18.04, ~1.85 %, Regression, 1.2, -, 44.00 %', + ' - Windows 10, ~0.00 %, , 1.2, , 99.00 %', + ' - Windows 10, ~-2.40 %, , 1.2, , 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, -, 24.00 %', + ' - Linux 18.04, ~1.85 %, Regression, 0.8, -, 44.00 %', + ' - Windows 10, ~0.00 %, , 0.8, , 99.00 %', + ' - Windows 10, ~-2.40 %, , 0.8, , 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, -, 25.00 %', + ' - Linux 18.04, ~1.85 %, Regression, -, -, 45.00 %', + ' - Windows 10, ~0.00 %, , -, , 100.00 %', + ' - Windows 10, ~-2.40 %, , -, , 50.00 %', ]); // It should have the "descending" SVG. expect(significanceButton).toMatchSnapshot(); @@ -1093,26 +1093,26 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).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 %, , -, , 50.00 %', + ' - Windows 10, ~0.00 %, , -, , 100.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 0.1, -, 25.00 %', + ' - Linux 18.04, ~1.85 %, Regression, -, -, 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, , 49.00 %', + ' - Windows 10, ~0.00 %, , 0.8, , 99.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 0.9, -, 24.00 %', + ' - Linux 18.04, ~1.85 %, Regression, 0.8, -, 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, , 49.00 %', + ' - Windows 10, ~0.00 %, , 1.2, , 99.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 1.3, -, 24.00 %', + ' - Linux 18.04, ~1.85 %, Regression, 1.2, -, 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, , 48.00 %', + ' - Windows 10, ~0.00 %, , 2, , 98.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 2.1, -, 23.00 %', + ' - Linux 18.04, ~1.85 %, Regression, 2, -, 43.00 %', ]); // It should have the "descending" SVG. expect(significanceButton).toMatchSnapshot(); @@ -1127,26 +1127,26 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).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, ~0.00 %, , -, , 100.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 0.1, -, 25.00 %', + ' - Linux 18.04, ~1.85 %, Regression, -, -, 45.00 %', + ' - Windows 10, ~-2.40 %, , -, , 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.00 %, , 0.8, , 99.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 0.9, -, 24.00 %', + ' - Linux 18.04, ~1.85 %, Regression, 0.8, -, 44.00 %', + ' - Windows 10, ~-2.40 %, , 0.8, , 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, ~0.00 %, , 1.2, , 99.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 1.3, -, 24.00 %', + ' - Linux 18.04, ~1.85 %, Regression, 1.2, -, 44.00 %', + ' - Windows 10, ~-2.40 %, , 1.2, , 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, ~0.00 %, , 2, , 98.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 2.1, -, 23.00 %', + ' - Linux 18.04, ~1.85 %, Regression, 2, -, 43.00 %', + ' - Windows 10, ~-2.40 %, , 2, , 48.00 %', ]); expect(effectSizeButton).toMatchSnapshot(); @@ -1158,45 +1158,45 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio expect(summarizeVisibleRows('mann-whitney-u')).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 %, , -, , 50.00 %', + ' - Linux 18.04, ~1.85 %, Regression, -, -, 45.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 0.1, -, 25.00 %', + ' - Windows 10, ~0.00 %, , -, , 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, , 49.00 %', + ' - Linux 18.04, ~1.85 %, Regression, 0.8, -, 44.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 0.9, -, 24.00 %', + ' - Windows 10, ~0.00 %, , 0.8, , 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, , 49.00 %', + ' - Linux 18.04, ~1.85 %, Regression, 1.2, -, 44.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 1.3, -, 24.00 %', + ' - Windows 10, ~0.00 %, , 1.2, , 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, , 48.00 %', + ' - Linux 18.04, ~1.85 %, Regression, 2, -, 43.00 %', + ' - macOS 10.15, ~1.08 %, Improvement, 2.1, -, 23.00 %', + ' - Windows 10, ~0.00 %, , 2, , 98.00 %', ]); expect(effectSizeButton).toMatchSnapshot(); // It should be persisted in the URL expectParameterToHaveValue('sort', 'effects|asc'); - // Sort by MD(%) descending - const medianDiffButton = screen.getByRole('button', { - name: /MD \(%\).*sort/, + // Sort by Mode Δ (%) descending + const modeDeltaButton = screen.getByRole('button', { + name: /Mode .*sort/, }); - await user.click(medianDiffButton); + await user.click(modeDeltaButton); expect(summarizeVisibleRows('mann-whitney-u')).toMatchSnapshot(); - expect(medianDiffButton).toMatchSnapshot(); - expectParameterToHaveValue('sort', 'median-diff|desc'); + expect(modeDeltaButton).toMatchSnapshot(); + expectParameterToHaveValue('sort', 'mode-delta|desc'); - // Sort by MD(%) ascending - await user.click(medianDiffButton); + // Sort by Mode Δ (%) ascending + await user.click(modeDeltaButton); expect(summarizeVisibleRows('mann-whitney-u')).toMatchSnapshot(); - expect(medianDiffButton).toMatchSnapshot(); - expectParameterToHaveValue('sort', 'median-diff|asc'); + expect(modeDeltaButton).toMatchSnapshot(); + expectParameterToHaveValue('sort', 'mode-delta|asc'); }); it('should switch between Student-T and Mann-Whitney-U test versions', async () => { diff --git a/src/__tests__/CompareResults/RevisionRow.test.tsx b/src/__tests__/CompareResults/RevisionRow.test.tsx index ae86e4950..b33332cd3 100644 --- a/src/__tests__/CompareResults/RevisionRow.test.tsx +++ b/src/__tests__/CompareResults/RevisionRow.test.tsx @@ -4,7 +4,6 @@ import fetchMock from '@fetch-mock/jest'; import userEvent from '@testing-library/user-event'; import { compareView } from '../../common/constants'; -import { isDistributionNormal } from '../../common/testVersions/mannWhitney'; import { loader } from '../../components/CompareResults/loader'; import RevisionRow from '../../components/CompareResults/RevisionRow'; import { useSubtestRegressionCount } from '../../hooks/useSubtestRegressionCount'; @@ -524,76 +523,6 @@ describe('Expanded row', () => { expect(writeTextMock).toHaveBeenCalledWith(baseRuns); }); - - describe('median diff column normality gating', () => { - const normalRuns = [5.1, 5.2, 4.9, 5.0, 5.05]; - const tooFewRuns = [5.0]; - - function makeResult( - baseRuns: number[], - newRuns: number[], - ): MannWhitneyResultsItem { - const { testCompareMannWhitneyData } = getTestData(); - return { - ...testCompareMannWhitneyData[0], - base_runs: baseRuns, - new_runs: newRuns, - }; - } - - it('shows dash when neither distribution is normal', async () => { - const result = makeResult(tooFewRuns, tooFewRuns); - expect(isDistributionNormal(result)).toBe(false); - renderWithRoute( - , - ); - const roles = await screen.findAllByRole('cell'); - expect(roles[4]).toHaveTextContent('-'); - }); - - it('shows value with warning icon when only one distribution is normal', async () => { - const result = makeResult(normalRuns, tooFewRuns); - expect(isDistributionNormal(result)).toBe(true); - renderWithRoute( - , - ); - const roles = await screen.findAllByRole('cell'); - expect(roles[4]).not.toHaveTextContent('-'); - expect(roles[4].querySelector('svg[role="img"]')).toBeTruthy(); - }); - - it('shows value without warning icon when both distributions are normal', async () => { - const result = makeResult(normalRuns, normalRuns); - expect(isDistributionNormal(result)).toBe(true); - renderWithRoute( - , - ); - const roles = await screen.findAllByRole('cell'); - expect(roles[4]).not.toHaveTextContent('-'); - expect(roles[4].querySelector('svg[role="img"]')).toBeFalsy(); - }); - }); }); describe('expandAll prop', () => { diff --git a/src/__tests__/CompareResults/SubtestsResultsView.test.tsx b/src/__tests__/CompareResults/SubtestsResultsView.test.tsx index 87e1b9081..7e7c516eb 100644 --- a/src/__tests__/CompareResults/SubtestsResultsView.test.tsx +++ b/src/__tests__/CompareResults/SubtestsResultsView.test.tsx @@ -59,7 +59,7 @@ function summarizeVisibleRows(testVersion?: TestVersion) { } const rowClasses = testVersion === 'mann-whitney-u' - ? ['.median-diff', '.delta', '.significance', '.effects'] + ? ['.mode-delta', '.delta', '.significance', '.effects'] : ['.delta', '.confidence']; const rowString = rowClasses .map((selector) => row.querySelector(selector)?.textContent.trim()) @@ -527,11 +527,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( 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%', + 'browser.html: ~-1.43 %, -0.04, -, 15.00%', + 'dhtml.html: ~1.14 %, 0.02, , 60.00%', + 'improvement.html: ~-1.44 %, -0.05, , 50.00%', + 'regression.html: ~1.04 %, 0.12, , 25.00%', + 'tablemutation.html: ~0.98 %, 0.01, -, 45.00%', ]); // Sort by Delta @@ -542,11 +542,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( // 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%', + 'regression.html: ~1.04 %, 0.12, , 25.00%', + 'improvement.html: ~-1.44 %, -0.05, , 50.00%', + 'browser.html: ~-1.43 %, -0.04, -, 15.00%', + 'dhtml.html: ~1.14 %, 0.02, , 60.00%', + 'tablemutation.html: ~0.98 %, 0.01, -, 45.00%', ]); // It should have the "descending" SVG. @@ -557,11 +557,11 @@ 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%', + 'tablemutation.html: ~0.98 %, 0.01, -, 45.00%', + 'dhtml.html: ~1.14 %, 0.02, , 60.00%', + 'browser.html: ~-1.43 %, -0.04, -, 15.00%', + 'improvement.html: ~-1.44 %, -0.05, , 50.00%', + 'regression.html: ~1.04 %, 0.12, , 25.00%', ]); // It should have the "ascending" SVG. expect(deltaButton).toMatchSnapshot(); @@ -574,11 +574,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( }); 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%', + 'browser.html: ~-1.43 %, -0.04, -, 15.00%', + 'tablemutation.html: ~0.98 %, 0.01, -, 45.00%', + 'dhtml.html: ~1.14 %, 0.02, , 60.00%', + 'regression.html: ~1.04 %, 0.12, , 25.00%', + 'improvement.html: ~-1.44 %, -0.05, , 50.00%', ]); // It should have the "no sort" SVG. expect(deltaButton).toMatchSnapshot(); @@ -590,11 +590,11 @@ 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%', + 'improvement.html: ~-1.44 %, -0.05, , 50.00%', + 'regression.html: ~1.04 %, 0.12, , 25.00%', + 'dhtml.html: ~1.14 %, 0.02, , 60.00%', + 'tablemutation.html: ~0.98 %, 0.01, -, 45.00%', + 'browser.html: ~-1.43 %, -0.04, -, 15.00%', ]); expectParameterToHaveValue('sort', 'significance|asc'); @@ -604,11 +604,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( }); 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%', + 'browser.html: ~-1.43 %, -0.04, -, 15.00%', + 'regression.html: ~1.04 %, 0.12, , 25.00%', + 'dhtml.html: ~1.14 %, 0.02, , 60.00%', + 'tablemutation.html: ~0.98 %, 0.01, -, 45.00%', + 'improvement.html: ~-1.44 %, -0.05, , 50.00%', ]); // It should have the "descending" SVG. @@ -619,11 +619,11 @@ 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%', + 'improvement.html: ~-1.44 %, -0.05, , 50.00%', + 'tablemutation.html: ~0.98 %, 0.01, -, 45.00%', + 'dhtml.html: ~1.14 %, 0.02, , 60.00%', + 'regression.html: ~1.04 %, 0.12, , 25.00%', + 'browser.html: ~-1.43 %, -0.04, -, 15.00%', ]); expectParameterToHaveValue('sort', 'effects|asc'); }); @@ -632,11 +632,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( 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%', + 'tablemutation.html: ~0.98 %, 0.01, -, 45.00%', + 'dhtml.html: ~1.14 %, 0.02, , 60.00%', + 'browser.html: ~-1.43 %, -0.04, -, 15.00%', + 'improvement.html: ~-1.44 %, -0.05, , 50.00%', + 'regression.html: ~1.04 %, 0.12, , 25.00%', ]); // It should have the "ascending" SVG. expect(screen.getByRole('button', { name: /CD/ })).toMatchSnapshot(); @@ -646,11 +646,11 @@ describe('SubtestsResultsView Component Tests for mann-whitney-u testVersion', ( 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%', + 'regression.html: ~1.04 %, 0.12, , 25.00%', + 'improvement.html: ~-1.44 %, -0.05, , 50.00%', + 'browser.html: ~-1.43 %, -0.04, -, 15.00%', + 'dhtml.html: ~1.14 %, 0.02, , 60.00%', + 'tablemutation.html: ~0.98 %, 0.01, -, 45.00%', ]); // It should have the "descending" SVG. expect(screen.getByRole('button', { name: /CD/ })).toMatchSnapshot(); @@ -659,11 +659,11 @@ 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%', + 'regression.html: ~1.04 %, 0.12, , 25.00%', + 'improvement.html: ~-1.44 %, -0.05, , 50.00%', + 'browser.html: ~-1.43 %, -0.04, -, 15.00%', + 'dhtml.html: ~1.14 %, 0.02, , 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..c6ca89d23 100644 --- a/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx +++ b/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx @@ -5,7 +5,6 @@ import userEvent from '@testing-library/user-event'; 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'; @@ -235,63 +234,4 @@ describe('SubtestsRevisionRow Component', () => { expect(status1).toHaveTextContent('Improvement'); expect(status1).toHaveClass('status-hint-improvement'); }); - - describe('median diff column normality gating', () => { - const normalRuns = [5.1, 5.2, 4.9, 5.0, 5.05]; - const tooFewRuns = [5.0]; - const mockGridTemplateColumns = '1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr'; - - function makeResult( - baseRuns: number[], - newRuns: number[], - ): MannWhitneyResultsItem { - const { subtestsMannWhitneyResult } = getTestData(); - return { - ...subtestsMannWhitneyResult[0], - base_runs: baseRuns, - new_runs: newRuns, - }; - } - - it('shows dash when neither distribution is normal', async () => { - renderWithRoute( - , - ); - const roles = await screen.findAllByRole('cell'); - expect(roles[4]).toHaveTextContent('-'); - }); - - it('shows value with warning icon when only one distribution is normal', async () => { - renderWithRoute( - , - ); - const roles = await screen.findAllByRole('cell'); - expect(roles[4]).not.toHaveTextContent('-'); - expect(roles[4].querySelector('svg[role="img"]')).toBeTruthy(); - }); - - it('shows value without warning icon when both distributions are normal', async () => { - renderWithRoute( - , - ); - const roles = await screen.findAllByRole('cell'); - expect(roles[4]).not.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..b35653ea9 100644 --- a/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap +++ b/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap @@ -346,7 +346,7 @@ exports[`Results View The table should match snapshot and other elements should
@@ -413,16 +413,16 @@ exports[`Results View The table should match snapshot and other elements should
@@ -458,6 +469,17 @@ exports[`Results View The table should match snapshot and other elements should type="button" > Status +
CD +
@@ -540,6 +573,17 @@ exports[`Results View The table should match snapshot and other elements should CLES (%) + @@ -581,6 +625,17 @@ exports[`Results View The table should match snapshot and other elements should type="button" > Sig +
- - 0 % - + ~1.85 %
- - 0 % - + ~1.08 %
- - 0 % - + ~-24.00 %
- - 0 % - + ~-2.40 %
@@ -1386,16 +1386,16 @@ exports[`Results Table Should match snapshot 1`] = `
@@ -1431,6 +1442,17 @@ exports[`Results Table Should match snapshot 1`] = ` type="button" > Status +
CD +
@@ -1513,6 +1546,17 @@ exports[`Results Table Should match snapshot 1`] = ` CLES (%) +
@@ -1554,6 +1598,17 @@ exports[`Results Table Should match snapshot 1`] = ` type="button" > Sig +
- - 0 % - + ~1.85 %
- - 0 % - + ~1.08 %
- - 0 % - + ~-2.40 %
- - 0 % - + ~-24.00 %
@@ -4269,16 +4308,16 @@ exports[`Results Table for MannWhitneyResultsItem for mann-whitney-u testVersion
@@ -4314,6 +4364,17 @@ exports[`Results Table for MannWhitneyResultsItem for mann-whitney-u testVersion type="button" > Status +
CD +
@@ -4396,6 +4468,17 @@ exports[`Results Table for MannWhitneyResultsItem for mann-whitney-u testVersion CLES (%) +
@@ -4437,6 +4520,17 @@ exports[`Results Table for MannWhitneyResultsItem for mann-whitney-u testVersion type="button" > Sig +
- - 1.849 % - + ~1.85 %
- - 1.078 % - + ~1.08 %
- - -2.401 % - + ~-2.40 %
- - + ~0.00 %
CD + `; @@ -5589,6 +5682,17 @@ exports[`Results Table for MannWhitneyResultsItem for mann-whitney-u testVersion CD + `; @@ -5614,6 +5718,17 @@ exports[`Results Table for MannWhitneyResultsItem for mann-whitney-u testVersion CD + @@ -5755,6 +5870,17 @@ exports[`Results Table for MannWhitneyResultsItem for mann-whitney-u testVersion CLES (%) + @@ -5800,6 +5926,17 @@ exports[`Results Table for MannWhitneyResultsItem for mann-whitney-u testVersion CLES (%) + @@ -5835,32 +5972,32 @@ exports[`Results Table for MannWhitneyResultsItem for mann-whitney-u testVersion [ "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 %", + " - macOS 10.15, No modes, Improvement, 0.1, -, 25.00 %", + " - Linux 18.04, No modes, Regression, -, -, 45.00 %", + " - Windows 10, No modes, , -, , 50.00 %", + " - Windows 10, No modes, , -, , 100.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 %", + " - macOS 10.15, No modes, Improvement, 0.9, -, 24.00 %", + " - Linux 18.04, No modes, Regression, 0.8, -, 44.00 %", + " - Windows 10, No modes, , 0.8, , 49.00 %", + " - Windows 10, No modes, , 0.8, , 99.00 %", "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 %", + " - macOS 10.15, No modes, Improvement, 1.3, -, 24.00 %", + " - Linux 18.04, No modes, Regression, 1.2, -, 44.00 %", + " - Windows 10, No modes, , 1.2, , 49.00 %", + " - Windows 10, No modes, , 1.2, , 99.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 %", + " - macOS 10.15, No modes, Improvement, 2.1, -, 23.00 %", + " - Linux 18.04, No modes, Regression, 2, -, 43.00 %", + " - Windows 10, No modes, , 2, , 48.00 %", + " - Windows 10, No modes, , 2, , 98.00 %", ] `; exports[`Results Table for MannWhitneyResultsItem for mann-whitney-u testVersion can sort params from the URL on mann-whitney-u test_version 9`] = `