Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy January 15, 2025 #842

Merged
merged 8 commits into from
Jan 15, 2025
371 changes: 287 additions & 84 deletions src/__tests__/CompareResults/ResultsTable.test.tsx

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/__tests__/CompareResults/RevisionRow.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ describe('<RevisionRow>', () => {
it.each([
{
platform: 'linux1804-32-shippable-qr',
shortName: 'Linux',
shortName: 'Linux 18.04',
hasIcon: true,
},
{
platform: 'macosx1014-64-shippable-qr',
shortName: 'OSX',
shortName: 'OS X 10.14',
hasIcon: true,
},
{
platform: 'windows2012-64-shippable',
shortName: 'Windows',
shortName: 'Windows 2012',
hasIcon: true,
},
{
Expand Down
66 changes: 33 additions & 33 deletions src/__tests__/CompareResults/SubtestsResultsView.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ describe('SubtestsResultsView Component Tests', () => {
// Initial view (alphabetical ordered, even if "sort by subtests" isn't specified
expect(summarizeVisibleRows()).toEqual([
'dhtml.html: 1.14 %, Low',
'improvement.html: 1.44 %, Low',
'improvement.html: -1.44 %, Low',
'regression.html: 1.04 %, High',
'tablemutation.html: 0.98 %, Low',
]);
Expand All @@ -219,67 +219,67 @@ describe('SubtestsResultsView Component Tests', () => {
const deltaButton = screen.getByRole('button', { name: /Delta/ });
expect(deltaButton).toMatchSnapshot();
expect(window.location.search).not.toContain('sort=');
// Sort ascending
// Sort descending
await user.click(deltaButton);
expect(summarizeVisibleRows()).toEqual([
'tablemutation.html: 0.98 %, Low',
'regression.html: 1.04 %, High',
'improvement.html: -1.44 %, Low',
'dhtml.html: 1.14 %, Low',
'improvement.html: 1.44 %, Low',
'regression.html: 1.04 %, High',
'tablemutation.html: 0.98 %, Low',
]);
// It should have the "ascending" SVG.
// It should have the "descending" SVG.
expect(deltaButton).toMatchSnapshot();
// It should be persisted in the URL
expectParameterToHaveValue('sort', 'delta|asc');
expectParameterToHaveValue('sort', 'delta|desc');

// Sort descending
// Sort ascending
await user.click(deltaButton);
expect(summarizeVisibleRows()).toEqual([
'improvement.html: 1.44 %, Low',
'dhtml.html: 1.14 %, Low',
'regression.html: 1.04 %, High',
'tablemutation.html: 0.98 %, Low',
'regression.html: 1.04 %, High',
'dhtml.html: 1.14 %, Low',
'improvement.html: -1.44 %, Low',
]);
// It should have the "descending" SVG.
// It should have the "ascending" SVG.
expect(deltaButton).toMatchSnapshot();
// It should be persisted in the URL
expectParameterToHaveValue('sort', 'delta|desc');
expectParameterToHaveValue('sort', 'delta|asc');

// Sort by Confidence ascending
// Sort by Confidence descending
const confidenceButton = screen.getByRole('button', {
name: /Confidence.*sort/,
});
await user.click(confidenceButton);
expect(summarizeVisibleRows()).toEqual([
'tablemutation.html: 0.98 %, Low',
'dhtml.html: 1.14 %, Low',
'improvement.html: 1.44 %, Low',
'regression.html: 1.04 %, High',
'improvement.html: -1.44 %, Low',
'dhtml.html: 1.14 %, Low',
'tablemutation.html: 0.98 %, Low',
]);
// It should have the "no sort" SVG.
expect(deltaButton).toMatchSnapshot();
// It should have the "ascending" SVG.
// It should have the "descending" SVG.
expect(confidenceButton).toMatchSnapshot();
// It should be persisted in the URL
expectParameterToHaveValue('sort', 'confidence|asc');
expectParameterToHaveValue('sort', 'confidence|desc');

// Sort by subtest name ascending
// Sort by subtest name descending
const subtestsButton = screen.getByRole('button', { name: /Subtests/ });
await user.click(subtestsButton);
expect(summarizeVisibleRows()).toEqual([
'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',
'improvement.html: -1.44 %, Low',
'dhtml.html: 1.14 %, Low',
]);
// It should have the "no sort" SVG.
expect(confidenceButton).toMatchSnapshot();
// It should have the "ascending" SVG.
// It should have the "descending" SVG.
expect(subtestsButton).toMatchSnapshot();
// It should be persisted in the URL
expectParameterToHaveValue('sort', 'subtests|asc');
expectParameterToHaveValue('sort', 'subtests|desc');

// Clickince twice more should reset the URL.
// Clicking twice more should reset the URL.
await user.click(subtestsButton);
await user.click(subtestsButton);
expect(window.location.search).not.toContain('sort=');
Expand All @@ -292,29 +292,29 @@ describe('SubtestsResultsView Component Tests', () => {
'tablemutation.html: 0.98 %, Low',
'regression.html: 1.04 %, High',
'dhtml.html: 1.14 %, Low',
'improvement.html: 1.44 %, Low',
'improvement.html: -1.44 %, Low',
]);
// It should have the "ascending" SVG.
expect(screen.getByRole('button', { name: /Delta/ })).toMatchSnapshot();
});

it('initializes the sort from the URL at load time for an implicit ascending sort', async () => {
it('initializes the sort from the URL at load time for an implicit descending sort', async () => {
await setupForSorting({ extraParameters: 'sort=delta' });
await screen.findByText('dhtml.html');
expect(summarizeVisibleRows()).toEqual([
'tablemutation.html: 0.98 %, Low',
'regression.html: 1.04 %, High',
'improvement.html: -1.44 %, Low',
'dhtml.html: 1.14 %, Low',
'improvement.html: 1.44 %, Low',
'regression.html: 1.04 %, High',
'tablemutation.html: 0.98 %, Low',
]);
// It should have the "ascending" SVG.
// It should have the "descending" SVG.
expect(screen.getByRole('button', { name: /Delta/ })).toMatchSnapshot();
});

it('initializes the sort from the URL at load time for a descending sort', async () => {
await setupForSorting({ extraParameters: 'sort=delta|desc' });
expect(summarizeVisibleRows()).toEqual([
'improvement.html: 1.44 %, Low',
'improvement.html: -1.44 %, Low',
'dhtml.html: 1.14 %, Low',
'regression.html: 1.04 %, High',
'tablemutation.html: 0.98 %, Low',
Expand Down
Loading