diff --git a/src/__tests__/App.test.tsx b/src/__tests__/App.test.tsx
index c684e3bc4..4df21b013 100644
--- a/src/__tests__/App.test.tsx
+++ b/src/__tests__/App.test.tsx
@@ -29,6 +29,18 @@ describe('App', () => {
expect(homeText).toBeInTheDocument();
});
+ test('Should display File bug link', async () => {
+ render();
+
+ const link = await screen.findByRole('link', {
+ name: /File a bug on Bugzilla/,
+ });
+ expect(link).toHaveAttribute(
+ 'href',
+ 'https://bugzilla.mozilla.org/enter_bug.cgi?product=Testing&component=PerfCompare&status_whiteboard=[pcf]',
+ );
+ });
+
test('Should display PerfCompare Matrix channel link', async () => {
render();
diff --git a/src/__tests__/CompareResults/ResultsView.test.tsx b/src/__tests__/CompareResults/ResultsView.test.tsx
index 46d952cf9..7f8eb93e6 100644
--- a/src/__tests__/CompareResults/ResultsView.test.tsx
+++ b/src/__tests__/CompareResults/ResultsView.test.tsx
@@ -7,15 +7,12 @@ import { Bubble, ChartProps, Line } from 'react-chartjs-2';
import { loader } from '../../components/CompareResults/loader';
import ResultsView from '../../components/CompareResults/ResultsView';
import RevisionHeader from '../../components/CompareResults/RevisionHeader';
-import { setSelectedRevisions } from '../../reducers/SelectedRevisionsSlice';
import { Strings } from '../../resources/Strings';
import { RevisionsHeader } from '../../types/state';
import getTestData from '../utils/fixtures';
-import { store } from '../utils/setupTests';
import {
renderWithRouter,
screen,
- act,
FetchMockSandbox,
} from '../utils/test-utils';
@@ -29,6 +26,7 @@ function renderWithRoute(component: ReactElement) {
.get('begin:https://treeherder.mozilla.org/api/project/', {
results: [testData[0]],
});
+
return renderWithRouter(component, {
route: '/compare-results/',
search: '?baseRev=spam&baseRepo=mozilla-central&framework=2',
@@ -45,100 +43,6 @@ describe('Results View', () => {
expect(link).toBeInTheDocument();
});
- // TODO Edit mode is not implemented properly currently
- // eslint-disable-next-line jest/no-disabled-tests
- it.skip('The CompareWithBase component should have an edit mode', async () => {
- renderWithRoute();
- expect(await screen.findByText('Compare with a base')).toBeInTheDocument();
- const formElement = await screen.findByRole('form');
- expect(formElement).toMatchSnapshot('Initial state for the form');
-
- const user = userEvent.setup({ delay: null });
-
- // add some selected revs to the selection
- // TODO: handle this with the URL instead
- const { testData } = getTestData();
- const selectedRevs = testData.slice(0, 2);
- act(() => {
- store.dispatch(setSelectedRevisions({ selectedRevisions: selectedRevs }));
- });
-
- // Find out if the base revision is rendered
- const baseRevisionText = screen.getByText(/you've got no arms left!/);
- const newRevisionText = screen.getByText(/just a flesh wound/);
- expect(baseRevisionText).toBeInTheDocument();
- expect(newRevisionText).toBeInTheDocument();
-
- // The search container should be hidden
- const baseSearchContainer = document.querySelector(
- '#base-search-container',
- );
- expect(baseSearchContainer).toHaveClass('hide-container');
-
- // Click the edit button
- let editButton = screen.getAllByRole('button', { name: 'edit button' })[0];
- await user.click(editButton);
-
- expect(baseSearchContainer).toHaveClass('show-container');
-
- expect(formElement).toMatchSnapshot(
- 'After clicking edit for the base revision',
- );
- expect(editButton).not.toBeInTheDocument();
-
- // Press the cancel button should hide input and dropdown
- const cancelButton = screen.getByRole('button', { name: 'cancel button' });
- await user.click(cancelButton);
-
- expect(baseSearchContainer).toHaveClass('hide-container');
-
- // Click the edit button again
- editButton = screen.getAllByRole('button', { name: 'edit button' })[0];
- await user.click(editButton);
- expect(baseSearchContainer).toHaveClass('show-container');
-
- // Remove the base revision by clicking the X button
- const closeBaseButton = screen.getByRole('button', {
- name: 'close-button',
- });
- await user.click(closeBaseButton);
- expect(baseRevisionText).not.toBeInTheDocument();
-
- // Click the save button
- const saveButtonBase = screen.getByRole('button', { name: 'save button' });
- await user.click(saveButtonBase);
-
- // The baseRevision is still hidden
- expect(baseRevisionText).not.toBeInTheDocument();
-
- // The search container is hidden.
- expect(baseSearchContainer).toHaveClass('hide-container');
-
- // Do the same operation with the components for the "new" revisions
- const newSearchContainer = document.querySelector('#new-search-container');
- expect(newSearchContainer).toHaveClass('hide-container');
-
- // Click the edit button
- editButton = screen.getAllByRole('button', { name: 'edit button' })[1];
- await user.click(editButton);
- expect(formElement).toMatchSnapshot(
- 'After clicking edit for the new revision',
- );
- expect(newSearchContainer).toHaveClass('show-container');
-
- // Remove the new revision by clicking the X button
- const closeNewButton = screen.getByRole('button', {
- name: 'close-button',
- });
- await user.click(closeNewButton);
- expect(newRevisionText).not.toBeInTheDocument();
-
- // Click the save button
- const saveButtonNew = screen.getByRole('button', { name: 'save button' });
- await user.click(saveButtonNew);
- expect(newSearchContainer).toHaveClass('hide-container');
- });
-
it('Should render revision header with link to suite docs', async () => {
const revisionHeader: RevisionsHeader = {
extra_options: 'e10s fission stylo webgl-ipc webrender',
@@ -199,7 +103,7 @@ describe('Results View', () => {
);
const expandButton = await screen.findByRole('button', {
- name: 'expand row',
+ name: 'expand this row',
});
await user.click(expandButton);
expect(await screen.findByTestId('expanded-row-content')).toMatchSnapshot();
diff --git a/src/__tests__/CompareResults/__snapshots__/ResultsTable.test.tsx.snap b/src/__tests__/CompareResults/__snapshots__/ResultsTable.test.tsx.snap
index 2b7996ee1..83e40443a 100644
--- a/src/__tests__/CompareResults/__snapshots__/ResultsTable.test.tsx.snap
+++ b/src/__tests__/CompareResults/__snapshots__/ResultsTable.test.tsx.snap
@@ -200,6 +200,7 @@ exports[`Results Table Should match snapshot 1`] = `
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-1qhous5-MuiTypography-root-MuiLink-root"
href="https://treeherder.mozilla.org/jobs?repo=mozilla-central&revision=spam"
target="_blank"
+ title="open treeherder view for spam"
>
spam
@@ -344,33 +345,28 @@ exports[`Results Table Should match snapshot 1`] = `