Skip to content

Commit

Permalink
Restore files (Eslint 8.21.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
vrigal committed Jul 2, 2024
1 parent 9a6d576 commit f4791fb
Show file tree
Hide file tree
Showing 57 changed files with 655 additions and 349 deletions.
18 changes: 12 additions & 6 deletions tests/ui/job-view/Filtering_test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,12 @@ describe('Filtering', () => {
});

test('should have 1 push', async () => {
const { getAllByText, getAllByTestId, getByText, getByTitle } = render(
testApp(),
{ legacyRoot: true },
);
const {
getAllByText,
getAllByTestId,
getByText,
getByTitle,
} = render(testApp(), { legacyRoot: true });
const unfilteredPushes = await waitFor(() =>
getAllByTestId('push-header'),
);
Expand Down Expand Up @@ -492,8 +494,12 @@ describe('Filtering', () => {
});

test('Filters | Reset should get back to original set of jobs', async () => {
const { getAllByText, findAllByText, findByText, queryAllByText } =
render(testApp(), { legacyRoot: true });
const {
getAllByText,
findAllByText,
findByText,
queryAllByText,
} = render(testApp(), { legacyRoot: true });
const symbolToRemove = 'yaml';

await findAllByText('B');
Expand Down
3 changes: 2 additions & 1 deletion tests/ui/job-view/Push_test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ describe('Transformations', () => {
expected: 'devtools/client/framework/browser-toolbox/test/browser.ini',
},
{
path: 'devtools/client/framework/browser-toolbox/test/browser_browser_toolbox.js',
path:
'devtools/client/framework/browser-toolbox/test/browser_browser_toolbox.js',
expected:
'devtools/client/framework/browser-toolbox/test/browser_browser_toolbox.js',
},
Expand Down
8 changes: 6 additions & 2 deletions tests/ui/job-view/details/PinBoard_test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,12 @@ describe('DetailsPanel', () => {
});

test('classify and unclassify all jobs', async () => {
const { getByPlaceholderText, getByText, getByTitle, queryAllByTitle } =
render(testDetailsPanel(), { legacyRoot: true });
const {
getByPlaceholderText,
getByText,
getByTitle,
queryAllByTitle,
} = render(testDetailsPanel(), { legacyRoot: true });

store.dispatch(pinJobs(jobList.data));
store.dispatch(setSelectedJob(jobList.data[1], true));
Expand Down
42 changes: 30 additions & 12 deletions tests/ui/perfherder/alerts-view/alerts_test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,11 @@ test("'Take' button hides when clicking on 'Unassigned' badge", async () => {
alertSummary.assignee_email = 'test_user@mozilla.com';
alertSummary.assignee_username = 'mozilla-ldap/test_user@mozilla.com';

const { getByText, queryByText, queryByPlaceholderText } =
alertsViewControls();
const {
getByText,
queryByText,
queryByPlaceholderText,
} = alertsViewControls();

const unassignedBadge = await waitFor(() => getByText('Unassigned'));

Expand Down Expand Up @@ -658,8 +661,11 @@ const assertAlertsAreInOrder = async (alertsInOrder, alertTableRows) => {
};

test(`table data can be sorted in descending order by 'Test'`, async () => {
const { getAllByLabelText, getByTestId, getAllByTitle } =
alertsViewControls();
const {
getAllByLabelText,
getByTestId,
getAllByTitle,
} = alertsViewControls();

let alertTableRows = await waitFor(() =>
getAllByLabelText('Alert table row'),
Expand Down Expand Up @@ -694,8 +700,11 @@ test(`table data can be sorted in descending order by 'Test'`, async () => {
});

test(`table data can be sorted in ascending order by 'Platform'`, async () => {
const { getByTestId, getAllByLabelText, getAllByTitle } =
alertsViewControls();
const {
getByTestId,
getAllByLabelText,
getAllByTitle,
} = alertsViewControls();

let alertTableRows = await waitFor(() =>
getAllByLabelText('Alert table row'),
Expand Down Expand Up @@ -737,8 +746,11 @@ test(`table data cannot be sorted by 'Tags & Options'`, async () => {
});

test(`table data can be sorted in ascending order by 'Confidence'`, async () => {
const { getAllByLabelText, getByTestId, getAllByTitle } =
alertsViewControls();
const {
getAllByLabelText,
getByTestId,
getAllByTitle,
} = alertsViewControls();

let alertTableRows = await waitFor(() =>
getAllByLabelText('Alert table row'),
Expand Down Expand Up @@ -770,8 +782,11 @@ test(`table data can be sorted in ascending order by 'Confidence'`, async () =>
});

test(`table data can be sorted in ascending order by 'Magnitude of Change'`, async () => {
const { getAllByLabelText, getByTestId, getAllByTitle } =
alertsViewControls();
const {
getAllByLabelText,
getByTestId,
getAllByTitle,
} = alertsViewControls();

let alertTableRows = await waitFor(() =>
getAllByLabelText('Alert table row'),
Expand Down Expand Up @@ -804,8 +819,11 @@ test(`table data can be sorted in ascending order by 'Magnitude of Change'`, asy
});

test('Data can be sorted only by one column', async () => {
const { getAllByLabelText, getByTestId, getAllByTitle } =
alertsViewControls();
const {
getAllByLabelText,
getByTestId,
getAllByTitle,
} = alertsViewControls();

let alertTableRows = await waitFor(() =>
getAllByLabelText('Alert table row'),
Expand Down
12 changes: 8 additions & 4 deletions tests/ui/perfherder/compare-view/compare_table_test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,9 @@ test('filters that are not enabled are removed from URL params', async () => {
});

test('page parameter updates with value 2 when clicking on the second page', async () => {
const { getByText, findAllByLabelText } =
compareTableControls(compareResults);
const { getByText, findAllByLabelText } = compareTableControls(
compareResults,
);

const result1 = await waitFor(() =>
getByText(compareTablesControlsResults[0].name),
Expand Down Expand Up @@ -376,8 +377,11 @@ test('page parameter updates with value 2 when clicking on the second page', asy
});

test('text input filter results should differ when filter button(s) are selected', async () => {
const { getByText, getByPlaceholderText, queryByText } =
compareTableControls();
const {
getByText,
getByPlaceholderText,
queryByText,
} = compareTableControls();

const result1 = await waitFor(() => getByText(result[0].name));
const result2 = await waitFor(() => getByText(result[1].name));
Expand Down
16 changes: 12 additions & 4 deletions tests/ui/perfherder/graphs-view/graphs_view_test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,12 @@ test('Using select query param displays tooltip for correct datapoint with repli
});

test('InputFilter from TestDataModal can filter by application name', async () => {
const { getByText, getByTestId, getByPlaceholderText, getByTitle } =
graphsViewControls();
const {
getByText,
getByTestId,
getByPlaceholderText,
getByTitle,
} = graphsViewControls();

const { name, application, projectName, platform } = seriesData[0];
const fullTestName = projectName.concat(
Expand Down Expand Up @@ -310,8 +314,12 @@ test('InputFilter from TestDataModal can filter by application name', async () =

test('Changing the platform dropdown while filtered by text in the Test Data Modal displays expected tests', async () => {
mockShowModal.mockClear();
const { getByText, getByPlaceholderText, getByTitle, getByTestId } =
graphsViewControls();
const {
getByText,
getByPlaceholderText,
getByTitle,
getByTestId,
} = graphsViewControls();

fireEvent.click(getByText('Add test data'));

Expand Down
102 changes: 90 additions & 12 deletions tests/ui/perfherder/replicates_graph_test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,31 @@ const mockedReplicateData = {
lowerIsBetter: true,
name: SUBTEST_NAME,
replicates: [
500, 345, 366, 358, 355, 365, 354, 354, 363, 360, 389, 357, 273,
376, 350, 381, 373, 356, 351, 348, 271, 354, 351, 360, 385,
500,
345,
366,
358,
355,
365,
354,
354,
363,
360,
389,
357,
273,
376,
350,
381,
373,
356,
351,
348,
271,
354,
351,
360,
385,
],
shouldAlert: false,
unit: 'ms',
Expand All @@ -35,8 +58,31 @@ const mockedReplicateData = {
lowerIsBetter: true,
name: 'tablemutation.html',
replicates: [
89, 88, 90, 83, 87, 87, 88, 86, 85, 84, 85, 88, 102, 83, 100, 86,
100, 80, 87, 88, 82, 85, 84, 83, 86,
89,
88,
90,
83,
87,
87,
88,
86,
85,
84,
85,
88,
102,
83,
100,
86,
100,
80,
87,
88,
82,
85,
84,
83,
86,
],
shouldAlert: false,
unit: 'ms',
Expand All @@ -52,8 +98,26 @@ const mockedReplicateData = {
{
name: 'ts_paint',
replicates: [
844, 832, 842, 825, 849, 816, 857, 841, 849, 840, 846, 872, 864,
837, 830, 843, 841, 854, 841, 858,
844,
832,
842,
825,
849,
816,
857,
841,
849,
840,
846,
872,
864,
837,
830,
843,
841,
854,
841,
858,
],
value: 842,
},
Expand All @@ -70,12 +134,26 @@ const mockedReplicateData = {
lowerIsBetter: true,
name: '',
replicates: [
552.9000000000001, 561.6599999999999, 558.1199999999999,
565.0799999999999, 554.94, 599.9399999999998, 600.9200000000001,
559.22, 552.0600000000002, 559.4000000000001, 603.0999999999999,
586.4199999999998, 587.3200000000002, 606.3800000000001,
587.1000000000001, 592.9200000000001, 542.9199999999998, 553.98,
556.4200000000001, 576.0999999999999,
552.9000000000001,
561.6599999999999,
558.1199999999999,
565.0799999999999,
554.94,
599.9399999999998,
600.9200000000001,
559.22,
552.0600000000002,
559.4000000000001,
603.0999999999999,
586.4199999999998,
587.3200000000002,
606.3800000000001,
587.1000000000001,
592.9200000000001,
542.9199999999998,
553.98,
556.4200000000001,
576.0999999999999,
],
shouldAlert: false,
unit: 'ms',
Expand Down
3 changes: 2 additions & 1 deletion tests/ui/push-health/details/DetailsPanel_test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ describe('DetailsPanel', () => {
},
line_number: 18841,
},
line: '22:42:53 INFO - TEST-UNEXPECTED-FAIL | devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps.js | Uncaught exception - at chrome://mochitests/content/browser/devtools/client/debugger/test/mochitest/helpers.js:358 - TypeError: can\'t access property "wrapClass", lineInfo is null',
line:
'22:42:53 INFO - TEST-UNEXPECTED-FAIL | devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps.js | Uncaught exception - at chrome://mochitests/content/browser/devtools/client/debugger/test/mochitest/helpers.js:358 - TypeError: can\'t access property "wrapClass", lineInfo is null',
line_number: 18841,
},
],
Expand Down
3 changes: 1 addition & 2 deletions ui/helpers/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ export const getTaskRunStr = (job) => `${job.task_id}.${job.retry_id}`;

// This matches as taskId, optionally followed by `.` or`-` and a runId.
// We support `-` for backwards compatability with the original format used.
const taskRunPattern =
/^([A-Za-z0-9_-]{8}[Q-T][A-Za-z0-9_-][CGKOSWaeimquy26-][A-Za-z0-9_-]{10}[AQgw])(?:[-.]([0-9]+))?$/;
const taskRunPattern = /^([A-Za-z0-9_-]{8}[Q-T][A-Za-z0-9_-][CGKOSWaeimquy26-][A-Za-z0-9_-]{10}[AQgw])(?:[-.]([0-9]+))?$/;

export const getTaskRun = function getTaskRun(taskRunStr) {
const match = taskRunPattern.exec(taskRunStr);
Expand Down
1 change: 1 addition & 0 deletions ui/helpers/performance.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// This file may export additional functions.
/* eslint-disable import/prefer-default-export */

import TaskclusterModel from '../models/taskcluster';

Expand Down
2 changes: 1 addition & 1 deletion ui/helpers/revision.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const getRevisionTitle = function getRevisionTitle(revisions) {
* Strip out unwanted things like additional lines, trychooser
* syntax, request flags, mq cruft, whitespace, and punctuation
*/

// eslint-disable-next-line prefer-destructuring
title = title.split('\n')[0];
title = title.replace(/\btry: .*/, '');
title = title.replace(/\b(r|sr|f|a)=.*/, '');
Expand Down
1 change: 1 addition & 0 deletions ui/helpers/sort.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line import/prefer-default-export
export const sortAlphaNum = (a, b) => {
// Implement a better alphanumeric sort so that mochitest-10
// is sorted after mochitest 9, not mochitest-1
Expand Down
1 change: 1 addition & 0 deletions ui/helpers/taskcluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const taskcluster = (() => {
userCredentials[_rootUrl] &&
moment(userCredentials[_rootUrl].expires).isAfter(moment())
) {
// eslint-disable-next-line no-promise-executor-return
return resolve(userCredentials[_rootUrl]);
}

Expand Down
2 changes: 2 additions & 0 deletions ui/helpers/utils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable no-bitwise */

export const hashFunction = (someString) => {
// Borrowed from https://github.com/darkskyapp/string-hash
let hash = 5381;
Expand Down
Loading

0 comments on commit f4791fb

Please sign in to comment.