Skip to content

Commit 6de9353

Browse files
ogiorgisArchaeopteryx
authored andcommitted
fix: remove useless legacyRoot render option
1 parent 7b79f9c commit 6de9353

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+95
-232
lines changed

tests/ui/job-view/AppHistory_test.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe('history', () => {
7878
history.push(
7979
'/#/jobs?repo=try&revision=07615c30668c70692d01a58a00e7e271e69ff6f1',
8080
);
81-
render(testApp(), { legacyRoot: true });
81+
render(testApp());
8282

8383
expect(history.location).toEqual(
8484
expect.objectContaining({
@@ -90,7 +90,7 @@ describe('history', () => {
9090
});
9191

9292
test('lack of a specified route should redirect to jobs view with a default repo', () => {
93-
render(testApp(), { legacyRoot: true });
93+
render(testApp());
9494

9595
expect(history.location).toEqual(
9696
expect.objectContaining({

tests/ui/job-view/AppRoutes_test.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('Test for backwards-compatible routes for other apps', () => {
5454
history.push(
5555
'/pushhealth.html?repo=autoland&revision=3c8e093335315c42a87eebf0531effe9cd6fdb95',
5656
);
57-
render(testApp(), { legacyRoot: true });
57+
render(testApp());
5858

5959
expect(history.location).toEqual(
6060
expect.objectContaining({
@@ -71,7 +71,7 @@ describe('Test for backwards-compatible routes for other apps', () => {
7171
fetchMock.get('/api/performance/tag/', []);
7272

7373
history.push('/perf.html#/alerts?id=27285&hideDwnToInv=0');
74-
render(testApp(), { legacyRoot: true });
74+
render(testApp());
7575

7676
expect(history.location).toEqual(
7777
expect.objectContaining({
@@ -86,7 +86,7 @@ describe('Test for backwards-compatible routes for other apps', () => {
8686
history.push(
8787
'/logviewer.html#/jobs?job_id=319893964&repo=autoland&lineNumber=2728',
8888
);
89-
render(testApp(), { legacyRoot: true });
89+
render(testApp());
9090

9191
expect(history.location).toEqual(
9292
expect.objectContaining({
@@ -101,7 +101,7 @@ describe('Test for backwards-compatible routes for other apps', () => {
101101
history.push(
102102
'/perfherder/compare?originalProject=mozilla-central&originalRevision=54e7fb66ad44b8dcb8caab587f929dad60932d71&newProject=mozilla-central&newRevision=54e7fb66ad44b8dcb8caab587f929dad60932d71&framework=1&page=1#tableLink-header-134266337',
103103
);
104-
render(testApp(), { legacyRoot: true });
104+
render(testApp());
105105

106106
expect(history.location).toEqual(
107107
expect.objectContaining({

tests/ui/job-view/App_test.jsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ describe('App', () => {
146146
});
147147

148148
test('should have links to Perfherder and Intermittent Failures View', async () => {
149-
const { getByText, getByAltText } = render(testApp(), { legacyRoot: true });
149+
const { getByText, getByAltText } = render(testApp());
150150
const appMenu = await waitFor(() => getByAltText('Treeherder'));
151151

152152
expect(appMenu).toBeInTheDocument();
@@ -168,9 +168,7 @@ describe('App', () => {
168168
secondJobSymbol,
169169
secondJobTaskId,
170170
) => {
171-
const { getByText, findByText, findByTestId } = render(testApp(), {
172-
legacyRoot: true,
173-
});
171+
const { getByText, findByText, findByTestId } = render(testApp());
174172
const firstJob = await findByText(firstJobSymbol);
175173

176174
fireEvent.mouseDown(firstJob);
@@ -238,7 +236,7 @@ describe('App', () => {
238236
});
239237

240238
test('changing repo updates ``currentRepo``', async () => {
241-
const { getByText, getByTitle } = render(testApp(), { legacyRoot: true });
239+
const { getByText, getByTitle } = render(testApp());
242240

243241
const autolandRevision = await waitFor(() => getByText('ba9c692786e9'));
244242
expect(autolandRevision).toBeInTheDocument();

tests/ui/job-view/Filtering_test.jsx

Lines changed: 15 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,9 @@ describe('Filtering', () => {
190190
});
191191

192192
test('should have 1 push', async () => {
193-
const {
194-
getAllByText,
195-
getAllByTestId,
196-
getByText,
197-
getByTitle,
198-
} = render(testApp(), { legacyRoot: true });
193+
const { getAllByText, getAllByTestId, getByText, getByTitle } = render(
194+
testApp(),
195+
);
199196
const unfilteredPushes = await waitFor(() =>
200197
getAllByTestId('push-header'),
201198
);
@@ -219,9 +216,7 @@ describe('Filtering', () => {
219216

220217
describe('by failure result', () => {
221218
test('should have 10 failures', async () => {
222-
const { getByTitle, findAllByText, queryAllByText } = render(testApp(), {
223-
legacyRoot: true,
224-
});
219+
const { getByTitle, findAllByText, queryAllByText } = render(testApp());
225220

226221
await findAllByText('B');
227222
const unclassifiedOnlyButton = getByTitle(
@@ -247,9 +242,7 @@ describe('Filtering', () => {
247242
expect(jobCount()).toBe(50);
248243
});
249244
test('KeyboardShortcut u: toggle unclassified jobs', async () => {
250-
const { queryAllByText, getAllByText } = render(testApp(), {
251-
legacyRoot: true,
252-
});
245+
const { queryAllByText, getAllByText } = render(testApp());
253246
const symbolToRemove = 'yaml';
254247
await waitFor(() => getAllByText(symbolToRemove));
255248
fireEvent.keyDown(document.body, { key: 'u', keyCode: 85 });
@@ -302,9 +295,7 @@ describe('Filtering', () => {
302295
};
303296

304297
test('click signature should have 10 jobs', async () => {
305-
const { getByTitle, findAllByText } = render(testApp(), {
306-
legacyRoot: true,
307-
});
298+
const { getByTitle, findAllByText } = render(testApp());
308299

309300
const build = await findAllByText('B');
310301

@@ -320,10 +311,7 @@ describe('Filtering', () => {
320311
});
321312

322313
test('string "yaml" should have 10 jobs', async () => {
323-
const { getAllByText, findAllByText, queryAllByText } = render(
324-
testApp(),
325-
{ legacyRoot: true },
326-
);
314+
const { getAllByText, findAllByText, queryAllByText } = render(testApp());
327315
await findAllByText('B');
328316
const filterField = document.querySelector('#quick-filter');
329317
setFilterText(filterField, 'yaml');
@@ -340,7 +328,7 @@ describe('Filtering', () => {
340328
});
341329

342330
test('KeyboardShortcut f: focus the quick filter input', async () => {
343-
const { findAllByText } = render(testApp(), { legacyRoot: true });
331+
const { findAllByText } = render(testApp());
344332
await findAllByText('B');
345333

346334
const filterField = document.querySelector('#quick-filter');
@@ -356,7 +344,7 @@ describe('Filtering', () => {
356344
getAllByText,
357345
getByPlaceholderText,
358346
queryAllByText,
359-
} = render(testApp(), { legacyRoot: true });
347+
} = render(testApp());
360348
await findAllByText('B');
361349
const filterField = getByPlaceholderText('Filter platforms & jobs');
362350
setFilterText(filterField, 'yaml');
@@ -385,10 +373,7 @@ describe('Filtering', () => {
385373
};
386374

387375
test('uncheck success should leave 30 jobs', async () => {
388-
const { getAllByText, findAllByText, queryAllByText } = render(
389-
testApp(),
390-
{ legacyRoot: true },
391-
);
376+
const { getAllByText, findAllByText, queryAllByText } = render(testApp());
392377

393378
await findAllByText('B');
394379
clickFilterChicklet('green');
@@ -406,10 +391,7 @@ describe('Filtering', () => {
406391
});
407392

408393
test('uncheck failures should leave 20 jobs', async () => {
409-
const { getAllByText, findAllByText, queryAllByText } = render(
410-
testApp(),
411-
{ legacyRoot: true },
412-
);
394+
const { getAllByText, findAllByText, queryAllByText } = render(testApp());
413395
const symbolToRemove = 'B';
414396

415397
await findAllByText(symbolToRemove);
@@ -428,10 +410,7 @@ describe('Filtering', () => {
428410
});
429411

430412
test('uncheck in progress should leave 20 jobs', async () => {
431-
const { getAllByText, findAllByText, queryAllByText } = render(
432-
testApp(),
433-
{ legacyRoot: true },
434-
);
413+
const { getAllByText, findAllByText, queryAllByText } = render(testApp());
435414
const symbolToRemove = 'yaml';
436415

437416
await findAllByText('B');
@@ -449,9 +428,7 @@ describe('Filtering', () => {
449428
});
450429

451430
test('KeyboardShortcut i: toggle off in-progress tasks', async () => {
452-
const { getAllByText, queryAllByText } = render(testApp(), {
453-
legacyRoot: true,
454-
});
431+
const { getAllByText, queryAllByText } = render(testApp());
455432
const symbolToRemove = 'yaml';
456433

457434
await waitFor(() => getAllByText(symbolToRemove));
@@ -468,10 +445,7 @@ describe('Filtering', () => {
468445
});
469446

470447
test('KeyboardShortcut i: toggle on in-progress tasks', async () => {
471-
const { getAllByText, findAllByText, queryAllByText } = render(
472-
testApp(),
473-
{ legacyRoot: true },
474-
);
448+
const { getAllByText, findAllByText, queryAllByText } = render(testApp());
475449
const symbolToRemove = 'yaml';
476450

477451
await waitFor(() => getAllByText(symbolToRemove));
@@ -499,7 +473,7 @@ describe('Filtering', () => {
499473
findAllByText,
500474
findByText,
501475
queryAllByText,
502-
} = render(testApp(), { legacyRoot: true });
476+
} = render(testApp());
503477
const symbolToRemove = 'yaml';
504478

505479
await findAllByText('B');

tests/ui/job-view/PushList_test.jsx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,13 @@ describe('PushList', () => {
158158
const push2Id = 'push-511137';
159159

160160
test('should have 2 pushes', async () => {
161-
render(testPushList(), { legacyRoot: true });
161+
render(testPushList());
162162

163163
expect(await pushCount()).toHaveLength(2);
164164
});
165165

166166
test('should switch to single loaded revision', async () => {
167-
const { getAllByTitle } = render(testPushList(), { legacyRoot: true });
167+
const { getAllByTitle } = render(testPushList());
168168

169169
expect(await pushCount()).toHaveLength(2);
170170
const pushLinks = await getAllByTitle('View only this push');
@@ -175,9 +175,7 @@ describe('PushList', () => {
175175
});
176176

177177
test('should reload pushes when setting fromchange', async () => {
178-
const { queryAllByTestId, queryByTestId } = render(testPushList(), {
179-
legacyRoot: true,
180-
});
178+
const { queryAllByTestId, queryByTestId } = render(testPushList());
181179

182180
expect(await pushCount()).toHaveLength(2);
183181

@@ -202,7 +200,7 @@ describe('PushList', () => {
202200
});
203201

204202
test('should reload pushes when setting tochange', async () => {
205-
const { getByTestId } = render(testPushList(), { legacyRoot: true });
203+
const { getByTestId } = render(testPushList());
206204

207205
expect(await pushCount()).toHaveLength(2);
208206

@@ -225,9 +223,7 @@ describe('PushList', () => {
225223
});
226224

227225
test('should load N more pushes when click next N', async () => {
228-
const { getByTestId, getAllByTestId } = render(testPushList(), {
229-
legacyRoot: true,
230-
});
226+
const { getByTestId, getAllByTestId } = render(testPushList());
231227
const nextNUrl = (count) =>
232228
getProjectUrl(`/push/?full=true&count=${count + 1}&push_timestamp__lte=`);
233229
const clickNext = (count) =>
@@ -276,7 +272,7 @@ describe('PushList', () => {
276272
});
277273

278274
test('jobs should have fields required for retriggers', async () => {
279-
const { getByText } = render(testPushList(), { legacyRoot: true });
275+
const { getByText } = render(testPushList());
280276
const jobEl = await waitFor(() => getByText('yaml'));
281277
const jobInstance = findJobInstance(jobEl.getAttribute('data-job-id'));
282278
const { job } = jobInstance.props;

tests/ui/job-view/Push_test.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,7 @@ describe('Push', () => {
165165
// eslint-disable-next-line jest/no-disabled-tests
166166
test.skip('jobs should have test_path field to filter', async () => {
167167
const { store } = configureStore();
168-
const { getByText } = render(testPush(store, new FilterModel()), {
169-
legacyRoot: true,
170-
});
168+
const { getByText } = render(testPush(store, new FilterModel()));
171169

172170
const validateJob = async (name, testPaths) => {
173171
const jobEl = await waitFor(() => getByText(name));

tests/ui/job-view/SecondaryNavBar_test.jsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ describe('SecondaryNavBar', () => {
7171
},
7272
router,
7373
});
74-
const { getByText } = render(testSecondaryNavBar(store), {
75-
legacyRoot: true,
76-
});
74+
const { getByText } = render(testSecondaryNavBar(store));
7775

7876
expect(await waitFor(() => getByText(repoName))).toBeInTheDocument();
7977
expect(await waitFor(() => getByText('52'))).toBeInTheDocument();
@@ -88,9 +86,7 @@ describe('SecondaryNavBar', () => {
8886
},
8987
router,
9088
});
91-
const { getByText } = render(testSecondaryNavBar(store), {
92-
legacyRoot: true,
93-
});
89+
const { getByText } = render(testSecondaryNavBar(store));
9490

9591
expect(await waitFor(() => getByText(repoName))).toBeInTheDocument();
9692
expect(await waitFor(() => getByText('22'))).toBeInTheDocument();
@@ -110,9 +106,7 @@ describe('SecondaryNavBar', () => {
110106
updateButtonClick: jest.fn(),
111107
};
112108

113-
const { container } = render(testSecondaryNavBar(store, props), {
114-
legacyRoot: true,
115-
});
109+
const { container } = render(testSecondaryNavBar(store, props));
116110
const el = container.querySelector('#revisionChangedLabel');
117111
fireEvent.click(el);
118112
expect(props.updateButtonClick).toHaveBeenCalled();

tests/ui/job-view/bugfiler_test.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ describe('BugFiler', () => {
155155
search: summary,
156156
};
157157

158-
render(bugFilerComponentSuggestion(suggestion), { legacyRoot: true });
158+
render(bugFilerComponentSuggestion(suggestion));
159159
const area = screen.getAllByRole('textbox');
160160
// TODO: hardcoded '1' in the array index
161161
// TODO: this used to check specific areas of summary,
@@ -285,7 +285,7 @@ describe('BugFiler', () => {
285285
},
286286
];
287287

288-
render(bugFilerComponentSuggestions(suggestions), { legacyRoot: true });
288+
render(bugFilerComponentSuggestions(suggestions));
289289
const signatureArea = screen.getByDisplayValue(
290290
'[@ servo_arc::HeaderSlice<H,T>::slice]',
291291
);
@@ -302,7 +302,7 @@ describe('BugFiler', () => {
302302
},
303303
];
304304

305-
render(bugFilerComponentSuggestions(suggestions), { legacyRoot: true });
305+
render(bugFilerComponentSuggestions(suggestions));
306306
const signatureArea = screen.queryByDisplayValue('test_webvr.html');
307307
expect(signatureArea).toBeNull();
308308
});
@@ -316,7 +316,7 @@ describe('BugFiler', () => {
316316
'SUMMARY: AddressSanitizer: heap-use-after-free /builds/worker/checkouts/gecko/mock/folder/file.c:12:34 in mock::MockComponent::MockMethod(mock::squirrel::Weasel*)',
317317
},
318318
];
319-
render(bugFilerComponentSuggestions(suggestions), { legacyRoot: true });
319+
render(bugFilerComponentSuggestions(suggestions));
320320
const securityIssue = screen.getByText('Report this as a security issue');
321321
expect(securityIssue).toBeTruthy();
322322
});
@@ -331,7 +331,7 @@ describe('BugFiler', () => {
331331
},
332332
];
333333

334-
render(bugFilerComponentSuggestions(suggestions), { legacyRoot: true });
334+
render(bugFilerComponentSuggestions(suggestions));
335335
const securityIssue = screen.getByText('Report this as a security issue');
336336
expect(securityIssue.checked).toBeFalsy();
337337
});
@@ -346,7 +346,7 @@ describe('BugFiler', () => {
346346
});
347347

348348
test('should strip omitted leads from thisFailure', async () => {
349-
render(bugFilerComponentSuggestions(PdfSuggestions), { legacyRoot: true });
349+
render(bugFilerComponentSuggestions(PdfSuggestions));
350350

351351
const toggleSummary = screen.getByTitle('expand');
352352
await fireEvent.click(toggleSummary);

0 commit comments

Comments
 (0)