diff --git a/src/__tests__/CompareResults/ResultsTable.test.tsx b/src/__tests__/CompareResults/ResultsTable.test.tsx index c663ada1d..d0e2c9615 100644 --- a/src/__tests__/CompareResults/ResultsTable.test.tsx +++ b/src/__tests__/CompareResults/ResultsTable.test.tsx @@ -203,9 +203,9 @@ describe('Results Table', () => { expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', - ' - macOS 10.15, Improvement, 1.08 %, Low', + ' - macOS 10.15, Improvement, +1.08 %, Low', ' rev: devilrabbit', - ' - macOS 10.15, Improvement, 1.08 %, Low', + ' - macOS 10.15, Improvement, +1.08 %, Low', ]); expect(screen.getByRole('rowgroup')).toMatchSnapshot(); }); @@ -229,10 +229,10 @@ describe('Results Table', () => { await screen.findByText('a11yr'); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, Improvement, 1.08 %, Low', - ' - inexistant, Improvement, 1.08 %, Low', - ' - Linux 18.04, Regression, 1.85 %, Medium', - ' - macOS 10.15, Improvement, 1.08 %, Low', + ' - Android, Improvement, +1.08 %, Low', + ' - inexistant, Improvement, +1.08 %, Low', + ' - Linux 18.04, Regression, +1.85 %, Medium', + ' - macOS 10.15, Improvement, +1.08 %, Low', ' - Windows 10, -, -24 %, -', ' - Windows 10, -, -2.4 %, High', ]); @@ -243,9 +243,9 @@ describe('Results Table', () => { await clickMenuItem(user, 'Platform', /Windows/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, Improvement, 1.08 %, Low', - ' - Linux 18.04, Regression, 1.85 %, Medium', - ' - macOS 10.15, Improvement, 1.08 %, Low', + ' - Android, Improvement, +1.08 %, Low', + ' - Linux 18.04, Regression, +1.85 %, Medium', + ' - macOS 10.15, Improvement, +1.08 %, Low', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['osx', 'linux', 'android', 'ios'], @@ -256,10 +256,10 @@ describe('Results Table', () => { await clickMenuItem(user, 'Platform', /Windows/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, Improvement, 1.08 %, Low', - ' - inexistant, Improvement, 1.08 %, Low', - ' - Linux 18.04, Regression, 1.85 %, Medium', - ' - macOS 10.15, Improvement, 1.08 %, Low', + ' - Android, Improvement, +1.08 %, Low', + ' - inexistant, Improvement, +1.08 %, Low', + ' - Linux 18.04, Regression, +1.85 %, Medium', + ' - macOS 10.15, Improvement, +1.08 %, Low', ' - Windows 10, -, -24 %, -', ' - Windows 10, -, -2.4 %, High', ]); @@ -269,8 +269,8 @@ describe('Results Table', () => { await clickMenuItem(user, 'Platform', /Linux/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, Improvement, 1.08 %, Low', - ' - macOS 10.15, Improvement, 1.08 %, Low', + ' - Android, Improvement, +1.08 %, Low', + ' - macOS 10.15, Improvement, +1.08 %, Low', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['osx', 'android', 'ios'], @@ -279,9 +279,9 @@ describe('Results Table', () => { await clickMenuItem(user, 'Platform', /Linux/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, Improvement, 1.08 %, Low', - ' - Linux 18.04, Regression, 1.85 %, Medium', - ' - macOS 10.15, Improvement, 1.08 %, Low', + ' - Android, Improvement, +1.08 %, Low', + ' - Linux 18.04, Regression, +1.85 %, Medium', + ' - macOS 10.15, Improvement, +1.08 %, Low', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['osx', 'android', 'ios', 'linux'], @@ -290,10 +290,10 @@ describe('Results Table', () => { await clickMenuItem(user, 'Platform', 'Select all values'); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, Improvement, 1.08 %, Low', - ' - inexistant, Improvement, 1.08 %, Low', - ' - Linux 18.04, Regression, 1.85 %, Medium', - ' - macOS 10.15, Improvement, 1.08 %, Low', + ' - Android, Improvement, +1.08 %, Low', + ' - inexistant, Improvement, +1.08 %, Low', + ' - Linux 18.04, Regression, +1.85 %, Medium', + ' - macOS 10.15, Improvement, +1.08 %, Low', ' - Windows 10, -, -24 %, -', ' - Windows 10, -, -2.4 %, High', ]); @@ -302,8 +302,8 @@ describe('Results Table', () => { await clickMenuItem(user, 'Platform', /macOS/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, Improvement, 1.08 %, Low', - ' - Linux 18.04, Regression, 1.85 %, Medium', + ' - Android, Improvement, +1.08 %, Low', + ' - Linux 18.04, Regression, +1.85 %, Medium', ' - Windows 10, -, -24 %, -', ' - Windows 10, -, -2.4 %, High', ]); @@ -314,7 +314,7 @@ describe('Results Table', () => { await clickMenuItem(user, 'Platform', /Android/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, Regression, 1.85 %, Medium', + ' - Linux 18.04, Regression, +1.85 %, Medium', ' - Windows 10, -, -24 %, -', ' - Windows 10, -, -2.4 %, High', ]); @@ -325,7 +325,7 @@ describe('Results Table', () => { await clickMenuItem(user, 'Platform', /Select only.*Android/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Android, Improvement, 1.08 %, Low', + ' - Android, Improvement, +1.08 %, Low', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['android'], @@ -339,8 +339,8 @@ describe('Results Table', () => { await screen.findByText('a11yr'); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, Regression, 1.85 %, Medium', - ' - macOS 10.15, Improvement, 1.08 %, Low', + ' - Linux 18.04, Regression, +1.85 %, Medium', + ' - macOS 10.15, Improvement, +1.08 %, Low', ' - Windows 10, -, -24 %, -', ' - Windows 10, -, -2.4 %, High', ]); @@ -350,8 +350,8 @@ describe('Results Table', () => { await clickMenuItem(user, 'Status', /No changes/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, Regression, 1.85 %, Medium', - ' - macOS 10.15, Improvement, 1.08 %, Low', + ' - Linux 18.04, Regression, +1.85 %, Medium', + ' - macOS 10.15, Improvement, +1.08 %, Low', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['improvement', 'regression'], @@ -361,7 +361,7 @@ describe('Results Table', () => { await clickMenuItem(user, 'Status', /Improvement/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, Regression, 1.85 %, Medium', + ' - Linux 18.04, Regression, +1.85 %, Medium', ' - Windows 10, -, -24 %, -', ' - Windows 10, -, -2.4 %, High', ]); @@ -382,7 +382,7 @@ describe('Results Table', () => { await clickMenuItem(user, 'Status', /Select only.*Regression/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, Regression, 1.85 %, Medium', + ' - Linux 18.04, Regression, +1.85 %, Medium', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['regression'], @@ -396,8 +396,8 @@ describe('Results Table', () => { await screen.findByText('a11yr'); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, Regression, 1.85 %, Medium', - ' - macOS 10.15, Improvement, 1.08 %, Low', + ' - Linux 18.04, Regression, +1.85 %, Medium', + ' - macOS 10.15, Improvement, +1.08 %, Low', ' - Windows 10, -, -24 %, -', ' - Windows 10, -, -2.4 %, High', ]); @@ -407,7 +407,7 @@ describe('Results Table', () => { await clickMenuItem(user, 'Confidence', /Low/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, Regression, 1.85 %, Medium', + ' - Linux 18.04, Regression, +1.85 %, Medium', ' - Windows 10, -, -24 %, -', ' - Windows 10, -, -2.4 %, High', ]); @@ -418,7 +418,7 @@ describe('Results Table', () => { await clickMenuItem(user, 'Confidence', /High/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, Regression, 1.85 %, Medium', + ' - Linux 18.04, Regression, +1.85 %, Medium', ' - Windows 10, -, -24 %, -', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ @@ -437,8 +437,8 @@ describe('Results Table', () => { await clickMenuItem(user, 'Confidence', /Select all values/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, Regression, 1.85 %, Medium', - ' - macOS 10.15, Improvement, 1.08 %, Low', + ' - Linux 18.04, Regression, +1.85 %, Medium', + ' - macOS 10.15, Improvement, +1.08 %, Low', ' - Windows 10, -, -24 %, -', ' - Windows 10, -, -2.4 %, High', ]); @@ -447,8 +447,8 @@ describe('Results Table', () => { await clickMenuItem(user, 'Confidence', /No value/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, Regression, 1.85 %, Medium', - ' - macOS 10.15, Improvement, 1.08 %, Low', + ' - Linux 18.04, Regression, +1.85 %, Medium', + ' - macOS 10.15, Improvement, +1.08 %, Low', ' - Windows 10, -, -2.4 %, High', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ @@ -459,8 +459,8 @@ describe('Results Table', () => { await clickMenuItem(user, 'Confidence', /No value/); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, Regression, 1.85 %, Medium', - ' - macOS 10.15, Improvement, 1.08 %, Low', + ' - Linux 18.04, Regression, +1.85 %, Medium', + ' - macOS 10.15, Improvement, +1.08 %, Low', ' - Windows 10, -, -24 %, -', ' - Windows 10, -, -2.4 %, High', ]); @@ -486,7 +486,7 @@ describe('Results Table', () => { expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - macOS 10.15, Improvement, 1.08 %, Low', + ' - macOS 10.15, Improvement, +1.08 %, Low', ]); const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime }); expect(await summarizeTableFiltersFromCheckboxes(user)).toEqual({ @@ -514,24 +514,24 @@ describe('Results Table', () => { expect(summarizeVisibleRows()).toEqual([ 'a11yr aria.html opt e10s fission stylo webrender', ' rev: spam', - ' - Linux 18.04, Regression, 1.97 %, Medium', - ' - macOS 10.15, Improvement, 1.2 %, Low', + ' - Linux 18.04, Regression, +1.97 %, Medium', + ' - macOS 10.15, Improvement, +1.2 %, Low', ' - Windows 10, -, -23.88 %, -', ' - Windows 10, -, -2.28 %, High', ' rev: tictactoe', - ' - Linux 18.04, Regression, 2.05 %, Medium', - ' - macOS 10.15, Improvement, 1.28 %, Low', + ' - Linux 18.04, Regression, +2.05 %, Medium', + ' - macOS 10.15, Improvement, +1.28 %, Low', ' - Windows 10, -, -23.8 %, -', ' - Windows 10, -, -2.2 %, High', 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', - ' - Linux 18.04, Regression, 1.85 %, Medium', - ' - macOS 10.15, Improvement, 1.08 %, Low', + ' - Linux 18.04, Regression, +1.85 %, Medium', + ' - macOS 10.15, Improvement, +1.08 %, Low', ' - Windows 10, -, -24 %, -', ' - Windows 10, -, -2.4 %, High', ' rev: tictactoe', - ' - Linux 18.04, Regression, 1.93 %, Medium', - ' - macOS 10.15, Improvement, 1.16 %, Low', + ' - Linux 18.04, Regression, +1.93 %, Medium', + ' - macOS 10.15, Improvement, +1.16 %, Low', ' - Windows 10, -, -23.92 %, -', ' - Windows 10, -, -2.32 %, High', ]); @@ -548,24 +548,24 @@ describe('Results Table', () => { ' rev: spam', ' - Windows 10, -, -24 %, -', ' - Windows 10, -, -2.4 %, High', - ' - Linux 18.04, Regression, 1.85 %, Medium', - ' - macOS 10.15, Improvement, 1.08 %, Low', + ' - Linux 18.04, Regression, +1.85 %, Medium', + ' - macOS 10.15, Improvement, +1.08 %, Low', ' rev: tictactoe', ' - Windows 10, -, -23.92 %, -', ' - Windows 10, -, -2.32 %, High', - ' - Linux 18.04, Regression, 1.93 %, Medium', - ' - macOS 10.15, Improvement, 1.16 %, Low', + ' - Linux 18.04, Regression, +1.93 %, Medium', + ' - macOS 10.15, Improvement, +1.16 %, Low', 'a11yr aria.html opt e10s fission stylo webrender', ' rev: spam', ' - Windows 10, -, -23.88 %, -', ' - Windows 10, -, -2.28 %, High', - ' - Linux 18.04, Regression, 1.97 %, Medium', - ' - macOS 10.15, Improvement, 1.2 %, Low', + ' - Linux 18.04, Regression, +1.97 %, Medium', + ' - macOS 10.15, Improvement, +1.2 %, Low', ' rev: tictactoe', ' - Windows 10, -, -23.8 %, -', ' - Windows 10, -, -2.2 %, High', - ' - Linux 18.04, Regression, 2.05 %, Medium', - ' - macOS 10.15, Improvement, 1.28 %, Low', + ' - Linux 18.04, Regression, +2.05 %, Medium', + ' - macOS 10.15, Improvement, +1.28 %, Low', ]); // It should have the "descending" SVG. expect(deltaButton).toMatchSnapshot(); @@ -577,24 +577,24 @@ describe('Results Table', () => { expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: spam', - ' - macOS 10.15, Improvement, 1.08 %, Low', - ' - Linux 18.04, Regression, 1.85 %, Medium', + ' - macOS 10.15, Improvement, +1.08 %, Low', + ' - Linux 18.04, Regression, +1.85 %, Medium', ' - Windows 10, -, -2.4 %, High', ' - Windows 10, -, -24 %, -', ' rev: tictactoe', - ' - macOS 10.15, Improvement, 1.16 %, Low', - ' - Linux 18.04, Regression, 1.93 %, Medium', + ' - macOS 10.15, Improvement, +1.16 %, Low', + ' - Linux 18.04, Regression, +1.93 %, Medium', ' - Windows 10, -, -2.32 %, High', ' - Windows 10, -, -23.92 %, -', 'a11yr aria.html opt e10s fission stylo webrender', ' rev: spam', - ' - macOS 10.15, Improvement, 1.2 %, Low', - ' - Linux 18.04, Regression, 1.97 %, Medium', + ' - macOS 10.15, Improvement, +1.2 %, Low', + ' - Linux 18.04, Regression, +1.97 %, Medium', ' - Windows 10, -, -2.28 %, High', ' - Windows 10, -, -23.88 %, -', ' rev: tictactoe', - ' - macOS 10.15, Improvement, 1.28 %, Low', - ' - Linux 18.04, Regression, 2.05 %, Medium', + ' - macOS 10.15, Improvement, +1.28 %, Low', + ' - Linux 18.04, Regression, +2.05 %, Medium', ' - Windows 10, -, -2.2 %, High', ' - Windows 10, -, -23.8 %, -', ]); @@ -612,24 +612,24 @@ describe('Results Table', () => { 'a11yr aria.html opt e10s fission stylo webrender', ' rev: tictactoe', ' - Windows 10, -, -2.2 %, High', - ' - Linux 18.04, Regression, 2.05 %, Medium', - ' - macOS 10.15, Improvement, 1.28 %, Low', + ' - Linux 18.04, Regression, +2.05 %, Medium', + ' - macOS 10.15, Improvement, +1.28 %, Low', ' - Windows 10, -, -23.8 %, -', ' rev: spam', ' - Windows 10, -, -2.28 %, High', - ' - Linux 18.04, Regression, 1.97 %, Medium', - ' - macOS 10.15, Improvement, 1.2 %, Low', + ' - Linux 18.04, Regression, +1.97 %, Medium', + ' - macOS 10.15, Improvement, +1.2 %, Low', ' - Windows 10, -, -23.88 %, -', 'a11yr dhtml.html opt e10s fission stylo webrender', ' rev: tictactoe', ' - Windows 10, -, -2.32 %, High', - ' - Linux 18.04, Regression, 1.93 %, Medium', - ' - macOS 10.15, Improvement, 1.16 %, Low', + ' - Linux 18.04, Regression, +1.93 %, Medium', + ' - macOS 10.15, Improvement, +1.16 %, Low', ' - Windows 10, -, -23.92 %, -', ' rev: spam', ' - Windows 10, -, -2.4 %, High', - ' - Linux 18.04, Regression, 1.85 %, Medium', - ' - macOS 10.15, Improvement, 1.08 %, Low', + ' - Linux 18.04, Regression, +1.85 %, Medium', + ' - macOS 10.15, Improvement, +1.08 %, Low', ' - Windows 10, -, -24 %, -', ]); // It should have the "no sort" SVG. @@ -651,8 +651,8 @@ describe('Results Table', () => { expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - macOS 10.15, Improvement, 1.08 %, Low', - ' - Linux 18.04, Regression, 1.85 %, Medium', + ' - macOS 10.15, Improvement, +1.08 %, Low', + ' - Linux 18.04, Regression, +1.85 %, Medium', ' - Windows 10, -, -2.4 %, High', ' - Windows 10, -, -24 %, -', ]); @@ -662,8 +662,8 @@ describe('Results Table', () => { await user.click(deltaButton); expect(summarizeVisibleRows()).toEqual([ 'a11yr dhtml.html spam opt e10s fission stylo webrender', - ' - Linux 18.04, Regression, 1.85 %, Medium', - ' - macOS 10.15, Improvement, 1.08 %, Low', + ' - Linux 18.04, Regression, +1.85 %, Medium', + ' - macOS 10.15, Improvement, +1.08 %, Low', ' - Windows 10, -, -24 %, -', ' - Windows 10, -, -2.4 %, High', ]); @@ -683,8 +683,8 @@ describe('Results Table', () => { 'a11yr dhtml.html spam opt e10s fission stylo webrender', ' - Windows 10, -, -24 %, -', ' - Windows 10, -, -2.4 %, High', - ' - Linux 18.04, Regression, 1.85 %, Medium', - ' - macOS 10.15, Improvement, 1.08 %, Low', + ' - Linux 18.04, Regression, +1.85 %, Medium', + ' - macOS 10.15, Improvement, +1.08 %, Low', ]); }); }); @@ -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.078 %, Improvement, 0.1, -, 25.00 %', ' rev: devilrabbit', - ' - macOS 10.15, 1.078 %, Improvement, 0.1, -, 25.00 %', + ' - macOS 10.15, +1.078 %, Improvement, 0.1, -, 25.00 %', ]); expect(screen.getByRole('rowgroup')).toMatchSnapshot(); }); @@ -748,10 +748,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', - ' - 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 %', + ' - 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 %', ]); @@ -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.078 %, Improvement, 0.1, -, 25.00 %', + ' - Linux 18.04, +1.849 %, Regression, -, -, 45.00 %', + ' - macOS 10.15, +1.078 %, Improvement, 0.1, -, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['osx', 'linux', 'android', 'ios'], @@ -775,10 +775,10 @@ 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 %', + ' - 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 %', ]); @@ -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.078 %, Improvement, 0.1, -, 25.00 %', + ' - macOS 10.15, +1.078 %, 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.078 %, Improvement, 0.1, -, 25.00 %', + ' - Linux 18.04, +1.849 %, Regression, -, -, 45.00 %', + ' - macOS 10.15, +1.078 %, Improvement, 0.1, -, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['osx', 'android', 'ios', 'linux'], @@ -809,10 +809,10 @@ 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 %', + ' - 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 %', ]); @@ -821,8 +821,8 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio 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 %', + ' - 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 %', ]); @@ -833,7 +833,7 @@ 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 %', + ' - Linux 18.04, +1.849 %, Regression, -, -, 45.00 %', ' - Windows 10, -, , -, , 100.00 %', ' - Windows 10, -2.401 %, , -, , 50.00 %', ]); @@ -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.078 %, Improvement, 0.1, -, 25.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ platform: ['android'], @@ -883,8 +883,8 @@ 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 %', + ' - 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 %', ]); @@ -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.849 %, Regression, -, -, 45.00 %', + ' - macOS 10.15, +1.078 %, 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.849 %, Regression, -, -, 45.00 %', ]); expect(summarizeTableFiltersFromUrl()).toEqual({ status: ['regression'], @@ -914,7 +914,7 @@ 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 %', + ' - macOS 10.15, +1.078 %, Improvement, 0.1, -, 25.00 %', ' - Windows 10, -, , -, , 100.00 %', ' - Windows 10, -2.401 %, , -, , 50.00 %', ]); @@ -925,8 +925,8 @@ 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 %', + ' - 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 %', ]); @@ -935,7 +935,7 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio 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.849 %, 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.078 %, 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.078 %, Improvement, 0.1, -, 25.00 %', ]); const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime }); expect(await summarizeTableFiltersFromCheckboxes(user)).toEqual({ @@ -997,24 +997,24 @@ 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 %', + ' - 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 %', ' rev: tictactoe', - ' - Linux 18.04, 1.849 %, Regression, 2, -, 43.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 2.1, -, 23.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.401 %, , 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 %', + ' - 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 %', ' rev: tictactoe', - ' - Linux 18.04, 1.849 %, Regression, 0.8, -, 44.00 %', - ' - macOS 10.15, 1.078 %, Improvement, 0.9, -, 24.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.401 %, , 0.8, , 49.00 %', ]); @@ -1028,24 +1028,24 @@ 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 %', + ' - 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 %', ' rev: spam', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, -, 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 1.2, -, 44.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, , 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 %', + ' - 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 %', ' rev: spam', - ' - macOS 10.15, 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 %', + ' - Linux 18.04, +1.849 %, Regression, -, -, 45.00 %', ' - Windows 10, -2.401 %, , -, , 50.00 %', ' - Windows 10, -, , -, , 100.00 %', ]); @@ -1062,24 +1062,24 @@ 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 %', + ' - 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 %', ' rev: spam', - ' - macOS 10.15, 1.078 %, Improvement, 1.3, -, 24.00 %', - ' - Linux 18.04, 1.849 %, Regression, 1.2, -, 44.00 %', + ' - 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 %', '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 %', + ' - 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 %', ' rev: spam', - ' - macOS 10.15, 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 %', + ' - Linux 18.04, +1.849 %, Regression, -, -, 45.00 %', ' - Windows 10, -, , -, , 100.00 %', ' - Windows 10, -2.401 %, , -, , 50.00 %', ]); @@ -1095,24 +1095,24 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio ' 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 %', + ' - macOS 10.15, +1.078 %, Improvement, 0.1, -, 25.00 %', + ' - Linux 18.04, +1.849 %, 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 %', + ' - macOS 10.15, +1.078 %, Improvement, 0.9, -, 24.00 %', + ' - Linux 18.04, +1.849 %, 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 %', + ' - macOS 10.15, +1.078 %, Improvement, 1.3, -, 24.00 %', + ' - Linux 18.04, +1.849 %, 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 %', + ' - macOS 10.15, +1.078 %, Improvement, 2.1, -, 23.00 %', + ' - Linux 18.04, +1.849 %, Regression, 2, -, 43.00 %', ]); // It should have the "descending" SVG. expect(significanceButton).toMatchSnapshot(); @@ -1128,24 +1128,24 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio '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 %', + ' - macOS 10.15, +1.078 %, Improvement, 0.1, -, 25.00 %', + ' - Linux 18.04, +1.849 %, Regression, -, -, 45.00 %', ' - Windows 10, -2.401 %, , -, , 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 %', + ' - 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 %', '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 %', + ' - 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 %', ' 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 %', + ' - 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 %', ]); @@ -1159,24 +1159,24 @@ describe('Results Table for MannWhitneyResultsItem for mann-whitney-u testVersio '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 %', + ' - Linux 18.04, +1.849 %, Regression, -, -, 45.00 %', + ' - macOS 10.15, +1.078 %, Improvement, 0.1, -, 25.00 %', ' - Windows 10, -, , -, , 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 %', + ' - 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 %', '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 %', + ' - 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 %', ' 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 %', + ' - Linux 18.04, +1.849 %, Regression, 2, -, 43.00 %', + ' - macOS 10.15, +1.078 %, Improvement, 2.1, -, 23.00 %', ' - Windows 10, -, , 2, , 98.00 %', ]); expect(effectSizeButton).toMatchSnapshot(); diff --git a/src/__tests__/CompareResults/SubtestsResultsView.test.tsx b/src/__tests__/CompareResults/SubtestsResultsView.test.tsx index 87e1b9081..b7305b114 100644 --- a/src/__tests__/CompareResults/SubtestsResultsView.test.tsx +++ b/src/__tests__/CompareResults/SubtestsResultsView.test.tsx @@ -260,10 +260,10 @@ describe('SubtestsResultsView Component Tests', () => { // Initial view (alphabetical ordered, even if "sort by subtests" isn't specified expect(summarizeVisibleRows()).toEqual([ 'browser.html: -1.43 %, Low', - 'dhtml.html: 1.14 %, Low', + 'dhtml.html: +1.14 %, Low', 'improvement.html: -1.44 %, Low', - 'regression.html: 1.04 %, High', - 'tablemutation.html: 0.98 %, Low', + 'regression.html: +1.04 %, High', + 'tablemutation.html: +0.98 %, Low', ]); // Sort by Delta @@ -276,9 +276,9 @@ describe('SubtestsResultsView Component Tests', () => { expect(summarizeVisibleRows()).toEqual([ 'improvement.html: -1.44 %, Low', 'browser.html: -1.43 %, Low', - 'dhtml.html: 1.14 %, Low', - 'regression.html: 1.04 %, High', - 'tablemutation.html: 0.98 %, Low', + 'dhtml.html: +1.14 %, Low', + 'regression.html: +1.04 %, High', + 'tablemutation.html: +0.98 %, Low', ]); // It should have the "descending" SVG. expect(deltaButton).toMatchSnapshot(); @@ -288,9 +288,9 @@ describe('SubtestsResultsView Component Tests', () => { // Sort ascending await user.click(deltaButton); expect(summarizeVisibleRows()).toEqual([ - 'tablemutation.html: 0.98 %, Low', - 'regression.html: 1.04 %, High', - 'dhtml.html: 1.14 %, Low', + 'tablemutation.html: +0.98 %, Low', + 'regression.html: +1.04 %, High', + 'dhtml.html: +1.14 %, Low', 'browser.html: -1.43 %, Low', 'improvement.html: -1.44 %, Low', ]); @@ -305,11 +305,11 @@ describe('SubtestsResultsView Component Tests', () => { }); await user.click(confidenceButton); expect(summarizeVisibleRows()).toEqual([ - 'regression.html: 1.04 %, High', + 'regression.html: +1.04 %, High', 'improvement.html: -1.44 %, Low', 'browser.html: -1.43 %, Low', - 'dhtml.html: 1.14 %, Low', - 'tablemutation.html: 0.98 %, Low', + 'dhtml.html: +1.14 %, Low', + 'tablemutation.html: +0.98 %, Low', ]); // It should have the "no sort" SVG. expect(deltaButton).toMatchSnapshot(); @@ -322,10 +322,10 @@ describe('SubtestsResultsView Component Tests', () => { const subtestsButton = screen.getByRole('button', { name: /Subtests/ }); await user.click(subtestsButton); expect(summarizeVisibleRows()).toEqual([ - 'tablemutation.html: 0.98 %, Low', - 'regression.html: 1.04 %, High', + 'tablemutation.html: +0.98 %, Low', + 'regression.html: +1.04 %, High', 'improvement.html: -1.44 %, Low', - 'dhtml.html: 1.14 %, Low', + 'dhtml.html: +1.14 %, Low', 'browser.html: -1.43 %, Low', ]); // It should have the "no sort" SVG. @@ -345,9 +345,9 @@ describe('SubtestsResultsView Component Tests', () => { await setupForSorting({ extraParameters: 'sort=delta|asc' }); await screen.findByText('dhtml.html'); expect(summarizeVisibleRows()).toEqual([ - 'tablemutation.html: 0.98 %, Low', - 'regression.html: 1.04 %, High', - 'dhtml.html: 1.14 %, Low', + 'tablemutation.html: +0.98 %, Low', + 'regression.html: +1.04 %, High', + 'dhtml.html: +1.14 %, Low', 'browser.html: -1.43 %, Low', 'improvement.html: -1.44 %, Low', ]); @@ -361,9 +361,9 @@ describe('SubtestsResultsView Component Tests', () => { expect(summarizeVisibleRows()).toEqual([ 'improvement.html: -1.44 %, Low', 'browser.html: -1.43 %, Low', - 'dhtml.html: 1.14 %, Low', - 'regression.html: 1.04 %, High', - 'tablemutation.html: 0.98 %, Low', + 'dhtml.html: +1.14 %, Low', + 'regression.html: +1.04 %, High', + 'tablemutation.html: +0.98 %, Low', ]); // It should have the "descending" SVG. expect(screen.getByRole('button', { name: /Delta/ })).toMatchSnapshot(); @@ -374,9 +374,9 @@ describe('SubtestsResultsView Component Tests', () => { expect(summarizeVisibleRows()).toEqual([ 'improvement.html: -1.44 %, Low', 'browser.html: -1.43 %, Low', - 'dhtml.html: 1.14 %, Low', - 'regression.html: 1.04 %, High', - 'tablemutation.html: 0.98 %, Low', + 'dhtml.html: +1.14 %, Low', + 'regression.html: +1.04 %, High', + 'tablemutation.html: +0.98 %, Low', ]); // It should have the "descending" SVG. expect(screen.getByRole('button', { name: /Delta/ })).toMatchSnapshot(); @@ -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: +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%', ]); // 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.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%', ]); // 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.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%', ]); // 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: +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%', ]); // 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: +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%', ]); 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: +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%', ]); // 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: +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%', ]); 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.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%', ]); // 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.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%', ]); // 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.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%', ]); // 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..7f66a8707 100644 --- a/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx +++ b/src/__tests__/CompareResults/SubtestsRevisionRow.test.tsx @@ -40,7 +40,7 @@ describe('SubtestsRevisionRow Component', () => { await screen.findByText('dhtml.html'); expect(await screen.findByText('971.38 ms')).toBeInTheDocument(); expect(await screen.findByText('982.41 ms')).toBeInTheDocument(); - expect(await screen.findByText('1.14 %')).toBeInTheDocument(); + expect(await screen.findByText('+1.14 %')).toBeInTheDocument(); expect(await screen.findByText('Low')).toBeInTheDocument(); expect(document.body).toMatchSnapshot(); }); diff --git a/src/__tests__/CompareResults/__snapshots__/ResultsTable.test.tsx.snap b/src/__tests__/CompareResults/__snapshots__/ResultsTable.test.tsx.snap index 95b362d3d..063248e65 100644 --- a/src/__tests__/CompareResults/__snapshots__/ResultsTable.test.tsx.snap +++ b/src/__tests__/CompareResults/__snapshots__/ResultsTable.test.tsx.snap @@ -4653,7 +4653,7 @@ exports[`Results Table for MannWhitneyResultsItem for mann-whitney-u testVersion - 1.849 % + +1.849 %
- 1.078 % + +1.078 %
- 1.078 % + +1.078 %
- 1.078 % + +1.078 %
- 1.08 % + +1.08 %
- 1.08 % + +1.08 %
- 0.963 % + +0.963 %
- 1.135 % + +1.135 %
- 0.963 % + +0.963 %
- 1.135 % + +1.135 %
- 0.98 % + +0.98 %
- 0.963 % + +0.963 %
- 1.135 % + +1.135 %
- 0.963 % + +0.963 %
- 1.135 % + +1.135 %
- 0.98 % + +0.98 %
- 0.963 % + +0.963 %
- 1.135 % + +1.135 %
- 0.963 % + +0.963 %
- 1.135 % + +1.135 %
- 0.98 % + +0.98 %
- 1.14 % + +1.14 %
- 1.14 % + +1.14 %
- {`${formatNumber(pct)} %`} + {`${signPrefix(pct)}${formatNumber(pct)} %`} {normality === 'one' && ( - {`${formatNumber(medianDiffPct)} %`} + {`${signPrefix(medianDiffPct)}${formatNumber(medianDiffPct)} %`} {normality === 'one' && (
{' '} - {`${deltaPercent} % `} + {`${signPrefix(deltaPercent)}${deltaPercent} % `}
{confidenceText && confidenceIcons[confidenceText]} @@ -260,9 +260,13 @@ export const studentTStrategy = { baseMedian && newMedian ? formatTwoDigits.format(newMedian - baseMedian) : ''; + const medianPercentageNum = + baseMedian && newMedian + ? ((newMedian - baseMedian) / baseMedian) * 100 + : 0; const medianPercentage = baseMedian && newMedian - ? formatTwoDigits.format(((newMedian - baseMedian) / baseMedian) * 100) + ? formatTwoDigits.format(medianPercentageNum) : ''; const { confidenceNote } = Strings.components.expandableRow; @@ -270,13 +274,14 @@ export const studentTStrategy = { return ( <> - Difference of means: {deltaPercent}% ({formatNumber(delta)} + Difference of means: {signPrefix(deltaPercent)} + {deltaPercent}% ({formatNumber(delta)} {deltaUnit ? ' ' + deltaUnit : null}) {newMedian && baseMedian ? ( - Difference of medians: {medianPercentage}% ( - {medianDifference} + Difference of medians: {signPrefix(medianPercentageNum)} + {medianPercentage}% ({medianDifference} {deltaUnit ? ' ' + deltaUnit : null}) ) : null} @@ -334,7 +339,10 @@ export const studentTStrategy = { {determineStatus(!!improvement, !!regression)}
-
{` ${deltaPercent} % `}
+
{` ${signPrefix(deltaPercent)}${deltaPercent} % `}
{confidenceText && confidenceIcons[confidenceText]} {confidenceText || '-'} diff --git a/src/components/CompareResults/MannWhitneyCompareMetrics.tsx b/src/components/CompareResults/MannWhitneyCompareMetrics.tsx index 1cead497e..71286c693 100644 --- a/src/components/CompareResults/MannWhitneyCompareMetrics.tsx +++ b/src/components/CompareResults/MannWhitneyCompareMetrics.tsx @@ -1,10 +1,15 @@ import { Box } from '@mui/material'; import { MannWhitneyResultsItem } from '../../types/state'; +import { formatNumberFixedTwo } from '../../utils/format'; import { getModeInterpretation } from '../../utils/helpers'; const METRIC_HEADERS = ['Metric', 'Base', 'New', 'Interpretation']; +// Format a stat with thousands grouping and 2 decimals, or "N/A" when the value is missing. +const formatStat = (value: number | null | undefined) => + value != null ? formatNumberFixedTwo(value) : 'N/A'; + interface MannWhitneyCompareMetricsProps { result: MannWhitneyResultsItem; } @@ -98,38 +103,38 @@ export const MannWhitneyCompareMetrics = ({ Mean - {baseMean?.toFixed(2) ?? 'N/A'} - {newMean?.toFixed(2) ?? 'N/A'} + {formatStat(baseMean)} + {formatStat(newMean)} Median - {baseMedian?.toFixed(2) ?? 'N/A'} - {newMedian?.toFixed(2) ?? 'N/A'} + {formatStat(baseMedian)} + {formatStat(newMedian)} Variance - {baseVariance?.toFixed(2) ?? 'N/A'} - {newVariance?.toFixed(2) ?? 'N/A'} + {formatStat(baseVariance)} + {formatStat(newVariance)} Standard Deviation - {baseStandardDev?.toFixed(2) ?? 'N/A'} - {newStandardDev?.toFixed(2) ?? 'N/A'} + {formatStat(baseStandardDev)} + {formatStat(newStandardDev)} Min - {baseMin?.toFixed(2) ?? 'N/A'} - {newMin?.toFixed(2) ?? 'N/A'} + {formatStat(baseMin)} + {formatStat(newMin)} Max - {baseMax?.toFixed(2) ?? 'N/A'} - {newMax?.toFixed(2) ?? 'N/A'} + {formatStat(baseMax)} + {formatStat(newMax)} diff --git a/src/components/CompareResults/RunValues.tsx b/src/components/CompareResults/RunValues.tsx index 16825dd7e..076305bc3 100644 --- a/src/components/CompareResults/RunValues.tsx +++ b/src/components/CompareResults/RunValues.tsx @@ -63,7 +63,7 @@ function RunValues(props: RunValuesProps) { ))} {expanded ? lastValues.map((value, index) => ( -
{value}
+
{formatNumber(value)}
)) : null} {lastValues.length ? ( @@ -87,7 +87,7 @@ function RunValues(props: RunValuesProps) {
{values.length > 1 - ? `${stddev} ${unit} = ${stddevPercent}% standard deviation` + ? `${formatNumber(stddev)} ${unit} = ${stddevPercent}% standard deviation` : 'N/A standard deviation'}
diff --git a/src/utils/format.ts b/src/utils/format.ts index b0e2aec2f..b9d588af3 100644 --- a/src/utils/format.ts +++ b/src/utils/format.ts @@ -4,6 +4,12 @@ const dateFormatter = new Intl.DateTimeFormat('en-US', { const numberFormatter = new Intl.NumberFormat('en-US'); +// Groups thousands while keeping exactly 2 decimals (e.g. 2,113.69). +const numberFormatterFixedTwo = new Intl.NumberFormat('en-US', { + minimumFractionDigits: 2, + maximumFractionDigits: 2, +}); + export function formatDate(date: Date) { return dateFormatter.format(date); } @@ -16,6 +22,13 @@ export const formatNumber = (value: number) => { return numberFormatter.format(value); }; +// Returns a leading "+" for positive values only (negatives already carry "-"). +export const signPrefix = (value: number) => (value > 0 ? '+' : ''); + +export const formatNumberFixedTwo = (value: number) => { + return numberFormatterFixedTwo.format(value); +}; + // Determine the best human-readable scale for a unit given a set of values. // Returns the divisor and display unit label; suitable for axis tick formatting. export function getDisplayScale(