diff --git a/package.json b/package.json index 0b60c477094..f8685db7ab6 100644 --- a/package.json +++ b/package.json @@ -86,8 +86,9 @@ "@pollyjs/adapter-puppeteer": "5.1.1", "@pollyjs/core": "5.1.1", "@pollyjs/persister-fs": "6.0.6", - "@testing-library/jest-dom": "6.1.6", - "@testing-library/react": "12.0.0", + "@testing-library/dom": "10.1.0", + "@testing-library/jest-dom": "6.4.6", + "@testing-library/react": "16.0.0", "babel-loader": "9.1.3", "clean-webpack-plugin": "4.0.0", "copy-webpack-plugin": "12.0.2", diff --git a/tests/ui/job-view/AppHistory_test.jsx b/tests/ui/job-view/AppHistory_test.jsx index a09e6f963bb..cf5a0352bc7 100644 --- a/tests/ui/job-view/AppHistory_test.jsx +++ b/tests/ui/job-view/AppHistory_test.jsx @@ -66,7 +66,7 @@ describe('history', () => { history.push( '/#/jobs?repo=try&revision=07615c30668c70692d01a58a00e7e271e69ff6f1', ); - render(testApp()); + render(testApp(), { legacyRoot: true }); expect(history.location).toEqual( expect.objectContaining({ @@ -78,7 +78,7 @@ describe('history', () => { }); test('lack of a specified route should redirect to jobs view with a default repo', () => { - render(testApp()); + render(testApp(), { legacyRoot: true }); expect(history.location).toEqual( expect.objectContaining({ diff --git a/tests/ui/job-view/AppRoutes_test.jsx b/tests/ui/job-view/AppRoutes_test.jsx index 2d2d6e34fd6..89aa5dbab31 100644 --- a/tests/ui/job-view/AppRoutes_test.jsx +++ b/tests/ui/job-view/AppRoutes_test.jsx @@ -39,7 +39,7 @@ describe('Test for backwards-compatible routes for other apps', () => { history.push( '/pushhealth.html?repo=autoland&revision=3c8e093335315c42a87eebf0531effe9cd6fdb95', ); - render(testApp()); + render(testApp(), { legacyRoot: true }); expect(history.location).toEqual( expect.objectContaining({ @@ -56,7 +56,7 @@ describe('Test for backwards-compatible routes for other apps', () => { fetchMock.get('/api/performance/tag/', []); history.push('/perf.html#/alerts?id=27285&hideDwnToInv=0'); - render(testApp()); + render(testApp(), { legacyRoot: true }); expect(history.location).toEqual( expect.objectContaining({ @@ -71,7 +71,7 @@ describe('Test for backwards-compatible routes for other apps', () => { history.push( '/logviewer.html#/jobs?job_id=319893964&repo=autoland&lineNumber=2728', ); - render(testApp()); + render(testApp(), { legacyRoot: true }); expect(history.location).toEqual( expect.objectContaining({ @@ -88,7 +88,7 @@ describe('Test for backwards-compatible routes for other apps', () => { history.push( '/perfherder/compare?originalProject=mozilla-central&originalRevision=54e7fb66ad44b8dcb8caab587f929dad60932d71&newProject=mozilla-central&newRevision=54e7fb66ad44b8dcb8caab587f929dad60932d71&framework=1&page=1#tableLink-header-134266337', ); - render(testApp()); + render(testApp(), { legacyRoot: true }); expect(history.location).toEqual( expect.objectContaining({ diff --git a/tests/ui/job-view/App_test.jsx b/tests/ui/job-view/App_test.jsx index 76849ae8833..4845a43500d 100644 --- a/tests/ui/job-view/App_test.jsx +++ b/tests/ui/job-view/App_test.jsx @@ -138,7 +138,7 @@ describe('App', () => { }); test('should have links to Perfherder and Intermittent Failures View', async () => { - const { getByText, getByAltText } = render(testApp()); + const { getByText, getByAltText } = render(testApp(), { legacyRoot: true }); const appMenu = await waitFor(() => getByAltText('Treeherder')); expect(appMenu).toBeInTheDocument(); @@ -160,7 +160,9 @@ describe('App', () => { secondJobSymbol, secondJobTaskId, ) => { - const { getByText, findByText, findByTestId } = render(testApp()); + const { getByText, findByText, findByTestId } = render(testApp(), { + legacyRoot: true, + }); const firstJob = await findByText(firstJobSymbol); fireEvent.mouseDown(firstJob); @@ -228,7 +230,7 @@ describe('App', () => { }); test('changing repo updates ``currentRepo``', async () => { - const { getByText, getByTitle } = render(testApp()); + const { getByText, getByTitle } = render(testApp(), { legacyRoot: true }); const autolandRevision = await waitFor(() => getByText('ba9c692786e9')); expect(autolandRevision).toBeInTheDocument(); diff --git a/tests/ui/job-view/Filtering_test.jsx b/tests/ui/job-view/Filtering_test.jsx index 41c9d790eea..eac361a6ecd 100644 --- a/tests/ui/job-view/Filtering_test.jsx +++ b/tests/ui/job-view/Filtering_test.jsx @@ -192,6 +192,7 @@ describe('Filtering', () => { test('should have 1 push', async () => { const { getAllByText, getAllByTestId, getByText, getByTitle } = render( testApp(), + { legacyRoot: true }, ); const unfilteredPushes = await waitFor(() => getAllByTestId('push-header'), @@ -216,7 +217,9 @@ describe('Filtering', () => { describe('by failure result', () => { test('should have 10 failures', async () => { - const { getByTitle, findAllByText, queryAllByText } = render(testApp()); + const { getByTitle, findAllByText, queryAllByText } = render(testApp(), { + legacyRoot: true, + }); await findAllByText('B'); const unclassifiedOnlyButton = getByTitle( @@ -242,7 +245,9 @@ describe('Filtering', () => { expect(jobCount()).toBe(50); }); test('KeyboardShortcut u: toggle unclassified jobs', async () => { - const { queryAllByText, getAllByText } = render(testApp()); + const { queryAllByText, getAllByText } = render(testApp(), { + legacyRoot: true, + }); const symbolToRemove = 'yaml'; await waitFor(() => getAllByText(symbolToRemove)); fireEvent.keyDown(document.body, { key: 'u', keyCode: 85 }); @@ -295,7 +300,9 @@ describe('Filtering', () => { }; test('click signature should have 10 jobs', async () => { - const { getByTitle, findAllByText } = render(testApp()); + const { getByTitle, findAllByText } = render(testApp(), { + legacyRoot: true, + }); const build = await findAllByText('B'); @@ -311,7 +318,10 @@ describe('Filtering', () => { }); test('string "yaml" should have 10 jobs', async () => { - const { getAllByText, findAllByText, queryAllByText } = render(testApp()); + const { getAllByText, findAllByText, queryAllByText } = render( + testApp(), + { legacyRoot: true }, + ); await findAllByText('B'); const filterField = document.querySelector('#quick-filter'); setFilterText(filterField, 'yaml'); @@ -328,7 +338,7 @@ describe('Filtering', () => { }); test('KeyboardShortcut f: focus the quick filter input', async () => { - const { findAllByText } = render(testApp()); + const { findAllByText } = render(testApp(), { legacyRoot: true }); await findAllByText('B'); const filterField = document.querySelector('#quick-filter'); @@ -344,7 +354,7 @@ describe('Filtering', () => { getAllByText, getByPlaceholderText, queryAllByText, - } = render(testApp()); + } = render(testApp(), { legacyRoot: true }); await findAllByText('B'); const filterField = getByPlaceholderText('Filter platforms & jobs'); setFilterText(filterField, 'yaml'); @@ -373,7 +383,10 @@ describe('Filtering', () => { }; test('uncheck success should leave 30 jobs', async () => { - const { getAllByText, findAllByText, queryAllByText } = render(testApp()); + const { getAllByText, findAllByText, queryAllByText } = render( + testApp(), + { legacyRoot: true }, + ); await findAllByText('B'); clickFilterChicklet('green'); @@ -391,7 +404,10 @@ describe('Filtering', () => { }); test('uncheck failures should leave 20 jobs', async () => { - const { getAllByText, findAllByText, queryAllByText } = render(testApp()); + const { getAllByText, findAllByText, queryAllByText } = render( + testApp(), + { legacyRoot: true }, + ); const symbolToRemove = 'B'; await findAllByText(symbolToRemove); @@ -410,7 +426,10 @@ describe('Filtering', () => { }); test('uncheck in progress should leave 20 jobs', async () => { - const { getAllByText, findAllByText, queryAllByText } = render(testApp()); + const { getAllByText, findAllByText, queryAllByText } = render( + testApp(), + { legacyRoot: true }, + ); const symbolToRemove = 'yaml'; await findAllByText('B'); @@ -428,7 +447,9 @@ describe('Filtering', () => { }); test('KeyboardShortcut i: toggle off in-progress tasks', async () => { - const { getAllByText, queryAllByText } = render(testApp()); + const { getAllByText, queryAllByText } = render(testApp(), { + legacyRoot: true, + }); const symbolToRemove = 'yaml'; await waitFor(() => getAllByText(symbolToRemove)); @@ -445,7 +466,10 @@ describe('Filtering', () => { }); test('KeyboardShortcut i: toggle on in-progress tasks', async () => { - const { getAllByText, findAllByText, queryAllByText } = render(testApp()); + const { getAllByText, findAllByText, queryAllByText } = render( + testApp(), + { legacyRoot: true }, + ); const symbolToRemove = 'yaml'; await waitFor(() => getAllByText(symbolToRemove)); @@ -469,7 +493,7 @@ describe('Filtering', () => { test('Filters | Reset should get back to original set of jobs', async () => { const { getAllByText, findAllByText, findByText, queryAllByText } = - render(testApp()); + render(testApp(), { legacyRoot: true }); const symbolToRemove = 'yaml'; await findAllByText('B'); diff --git a/tests/ui/job-view/PushList_test.jsx b/tests/ui/job-view/PushList_test.jsx index b8d1132f52c..12f70b64df9 100644 --- a/tests/ui/job-view/PushList_test.jsx +++ b/tests/ui/job-view/PushList_test.jsx @@ -158,13 +158,13 @@ describe('PushList', () => { const push2Id = 'push-511137'; test('should have 2 pushes', async () => { - render(testPushList()); + render(testPushList(), { legacyRoot: true }); expect(await pushCount()).toHaveLength(2); }); test('should switch to single loaded revision', async () => { - const { getAllByTitle } = render(testPushList()); + const { getAllByTitle } = render(testPushList(), { legacyRoot: true }); expect(await pushCount()).toHaveLength(2); const pushLinks = await getAllByTitle('View only this push'); @@ -175,7 +175,9 @@ describe('PushList', () => { }); test('should reload pushes when setting fromchange', async () => { - const { queryAllByTestId, queryByTestId } = render(testPushList()); + const { queryAllByTestId, queryByTestId } = render(testPushList(), { + legacyRoot: true, + }); expect(await pushCount()).toHaveLength(2); @@ -200,7 +202,7 @@ describe('PushList', () => { }); test('should reload pushes when setting tochange', async () => { - const { getByTestId } = render(testPushList()); + const { getByTestId } = render(testPushList(), { legacyRoot: true }); expect(await pushCount()).toHaveLength(2); @@ -223,7 +225,9 @@ describe('PushList', () => { }); test('should load N more pushes when click next N', async () => { - const { getByTestId, getAllByTestId } = render(testPushList()); + const { getByTestId, getAllByTestId } = render(testPushList(), { + legacyRoot: true, + }); const nextNUrl = (count) => getProjectUrl(`/push/?full=true&count=${count + 1}&push_timestamp__lte=`); const clickNext = (count) => @@ -272,7 +276,7 @@ describe('PushList', () => { }); test('jobs should have fields required for retriggers', async () => { - const { getByText } = render(testPushList()); + const { getByText } = render(testPushList(), { legacyRoot: true }); const jobEl = await waitFor(() => getByText('yaml')); const jobInstance = findJobInstance(jobEl.getAttribute('data-job-id')); const { job } = jobInstance.props; diff --git a/tests/ui/job-view/Push_test.jsx b/tests/ui/job-view/Push_test.jsx index 2c3a91090d1..874c52050b8 100644 --- a/tests/ui/job-view/Push_test.jsx +++ b/tests/ui/job-view/Push_test.jsx @@ -164,7 +164,9 @@ describe('Push', () => { // eslint-disable-next-line jest/no-disabled-tests test.skip('jobs should have test_path field to filter', async () => { const { store } = configureStore(); - const { getByText } = render(testPush(store, new FilterModel())); + const { getByText } = render(testPush(store, new FilterModel()), { + legacyRoot: true, + }); const validateJob = async (name, testPaths) => { const jobEl = await waitFor(() => getByText(name)); diff --git a/tests/ui/job-view/SecondaryNavBar_test.jsx b/tests/ui/job-view/SecondaryNavBar_test.jsx index fcf5320f86a..a642e556791 100644 --- a/tests/ui/job-view/SecondaryNavBar_test.jsx +++ b/tests/ui/job-view/SecondaryNavBar_test.jsx @@ -71,7 +71,9 @@ describe('SecondaryNavBar', () => { }, router, }); - const { getByText } = render(testSecondaryNavBar(store)); + const { getByText } = render(testSecondaryNavBar(store), { + legacyRoot: true, + }); expect(await waitFor(() => getByText(repoName))).toBeInTheDocument(); expect(await waitFor(() => getByText('52'))).toBeInTheDocument(); @@ -86,7 +88,9 @@ describe('SecondaryNavBar', () => { }, router, }); - const { getByText } = render(testSecondaryNavBar(store)); + const { getByText } = render(testSecondaryNavBar(store), { + legacyRoot: true, + }); expect(await waitFor(() => getByText(repoName))).toBeInTheDocument(); expect(await waitFor(() => getByText('22'))).toBeInTheDocument(); @@ -106,7 +110,9 @@ describe('SecondaryNavBar', () => { updateButtonClick: jest.fn(), }; - const { container } = render(testSecondaryNavBar(store, props)); + const { container } = render(testSecondaryNavBar(store, props), { + legacyRoot: true, + }); const el = container.querySelector('#revisionChangedLabel'); fireEvent.click(el); expect(props.updateButtonClick).toHaveBeenCalled(); diff --git a/tests/ui/job-view/bugfiler_test.jsx b/tests/ui/job-view/bugfiler_test.jsx index b4a28a50f7d..707021a2cc2 100644 --- a/tests/ui/job-view/bugfiler_test.jsx +++ b/tests/ui/job-view/bugfiler_test.jsx @@ -155,7 +155,7 @@ describe('BugFiler', () => { search: summary, }; - render(bugFilerComponentSuggestion(suggestion)); + render(bugFilerComponentSuggestion(suggestion), { legacyRoot: true }); const area = screen.getAllByRole('textbox'); // TODO: hardcoded '1' in the array index // TODO: this used to check specific areas of summary, @@ -285,8 +285,8 @@ describe('BugFiler', () => { }, ]; - render(bugFilerComponentSuggestions(suggestions)); - const signatureArea = await screen.getByDisplayValue( + render(bugFilerComponentSuggestions(suggestions), { legacyRoot: true }); + const signatureArea = screen.getByDisplayValue( '[@ servo_arc::HeaderSlice::slice]', ); expect(signatureArea).toBeInTheDocument(); @@ -302,8 +302,8 @@ describe('BugFiler', () => { }, ]; - render(bugFilerComponentSuggestions(suggestions)); - const signatureArea = await screen.queryByDisplayValue('test_webvr.html'); + render(bugFilerComponentSuggestions(suggestions), { legacyRoot: true }); + const signatureArea = screen.queryByDisplayValue('test_webvr.html'); expect(signatureArea).toBeNull(); }); @@ -316,10 +316,8 @@ describe('BugFiler', () => { 'SUMMARY: AddressSanitizer: heap-use-after-free /builds/worker/checkouts/gecko/mock/folder/file.c:12:34 in mock::MockComponent::MockMethod(mock::squirrel::Weasel*)', }, ]; - render(bugFilerComponentSuggestions(suggestions)); - const securityIssue = await screen.getByText( - 'Report this as a security issue', - ); + render(bugFilerComponentSuggestions(suggestions), { legacyRoot: true }); + const securityIssue = screen.getByText('Report this as a security issue'); expect(securityIssue).toBeTruthy(); }); @@ -333,10 +331,8 @@ describe('BugFiler', () => { }, ]; - render(bugFilerComponentSuggestions(suggestions)); - const securityIssue = await screen.getByText( - 'Report this as a security issue', - ); + render(bugFilerComponentSuggestions(suggestions), { legacyRoot: true }); + const securityIssue = screen.getByText('Report this as a security issue'); expect(securityIssue.checked).toBeFalsy(); }); @@ -350,7 +346,7 @@ describe('BugFiler', () => { }); test('should strip omitted leads from thisFailure', async () => { - const { getByTitle } = render(bugFilerComponentSuggestions(PdfSuggestions)); + const { getByTitle } = bugFilerComponentSuggestions(PdfSuggestions); const toggleSummary = getByTitle('expand'); await fireEvent.click(toggleSummary); diff --git a/tests/ui/job-view/details/PinBoard_test.jsx b/tests/ui/job-view/details/PinBoard_test.jsx index 4922cc479ac..fd6a3a11c13 100644 --- a/tests/ui/job-view/details/PinBoard_test.jsx +++ b/tests/ui/job-view/details/PinBoard_test.jsx @@ -152,7 +152,7 @@ describe('DetailsPanel', () => { }; test('pin selected job with button', async () => { - const { getByTitle } = render(testDetailsPanel()); + const { getByTitle } = render(testDetailsPanel(), { legacyRoot: true }); store.dispatch(setSelectedJob(jobList.data[1], true)); fireEvent.click(await waitFor(() => getByTitle('Pin job'))); @@ -166,7 +166,7 @@ describe('DetailsPanel', () => { }); test('KeyboardShortcut space: pin selected job', async () => { - const { getByTitle } = render(testDetailsPanel()); + const { getByTitle } = render(testDetailsPanel(), { legacyRoot: true }); store.dispatch(setSelectedJob(jobList.data[1], true)); const content = await waitFor(() => @@ -182,7 +182,9 @@ describe('DetailsPanel', () => { }); test('KeyboardShortcut b: pin selected task and edit bug', async () => { - const { getByPlaceholderText } = render(testDetailsPanel()); + const { getByPlaceholderText } = render(testDetailsPanel(), { + legacyRoot: true, + }); store.dispatch(setSelectedJob(jobList.data[1], true)); const content = await waitFor(() => @@ -201,7 +203,9 @@ describe('DetailsPanel', () => { }); test('KeyboardShortcut c: pin selected task and edit comment', async () => { - const { getByPlaceholderText } = render(testDetailsPanel()); + const { getByPlaceholderText } = render(testDetailsPanel(), { + legacyRoot: true, + }); store.dispatch(setSelectedJob(jobList.data[1], true)); const content = await waitFor(() => @@ -218,7 +222,7 @@ describe('DetailsPanel', () => { }); test('KeyboardShortcut ctrl+shift+u: clear PinBoard', async () => { - const { getByTitle } = render(testDetailsPanel()); + const { getByTitle } = render(testDetailsPanel(), { legacyRoot: true }); store.dispatch(setSelectedJob(jobList.data[1], true)); fireEvent.click(await waitFor(() => getByTitle('Pin job'))); @@ -238,7 +242,9 @@ describe('DetailsPanel', () => { }); test('clear PinBoard', async () => { - const { getByTitle, getByText } = render(testDetailsPanel()); + const { getByTitle, getByText } = render(testDetailsPanel(), { + legacyRoot: true, + }); store.dispatch(setSelectedJob(jobList.data[1], true)); fireEvent.click(await waitFor(() => getByTitle('Pin job'))); @@ -255,7 +261,9 @@ describe('DetailsPanel', () => { }); test('pin all jobs', async () => { - const { queryAllByTitle } = render(testDetailsPanel()); + const { queryAllByTitle } = render(testDetailsPanel(), { + legacyRoot: true, + }); store.dispatch(pinJobs(jobList.data)); const unPinJobBtns = queryAllByTitle('Unpin job'); expect(unPinJobBtns).toHaveLength(5); @@ -263,7 +271,7 @@ describe('DetailsPanel', () => { test('classify and unclassify all jobs', async () => { const { getByPlaceholderText, getByText, getByTitle, queryAllByTitle } = - render(testDetailsPanel()); + render(testDetailsPanel(), { legacyRoot: true }); store.dispatch(pinJobs(jobList.data)); store.dispatch(setSelectedJob(jobList.data[1], true)); diff --git a/tests/ui/job-view/fuzzy_test.jsx b/tests/ui/job-view/fuzzy_test.jsx index 768aec73853..33e96759cf1 100644 --- a/tests/ui/job-view/fuzzy_test.jsx +++ b/tests/ui/job-view/fuzzy_test.jsx @@ -55,7 +55,9 @@ describe('FuzzyJobFinder', () => { ); test('Fuzzy search gives expected results', async () => { - const { getByTitle, queryAllByTestId } = await render(testFuzzyJobFinder); + const { getByTitle, queryAllByTestId } = await render(testFuzzyJobFinder, { + legacyRoot: true, + }); const inputElement = getByTitle('Filter the list of runnable jobs'); await waitFor(() => { @@ -84,7 +86,9 @@ describe('FuzzyJobFinder', () => { }); test('Fuzzy search gives expected results for extended operators', async () => { - const { getByTitle, queryAllByTestId } = await render(testFuzzyJobFinder); + const { getByTitle, queryAllByTestId } = await render(testFuzzyJobFinder, { + legacyRoot: true, + }); const inputElement = getByTitle('Filter the list of runnable jobs'); await waitFor(() => { diff --git a/tests/ui/job-view/groups_test.jsx b/tests/ui/job-view/groups_test.jsx index 898831082b7..777742eedee 100644 --- a/tests/ui/job-view/groups_test.jsx +++ b/tests/ui/job-view/groups_test.jsx @@ -55,14 +55,16 @@ describe('JobGroup component', () => { Tests Jobs view */ it('collapsed should show a job and count of 2 icon when collapsed', async () => { - const { getByTestId } = render(jobGroup(countGroup)); + const { getByTestId } = render(jobGroup(countGroup), { legacyRoot: true }); const jobGroupCount = await waitFor(() => getByTestId('job-group-count')); expect(jobGroupCount).toHaveTextContent('2'); }); test('should show a job and count of 2 icon when re-collapsed', async () => { - const { getByText, getByTestId } = render(jobGroup(countGroup)); + const { getByText, getByTestId } = render(jobGroup(countGroup), { + legacyRoot: true, + }); const jobGroupCount = await waitFor(() => getByTestId('job-group-count')); expect(jobGroupCount).toHaveTextContent('2'); @@ -78,7 +80,9 @@ describe('JobGroup component', () => { }); test('should show jobs, not counts when expanded', async () => { - const { getByTestId, getAllByTestId } = render(jobGroup(countGroup)); + const { getByTestId, getAllByTestId } = render(jobGroup(countGroup), { + legacyRoot: true, + }); const jobGroupCount = await waitFor(() => getByTestId('job-group-count')); expect(jobGroupCount).toHaveTextContent('2'); @@ -95,6 +99,7 @@ describe('JobGroup component', () => { const groupCountsExpanded = true; const { queryByTestId, getAllByTestId } = render( jobGroup(countGroup, groupCountsExpanded), + { legacyRoot: true }, ); const expandedJobs = await waitFor(() => getAllByTestId('job-btn')); @@ -105,7 +110,7 @@ describe('JobGroup component', () => { }); test('should hide duplicates by default', async () => { - const { getAllByTestId } = render(jobGroup(dupGroup)); + const { getAllByTestId } = render(jobGroup(dupGroup), { legacyRoot: true }); const jobGroupCount = await waitFor(() => getAllByTestId('job-group-count'), diff --git a/tests/ui/job-view/revisions_test.jsx b/tests/ui/job-view/revisions_test.jsx index 98abed8f639..2128087b2f7 100644 --- a/tests/ui/job-view/revisions_test.jsx +++ b/tests/ui/job-view/revisions_test.jsx @@ -83,6 +83,7 @@ describe('Revision list component', () => { revisionCount={push.revision_count} bugSummaryMap={push.bugSummaryMap} />, + { legacyRoot: true }, ); expect(getAllByTestId('revision')).toHaveLength(push.revision_count); @@ -99,6 +100,7 @@ describe('Revision list component', () => { revisionCount={push.revision_count} bugSummaryMap={push.bugSummaryMap} />, + { legacyRoot: true }, ); expect(getByText('\u2026and more')).toBeInTheDocument(); }); @@ -112,6 +114,7 @@ describe('Revision item component', () => { revision={revision} bugSummaryMap={push.bugSummaryMap} />, + { legacyRoot: true }, ); const revLink = await waitFor(() => getByText('5a110ad242ea')); @@ -130,6 +133,7 @@ describe('Revision item component', () => { revision={revision} bugSummaryMap={push.bugSummaryMap} />, + { legacyRoot: true }, ); expect(getByText('AB')).toBeInTheDocument(); }); @@ -141,6 +145,7 @@ describe('Revision item component', () => { revision={revision} bugSummaryMap={push.bugSummaryMap} />, + { legacyRoot: true }, ); expect( @@ -159,6 +164,7 @@ describe('Revision item component', () => { revision={revision} bugSummaryMap={push.bugSummaryMap} />, + { legacyRoot: true }, ); expect(document.querySelectorAll('.text-danger')).toHaveLength(1); @@ -173,6 +179,7 @@ describe('Revision item component', () => { revision={revision} bugSummaryMap={push.bugSummaryMap} />, + { legacyRoot: true }, ); expect(document.querySelectorAll('.text-danger')).toHaveLength(1); @@ -183,6 +190,7 @@ describe('More revisions link component', () => { test('renders an "...and more" link', () => { const { getByText } = render( , + { legacyRoot: true }, ); const link = getByText('\u2026and more'); @@ -191,7 +199,7 @@ describe('More revisions link component', () => { }); test('has an external link icon', () => { - render(); + render(, { legacyRoot: true }); expect( document.querySelectorAll('svg.svg-inline--fa.fa-square-up-right'), @@ -205,6 +213,7 @@ describe('initials filter', () => { const name = 'Starscream'; const { getByText } = render( , + { legacyRoot: true }, ); expect(getByText('S')).toBeInTheDocument(); @@ -214,6 +223,7 @@ describe('initials filter', () => { const name = 'Optimus Prime'; const { getByText } = render( , + { legacyRoot: true }, ); expect(getByText('OP')).toBeInTheDocument(); @@ -223,6 +233,7 @@ describe('initials filter', () => { const name = 'Some Other Transformer'; const { getByText } = render( , + { legacyRoot: true }, ); expect(getByText('ST')).toBeInTheDocument(); diff --git a/tests/ui/job-view/selected_job_test.jsx b/tests/ui/job-view/selected_job_test.jsx index 01a480520b6..e542ac250d8 100644 --- a/tests/ui/job-view/selected_job_test.jsx +++ b/tests/ui/job-view/selected_job_test.jsx @@ -72,7 +72,7 @@ const testPushJobs = (filtermodel = null) => { }; test('select a job updates url', async () => { - const { getByText } = render(testPushJobs()); + const { getByText } = render(testPushJobs(), { legacyRoot: true }); const spell = getByText('spell'); expect(spell).toBeInTheDocument(); @@ -86,7 +86,7 @@ test('select a job updates url', async () => { }); test('filter change keeps selected job visible', async () => { - const { getByText, rerender } = render(testPushJobs()); + const { getByText, rerender } = render(testPushJobs(), { legacyRoot: true }); const spell = await waitFor(() => getByText('spell')); const filterModel = new FilterModel({ router: { location: history.location }, diff --git a/tests/ui/logviewer/Logviewer_test.jsx b/tests/ui/logviewer/Logviewer_test.jsx index a69ab749130..c6b2c0446bf 100644 --- a/tests/ui/logviewer/Logviewer_test.jsx +++ b/tests/ui/logviewer/Logviewer_test.jsx @@ -66,7 +66,7 @@ describe('Logviewer App', () => { }); test('should have links to Perfherder and Intermittent Failures View', async () => { - const { findByText } = render(testApp()); + const { findByText } = render(testApp(), { legacyRoot: true }); const appMenu = await findByText('Logviewer'); expect(appMenu).toBeInTheDocument(); @@ -83,7 +83,7 @@ describe('Logviewer App', () => { }); test('should have a show job info button', async () => { - const { findByText } = render(testApp()); + const { findByText } = render(testApp(), { legacyRoot: true }); const showButton = await findByText('Show Job Info'); diff --git a/tests/ui/perfherder/alerts-view/alerts_table_row_test.jsx b/tests/ui/perfherder/alerts-view/alerts_table_row_test.jsx index adbfbc58ee9..e4e07d4bb64 100644 --- a/tests/ui/perfherder/alerts-view/alerts_table_row_test.jsx +++ b/tests/ui/perfherder/alerts-view/alerts_table_row_test.jsx @@ -55,6 +55,7 @@ const alertTableRowTest = ( /> , + { legacyRoot: true }, ); }; diff --git a/tests/ui/perfherder/alerts-view/alerts_test.jsx b/tests/ui/perfherder/alerts-view/alerts_test.jsx index 18d2831fee6..38d039a9f05 100644 --- a/tests/ui/perfherder/alerts-view/alerts_test.jsx +++ b/tests/ui/perfherder/alerts-view/alerts_test.jsx @@ -101,6 +101,7 @@ const alertsView = () => { /> , + { legacyRoot: true }, ); }; @@ -151,11 +152,12 @@ const alertsViewControls = ({ /> , + { legacyRoot: true }, ); }; const tagsList = (tags = []) => { - return render(); + return render(, { legacyRoot: true }); }; const modifyAlertSpy = jest.spyOn(mockModifyAlert, 'update'); diff --git a/tests/ui/perfherder/alerts-view/collapsable_rows_test.jsx b/tests/ui/perfherder/alerts-view/collapsable_rows_test.jsx index a07410b5442..0d0fb850cef 100644 --- a/tests/ui/perfherder/alerts-view/collapsable_rows_test.jsx +++ b/tests/ui/perfherder/alerts-view/collapsable_rows_test.jsx @@ -38,6 +38,7 @@ const collapsableRowsTest = () => { /> , + { legacyRoot: true }, ); }; diff --git a/tests/ui/perfherder/alerts-view/magnitude_test.jsx b/tests/ui/perfherder/alerts-view/magnitude_test.jsx index 409e7545196..0e2353713e8 100644 --- a/tests/ui/perfherder/alerts-view/magnitude_test.jsx +++ b/tests/ui/perfherder/alerts-view/magnitude_test.jsx @@ -11,7 +11,7 @@ testAlert.prev_value = 1383.38; testAlert.new_value = 1211.78; const magnitude = () => { - return render(); + return render(, { legacyRoot: true }); }; test('Previous value is abbreviated', async () => { diff --git a/tests/ui/perfherder/alerts-view/modal_file_bug_test.jsx b/tests/ui/perfherder/alerts-view/modal_file_bug_test.jsx index 725ddd9aff1..ee54af8a7b7 100644 --- a/tests/ui/perfherder/alerts-view/modal_file_bug_test.jsx +++ b/tests/ui/perfherder/alerts-view/modal_file_bug_test.jsx @@ -18,6 +18,7 @@ const testFileBugModal = (handleClose) => { title="Bug Number" submitButtonText="File Bug" />, + { legacyRoot: true }, ); }; diff --git a/tests/ui/perfherder/alerts-view/modal_perf_tags_test.jsx b/tests/ui/perfherder/alerts-view/modal_perf_tags_test.jsx index 9ebc12d6e8e..7ff5596fd90 100644 --- a/tests/ui/perfherder/alerts-view/modal_perf_tags_test.jsx +++ b/tests/ui/perfherder/alerts-view/modal_perf_tags_test.jsx @@ -18,6 +18,7 @@ const testTagsModal = (handleClose) => { toggle={handleClose || toggle} updateAndClose={() => {}} />, + { legacyRoot: true }, ); }; diff --git a/tests/ui/perfherder/alerts-view/select_alert_framework_test.jsx b/tests/ui/perfherder/alerts-view/select_alert_framework_test.jsx index f47e1ac0dcf..8469db1d19a 100644 --- a/tests/ui/perfherder/alerts-view/select_alert_framework_test.jsx +++ b/tests/ui/perfherder/alerts-view/select_alert_framework_test.jsx @@ -37,6 +37,7 @@ const testFrameworksDropdown = () => { updateOnEnter dropdownCol />, + { legacyRoot: true }, ); }; diff --git a/tests/ui/perfherder/alerts-view/select_alerts_dropdown_test.jsx b/tests/ui/perfherder/alerts-view/select_alerts_dropdown_test.jsx index af23023544f..4a193b4b270 100644 --- a/tests/ui/perfherder/alerts-view/select_alerts_dropdown_test.jsx +++ b/tests/ui/perfherder/alerts-view/select_alerts_dropdown_test.jsx @@ -26,6 +26,7 @@ const selectAlertsDropdown = (user) => { allSelected={false} alertSummary={testAlertSummary} />, + { legacyRoot: true }, ); }; diff --git a/tests/ui/perfherder/alerts-view/status_dropdown_test.jsx b/tests/ui/perfherder/alerts-view/status_dropdown_test.jsx index c6efafa7765..d3e0b608e0a 100644 --- a/tests/ui/perfherder/alerts-view/status_dropdown_test.jsx +++ b/tests/ui/perfherder/alerts-view/status_dropdown_test.jsx @@ -45,6 +45,7 @@ const testStatusDropdown = (summaryTags, alertSummary) => { performanceTags={testPerformanceTags} frameworks={[{ id: 1, name: dummyFrameworkName }]} />, + { legacyRoot: true }, ); }; diff --git a/tests/ui/perfherder/compare-view/compare_page_title_test.jsx b/tests/ui/perfherder/compare-view/compare_page_title_test.jsx index 9d50bf5da1c..f5150d6e482 100644 --- a/tests/ui/perfherder/compare-view/compare_page_title_test.jsx +++ b/tests/ui/perfherder/compare-view/compare_page_title_test.jsx @@ -25,7 +25,7 @@ const comparePageTitle = (hasSubtests) => { afterEach(cleanup); test('Compare page title includes the platform name with subtest summary when there are subtests', async () => { - const { getByText } = render(comparePageTitle(true)); + const { getByText } = render(comparePageTitle(true), { legacyRoot: true }); const pageTitle = await waitFor(() => getByText(`${title} subtest summary`)); @@ -33,7 +33,7 @@ test('Compare page title includes the platform name with subtest summary when th }); test('Compare page tab title includes platform name', async () => { - render(comparePageTitle(true)); + render(comparePageTitle(true), { legacyRoot: true }); await waitFor(() => expect(document.title).toBe(defaultPageTitle)); }); diff --git a/tests/ui/perfherder/compare-view/compare_table_test.jsx b/tests/ui/perfherder/compare-view/compare_table_test.jsx index 69c9300076c..b518248c731 100644 --- a/tests/ui/perfherder/compare-view/compare_table_test.jsx +++ b/tests/ui/perfherder/compare-view/compare_table_test.jsx @@ -186,6 +186,7 @@ const compareTableControls = ( isBaseAggregate, mockDataRetrigger, ), + { legacyRoot: true }, ); const compareTable = (userLoggedIn, isBaseAggregate = false) => @@ -199,6 +200,7 @@ const compareTable = (userLoggedIn, isBaseAggregate = false) => isBaseAggregate={isBaseAggregate} projects={projects} />, + { legacyRoot: true }, ); const comparePageTitle = () => @@ -208,6 +210,7 @@ const comparePageTitle = () => updateParams={() => {}} pageTitleQueryParam="Perfherder Compare Revisions" />, + { legacyRoot: true }, ); test('toggle buttons should filter results by selected filter', async () => { @@ -461,7 +464,7 @@ test('retrigger buttons should appear only when the user is logged in', async () expect(retriggerButtons).toHaveLength(0); // simulate login - rerender(compareTableControlsNode(results, true)); + rerender(compareTableControlsNode(results, true), { legacyRoot: true }); retriggerButtons = queryAllByTitle(compareTableText.retriggerButtonTitle); expect(retriggerButtons).toHaveLength(3); @@ -876,7 +879,9 @@ test(`TableColumnHeader shows the title as expected`, async () => { currentSort: 'default', }, }; - const { queryByText } = render(); + const { queryByText } = render(, { + legacyRoot: true, + }); expect(queryByText('New (score)')).not.toBeInTheDocument(); expect(queryByText('New')).toBeInTheDocument(); diff --git a/tests/ui/perfherder/dropdown_menu_test.jsx b/tests/ui/perfherder/dropdown_menu_test.jsx index 5d848f2574b..37c2d909a71 100644 --- a/tests/ui/perfherder/dropdown_menu_test.jsx +++ b/tests/ui/perfherder/dropdown_menu_test.jsx @@ -24,6 +24,7 @@ const repoDropdownMenuItems = () => pinned={pinned.filter((item) => options.includes(item))} updateData={updateData} />, + { legacyRoot: true }, ); test('Pinned options are listed first', async () => { diff --git a/tests/ui/perfherder/graphs-view/graphs_view_test.jsx b/tests/ui/perfherder/graphs-view/graphs_view_test.jsx index ccedfd3e54e..9c0401abc77 100644 --- a/tests/ui/perfherder/graphs-view/graphs_view_test.jsx +++ b/tests/ui/perfherder/graphs-view/graphs_view_test.jsx @@ -112,6 +112,7 @@ const graphsViewControls = ( replicates={replicates} /> , + { legacyRoot: true }, ); }; afterEach(cleanup); diff --git a/tests/ui/perfherder/graphs-view/test_data_modal_test.jsx b/tests/ui/perfherder/graphs-view/test_data_modal_test.jsx index d83b1e0da40..274ebc9abee 100644 --- a/tests/ui/perfherder/graphs-view/test_data_modal_test.jsx +++ b/tests/ui/perfherder/graphs-view/test_data_modal_test.jsx @@ -65,6 +65,7 @@ const testDataModel = () => { })} getSeriesData={mockGetSeriesData} />, + { legacyRoot: true }, ); }; diff --git a/tests/ui/perfherder/legend_card_test.jsx b/tests/ui/perfherder/legend_card_test.jsx index 1b1fa4062ca..67fd3526dcc 100644 --- a/tests/ui/perfherder/legend_card_test.jsx +++ b/tests/ui/perfherder/legend_card_test.jsx @@ -66,6 +66,7 @@ const legendCard = ( colors={colors} symbols={graphSymbols} />, + { legacyRoot: true }, ); afterEach(cleanup); diff --git a/tests/ui/perfherder/replicates_graph_test.jsx b/tests/ui/perfherder/replicates_graph_test.jsx index 187434bbea5..8479de20266 100644 --- a/tests/ui/perfherder/replicates_graph_test.jsx +++ b/tests/ui/perfherder/replicates_graph_test.jsx @@ -122,6 +122,7 @@ const replicatesGraph = (mockedGetData, mockedGetReplicateData) => getData={mockedGetData} getReplicateData={mockedGetReplicateData} />, + { legacyRoot: true }, ); test('graph with available data displays properly', async () => { diff --git a/tests/ui/perfherder/retrigger_modal_test.jsx b/tests/ui/perfherder/retrigger_modal_test.jsx index 844093ca3c4..5d906e6535b 100644 --- a/tests/ui/perfherder/retrigger_modal_test.jsx +++ b/tests/ui/perfherder/retrigger_modal_test.jsx @@ -22,7 +22,7 @@ const retriggerModal = ( isBaseAggregate, currentRetriggerRow, }; - return render(); + return render(, { legacyRoot: true }); }; afterEach(cleanup); diff --git a/tests/ui/perfherder/selector_card_test.jsx b/tests/ui/perfherder/selector_card_test.jsx index dc3e08abf82..6eaa529d124 100644 --- a/tests/ui/perfherder/selector_card_test.jsx +++ b/tests/ui/perfherder/selector_card_test.jsx @@ -35,7 +35,9 @@ const renderReactNode = (getRevisions, updateState, parentState) => ( ); const selectorCard = (getRevisions, updateState, parentState, ref) => - render(renderReactNode(getRevisions, updateState, parentState, ref)); + render(renderReactNode(getRevisions, updateState, parentState, ref), { + legacyRoot: true, + }); test('correct hash for input value is valid', async () => { const parentState = { selectedRevision: validHash }; diff --git a/tests/ui/perfherder/table_view_test.jsx b/tests/ui/perfherder/table_view_test.jsx index 452d03eefbf..fa245b30248 100644 --- a/tests/ui/perfherder/table_view_test.jsx +++ b/tests/ui/perfherder/table_view_test.jsx @@ -33,6 +33,7 @@ const tableView = ( highlightedRevisions={highlightedRevisions} projects={projects} />, + { legacyRoot: true }, ); afterEach(cleanup); diff --git a/tests/ui/push-health/Action_test.jsx b/tests/ui/push-health/Action_test.jsx index df5577944cd..0a62f35e937 100644 --- a/tests/ui/push-health/Action_test.jsx +++ b/tests/ui/push-health/Action_test.jsx @@ -23,7 +23,10 @@ describe('Action', () => { ); test('should group by test path', async () => { - const { getAllByTestId } = render(testAction(tests, jobs, 'path', 'count')); + const { getAllByTestId } = render( + testAction(tests, jobs, 'path', 'count'), + { legacyRoot: true }, + ); expect(await waitFor(() => getAllByTestId('test-grouping'))).toHaveLength( 3, @@ -33,6 +36,7 @@ describe('Action', () => { test('should group by platform', async () => { const { getAllByTestId } = render( testAction(tests, jobs, 'platform', 'count'), + { legacyRoot: true }, ); expect(await waitFor(() => getAllByTestId('test-grouping'))).toHaveLength( @@ -41,7 +45,10 @@ describe('Action', () => { }); test('should bold the test file', async () => { - const { getAllByTestId } = render(testAction(tests, jobs, 'path', 'count')); + const { getAllByTestId } = render( + testAction(tests, jobs, 'path', 'count'), + { legacyRoot: true }, + ); expect( await waitFor(() => getAllByTestId('group-slash-bolded')), diff --git a/tests/ui/push-health/ClassificationGroup_test.jsx b/tests/ui/push-health/ClassificationGroup_test.jsx index 65e35ed5f46..39eaed27f30 100644 --- a/tests/ui/push-health/ClassificationGroup_test.jsx +++ b/tests/ui/push-health/ClassificationGroup_test.jsx @@ -25,7 +25,9 @@ describe('ClassificationGroup', () => { ); test('should group by test path', async () => { - const { getAllByTestId } = render(testClassificationGroup(tests, 'path')); + const { getAllByTestId } = render(testClassificationGroup(tests, 'path'), { + legacyRoot: true, + }); expect(await waitFor(() => getAllByTestId('test-grouping'))).toHaveLength( 3, @@ -35,6 +37,7 @@ describe('ClassificationGroup', () => { test('should group by platform', async () => { const { getAllByTestId } = render( testClassificationGroup(tests, 'platform'), + { legacyRoot: true }, ); expect(await waitFor(() => getAllByTestId('test-grouping'))).toHaveLength( diff --git a/tests/ui/push-health/CommitHistory_test.jsx b/tests/ui/push-health/CommitHistory_test.jsx index 9327a156413..6bbe1215b65 100644 --- a/tests/ui/push-health/CommitHistory_test.jsx +++ b/tests/ui/push-health/CommitHistory_test.jsx @@ -33,7 +33,9 @@ describe('CommitHistory', () => { test('should show the push header and the author', () => { const { details: commitHistory } = pushHealth.metrics.commitHistory; - const { getByTestId } = render(testCommitHistory(commitHistory)); + const { getByTestId } = render(testCommitHistory(commitHistory), { + legacyRoot: true, + }); const headerText = getByTestId('headerText'); const authorTime = getByTestId('authorTime'); @@ -51,6 +53,7 @@ describe('CommitHistory', () => { const { details: commitHistory } = pushHealth.metrics.commitHistory; const { getByText, getByTestId, queryByTestId } = render( testCommitHistory(commitHistory), + { legacyRoot: true }, ); const parentLink = getByTestId('parent-commit-sha'); @@ -76,6 +79,7 @@ describe('CommitHistory', () => { const { getByText, getByTestId, queryByTestId } = render( testCommitHistory(commitHistory), + { legacyRoot: true }, ); expect( getByText( @@ -106,6 +110,7 @@ describe('CommitHistory', () => { const { getByText, queryByTestId } = render( testCommitHistory(commitHistory), + { legacyRoot: true }, ); expect( await waitFor(() => diff --git a/tests/ui/push-health/Health_test.jsx b/tests/ui/push-health/Health_test.jsx index fe436304670..73e3b4beec5 100644 --- a/tests/ui/push-health/Health_test.jsx +++ b/tests/ui/push-health/Health_test.jsx @@ -133,7 +133,7 @@ describe('Health', () => { test('should show some grouped tests', async () => { history.push(`/push-health?repo=${repo}&revision=${revision}`); - const health = render(testHealth()); + const health = render(testHealth(), { legacyRoot: true }); const classificationGroups = await waitFor(() => health.getAllByTestId('classification-group'), ); @@ -154,7 +154,7 @@ describe('Health', () => { history.push( `/push-health?repo=${repo}&revision=${revision}&searchStr=browser/extensions/`, ); - const health = render(testHealth()); + const health = render(testHealth(), { legacyRoot: true }); const classificationGroups = await waitFor(() => health.getAllByTestId('classification-group'), ); diff --git a/tests/ui/push-health/MyPushes_test.jsx b/tests/ui/push-health/MyPushes_test.jsx index 5c94a81897b..cb9f37d782b 100644 --- a/tests/ui/push-health/MyPushes_test.jsx +++ b/tests/ui/push-health/MyPushes_test.jsx @@ -50,7 +50,9 @@ describe('My Pushes', () => { }; test('should show message if no author query param is provided and user is not logged in', async () => { - const { queryByText } = render(testMyPushes({ isLoggedIn: false })); + const { queryByText } = render(testMyPushes({ isLoggedIn: false }), { + legacyRoot: true, + }); // verify no author query param exists expect(history.location.search).toBe(''); @@ -61,7 +63,7 @@ describe('My Pushes', () => { }); test('should fetch the push health data if user is logged in and update query param', async () => { - const { getAllByText } = render(testMyPushes()); + const { getAllByText } = render(testMyPushes(), { legacyRoot: true }); const pushes = await waitFor(() => getAllByText(testUser.email)); expect(pushes).toHaveLength(3); @@ -73,6 +75,7 @@ describe('My Pushes', () => { history.location.search = `?author=${testUser.email}`; const { getAllByText } = render( testMyPushes({ email: '', isLoggedIn: false }), + { legacyRoot: true }, ); const pushes = await waitFor(() => getAllByText(testUser.email)); @@ -81,7 +84,9 @@ describe('My Pushes', () => { }); test('should filter pushes by repos', async () => { - const { getByText, getAllByTestId, queryByText } = render(testMyPushes()); + const { getByText, getAllByTestId, queryByText } = render(testMyPushes(), { + legacyRoot: true, + }); const tryPushes = await waitFor(() => getAllByTestId('header-repo')); expect(tryPushes).toHaveLength(3); diff --git a/tests/ui/push-health/PlatformConfig_test.jsx b/tests/ui/push-health/PlatformConfig_test.jsx index 6c39ff917ff..40098e70353 100644 --- a/tests/ui/push-health/PlatformConfig_test.jsx +++ b/tests/ui/push-health/PlatformConfig_test.jsx @@ -79,7 +79,9 @@ describe('PlatformConfig', () => { ); test('should show the test name', async () => { - const { getByText } = render(testPlatformConfig(testFailure, jobs)); + const { getByText } = render(testPlatformConfig(testFailure, jobs), { + legacyRoot: true, + }); expect( await waitFor(() => @@ -91,13 +93,17 @@ describe('PlatformConfig', () => { }); test('should not show details by default', async () => { - const { queryByTestId } = render(testPlatformConfig(testFailure, jobs)); + const { queryByTestId } = render(testPlatformConfig(testFailure, jobs), { + legacyRoot: true, + }); expect(queryByTestId('log-lines')).toBeNull(); }); test('should show bug suggestions when expander clicked', async () => { - const { getByText } = render(testPlatformConfig(testFailure, jobs)); + const { getByText } = render(testPlatformConfig(testFailure, jobs), { + legacyRoot: true, + }); const detailsButton = getByText('task'); fireEvent.click(detailsButton); @@ -110,7 +116,9 @@ describe('PlatformConfig', () => { }); test('should show artifacts when tab clicked', async () => { - const { getByText } = render(testPlatformConfig(testFailure, jobs)); + const { getByText } = render(testPlatformConfig(testFailure, jobs), { + legacyRoot: true, + }); const detailsButton = getByText('task'); fireEvent.click(detailsButton); diff --git a/tests/ui/push-health/TestMetric_test.jsx b/tests/ui/push-health/TestMetric_test.jsx index 3467e5ceba8..1bf6e99093b 100644 --- a/tests/ui/push-health/TestMetric_test.jsx +++ b/tests/ui/push-health/TestMetric_test.jsx @@ -25,7 +25,9 @@ describe('TestMetric', () => { ); test('should have a Possible Regressions section', async () => { - const { getByText } = render(testTestMetric(tests, jobs)); + const { getByText } = render(testTestMetric(tests, jobs), { + legacyRoot: true, + }); expect( await waitFor(() => getByText('Possible Regressions', { exact: false })), @@ -33,7 +35,9 @@ describe('TestMetric', () => { }); test('should have a Known Issues section', async () => { - const { getByText } = render(testTestMetric(tests, jobs)); + const { getByText } = render(testTestMetric(tests, jobs), { + legacyRoot: true, + }); expect( await waitFor(() => getByText('Known Issues', { exact: false })), @@ -41,7 +45,9 @@ describe('TestMetric', () => { }); test('should show the test name', async () => { - const { getByText } = render(testTestMetric(tests, jobs)); + const { getByText } = render(testTestMetric(tests, jobs), { + legacyRoot: true, + }); expect( await waitFor(() => diff --git a/tests/ui/push-health/Usage_test.jsx b/tests/ui/push-health/Usage_test.jsx index 3401a6f7c65..2fd58998de1 100644 --- a/tests/ui/push-health/Usage_test.jsx +++ b/tests/ui/push-health/Usage_test.jsx @@ -35,14 +35,14 @@ describe('Usage', () => { const revision = 'bdb000dbec165634372c03ad2a8692ed81bf98a1'; test('should show 10 facets', async () => { - const { getAllByTestId } = render(testUsage()); + const { getAllByTestId } = render(testUsage(), { legacyRoot: true }); const facets = await waitFor(() => getAllByTestId('facet-link')); expect(facets).toHaveLength(10); }); test('should show details about each revision', async () => { - const { getByTestId } = render(testUsage()); + const { getByTestId } = render(testUsage(), { legacyRoot: true }); const facet = await waitFor(() => getByTestId(`facet-${revision}`)); const { children } = facet; diff --git a/tests/ui/push-health/details/DetailsPanel_test.jsx b/tests/ui/push-health/details/DetailsPanel_test.jsx index 451ab34c54e..efdac578d2a 100644 --- a/tests/ui/push-health/details/DetailsPanel_test.jsx +++ b/tests/ui/push-health/details/DetailsPanel_test.jsx @@ -82,7 +82,9 @@ describe('DetailsPanel', () => { ); test('should have artifacts', async () => { - const { getAllByTestId, findByText } = render(testDetailsPanel(task)); + const { getAllByTestId, findByText } = render(testDetailsPanel(task), { + legacyRoot: true, + }); const artifactsTab = await findByText('Artifacts and Debugging Tools'); fireEvent.click(artifactsTab); @@ -93,7 +95,9 @@ describe('DetailsPanel', () => { }); test('should have bug suggestions', async () => { - const { getAllByTestId, findByText } = render(testDetailsPanel(task)); + const { getAllByTestId, findByText } = render(testDetailsPanel(task), { + legacyRoot: true, + }); const failuresTab = await findByText('Failure Summary'); fireEvent.click(failuresTab); @@ -104,7 +108,9 @@ describe('DetailsPanel', () => { }); test('should have a log viewer with custom buttons', async () => { - const { findByText, getByText } = render(testDetailsPanel(task)); + const { findByText, getByText } = render(testDetailsPanel(task), { + legacyRoot: true, + }); const LogViewerTab = await findByText('Log Viewer'); fireEvent.click(LogViewerTab); diff --git a/tests/ui/shared/FailureSummaryTab_test.jsx b/tests/ui/shared/FailureSummaryTab_test.jsx index 727c9cc2988..f67bcc84c23 100644 --- a/tests/ui/shared/FailureSummaryTab_test.jsx +++ b/tests/ui/shared/FailureSummaryTab_test.jsx @@ -72,7 +72,9 @@ describe('FailureSummaryTab', () => { ); test('failures should be visible', async () => { - const { findByText } = render(testFailureSummaryTab()); + const { findByText } = render(testFailureSummaryTab(), { + legacyRoot: true, + }); expect( await findByText( @@ -82,7 +84,9 @@ describe('FailureSummaryTab', () => { }); test('suggested duplicate bugs should mention open bug', async () => { - const { findByText } = render(testFailureSummaryTab()); + const { findByText } = render(testFailureSummaryTab(), { + legacyRoot: true, + }); await waitFor(() => screen.getAllByText('Show more bug suggestions')); fireEvent.click(screen.getAllByText('Show more bug suggestions')[1]); @@ -93,7 +97,9 @@ describe('FailureSummaryTab', () => { }); test('suggested non-duplicate bugs should not mention other bug like duplicates do', async () => { - const { findByText } = render(testFailureSummaryTab()); + const { findByText } = render(testFailureSummaryTab(), { + legacyRoot: true, + }); await waitFor(() => screen.getAllByText('Show more bug suggestions')); fireEvent.click(screen.getAllByText('Show more bug suggestions')[1]); @@ -104,7 +110,9 @@ describe('FailureSummaryTab', () => { }); test('classification with match to duplicate bug should put open bug into pinboard', async () => { - const { findByText } = render(testFailureSummaryTab()); + const { findByText } = render(testFailureSummaryTab(), { + legacyRoot: true, + }); await waitFor(() => screen.getAllByText('Show more bug suggestions')); fireEvent.click(screen.getAllByText('Show more bug suggestions')[1]); diff --git a/yarn.lock b/yarn.lock index 4217993492f..f81d903c39f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@adobe/css-tools@^4.3.2": - version "4.3.3" - resolved "https://registry.yarnpkg.com/@adobe/css-tools/-/css-tools-4.3.3.tgz#90749bde8b89cd41764224f5aac29cd4138f75ff" - integrity sha512-rE0Pygv0sEZ4vBWHlAgJLGDU7Pm8xoO6p3wsEceb7GYAjScrOHpEo8KK/eVkAcnSM+slAEtXjA2JpdjLp4fJQQ== +"@adobe/css-tools@^4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@adobe/css-tools/-/css-tools-4.4.0.tgz#728c484f4e10df03d5a3acd0d8adcbbebff8ad63" + integrity sha512-Ff9+ksdQQB3rMncgqDK78uLznstjyfIf2Arnh22pW8kBpLs6rpKDwgnZT46hin5Hl1WzazzK64DOrhSwYpS7bQ== "@ampproject/remapping@^2.1.0": version "2.2.0" @@ -30,13 +30,21 @@ dependencies: "@babel/highlight" "^7.10.4" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.0", "@babel/code-frame@^7.18.6": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.0", "@babel/code-frame@^7.18.6": version "7.18.6" resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz" integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== dependencies: "@babel/highlight" "^7.18.6" +"@babel/code-frame@^7.10.4", "@babel/code-frame@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.7.tgz#882fd9e09e8ee324e496bd040401c6f046ef4465" + integrity sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA== + dependencies: + "@babel/highlight" "^7.24.7" + picocolors "^1.0.0" + "@babel/code-frame@^7.22.13": version "7.22.13" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" @@ -45,14 +53,6 @@ "@babel/highlight" "^7.22.13" chalk "^2.4.2" -"@babel/code-frame@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.7.tgz#882fd9e09e8ee324e496bd040401c6f046ef4465" - integrity sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA== - dependencies: - "@babel/highlight" "^7.24.7" - picocolors "^1.0.0" - "@babel/compat-data@^7.16.0": version "7.16.4" resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.4.tgz" @@ -1978,17 +1978,6 @@ slash "^3.0.0" write-file-atomic "^4.0.2" -"@jest/types@^27.4.2": - version "27.4.2" - resolved "https://registry.npmjs.org/@jest/types/-/types-27.4.2.tgz" - integrity sha512-j35yw0PMTPpZsUoOBiuHzr1zTYoad1cVIE0ajEjcrJONxxrko/IRGKkXx3os0Nsi4Hu3+5VmDbVfq5WhG/pWAg== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^16.0.0" - chalk "^4.0.0" - "@jest/types@^28.1.3": version "28.1.3" resolved "https://registry.npmjs.org/@jest/types/-/types-28.1.3.tgz" @@ -2384,41 +2373,40 @@ dependencies: "@sinonjs/commons" "^1.7.0" -"@testing-library/dom@^8.0.0": - version "8.11.1" - resolved "https://registry.npmjs.org/@testing-library/dom/-/dom-8.11.1.tgz" - integrity sha512-3KQDyx9r0RKYailW2MiYrSSKEfH0GTkI51UGEvJenvcoDoeRYs0PZpi2SXqtnMClQvCqdtTTpOfFETDTVADpAg== +"@testing-library/dom@10.1.0": + version "10.1.0" + resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-10.1.0.tgz#2d073e49771ad614da999ca48f199919e5176fb6" + integrity sha512-wdsYKy5zupPyLCW2Je5DLHSxSfbIp6h80WoHOQc+RPtmPGA52O9x5MJEkv92Sjonpq+poOAtUKhh1kBGAXBrNA== dependencies: "@babel/code-frame" "^7.10.4" "@babel/runtime" "^7.12.5" - "@types/aria-query" "^4.2.0" - aria-query "^5.0.0" + "@types/aria-query" "^5.0.1" + aria-query "5.3.0" chalk "^4.1.0" dom-accessibility-api "^0.5.9" - lz-string "^1.4.4" + lz-string "^1.5.0" pretty-format "^27.0.2" -"@testing-library/jest-dom@6.1.6": - version "6.1.6" - resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-6.1.6.tgz#d9a3ce61cd74ea792622d3da78a830f6786e8d93" - integrity sha512-YwuiOdYEcxhfC2u5iNKlvg2Q5MgbutovP6drq7J1HrCbvR+G58BbtoCoq+L/kNlrNFsu2Kt3jaFAviLVxYHJZg== +"@testing-library/jest-dom@6.4.6": + version "6.4.6" + resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-6.4.6.tgz#ec1df8108651bed5475534955565bed88c6732ce" + integrity sha512-8qpnGVincVDLEcQXWaHOf6zmlbwTKc6Us6PPu4CRnPXCzo2OGBS5cwgMMOWdxDpEz1mkbvXHpEy99M5Yvt682w== dependencies: - "@adobe/css-tools" "^4.3.2" + "@adobe/css-tools" "^4.4.0" "@babel/runtime" "^7.9.2" aria-query "^5.0.0" chalk "^3.0.0" css.escape "^1.5.1" - dom-accessibility-api "^0.5.6" - lodash "^4.17.15" + dom-accessibility-api "^0.6.3" + lodash "^4.17.21" redent "^3.0.0" -"@testing-library/react@12.0.0": - version "12.0.0" - resolved "https://registry.npmjs.org/@testing-library/react/-/react-12.0.0.tgz" - integrity sha512-sh3jhFgEshFyJ/0IxGltRhwZv2kFKfJ3fN1vTZ6hhMXzz9ZbbcTgmDYM4e+zJv+oiVKKEWZPyqPAh4MQBI65gA== +"@testing-library/react@16.0.0": + version "16.0.0" + resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-16.0.0.tgz#0a1e0c7a3de25841c3591b8cb7fb0cf0c0a27321" + integrity sha512-guuxUKRWQ+FgNX0h0NS0FIq3Q3uLtWVpBzcLOggmfMoUpgBnzBzvLLd4fbm6yS8ydJd94cIfY4yP9qUQjM2KwQ== dependencies: "@babel/runtime" "^7.12.5" - "@testing-library/dom" "^8.0.0" "@tootallnate/once@2": version "2.0.0" @@ -2430,10 +2418,10 @@ resolved "https://registry.yarnpkg.com/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz#db4ecfd499a9765ab24002c3b696d02e6d32a12c" integrity sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA== -"@types/aria-query@^4.2.0": - version "4.2.2" - resolved "https://registry.npmjs.org/@types/aria-query/-/aria-query-4.2.2.tgz" - integrity sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig== +"@types/aria-query@^5.0.1": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-5.0.4.tgz#1a31c3d378850d2778dabb6374d036dcba4ba708" + integrity sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw== "@types/babel__core@^7.1.14": version "7.1.20" @@ -2807,13 +2795,6 @@ resolved "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz" integrity sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw== -"@types/yargs@^16.0.0": - version "16.0.4" - resolved "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz" - integrity sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw== - dependencies: - "@types/yargs-parser" "*" - "@types/yargs@^17.0.8": version "17.0.10" resolved "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.10.tgz" @@ -3237,6 +3218,13 @@ argparse@^2.0.1: resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== +aria-query@5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.3.0.tgz#650c569e41ad90b51b3d7df5e5eed1c7549c103e" + integrity sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A== + dependencies: + dequal "^2.0.3" + aria-query@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/aria-query/-/aria-query-5.0.0.tgz" @@ -4833,6 +4821,11 @@ depd@~1.1.2: resolved "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz" integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= +dequal@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" + integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA== + des.js@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz" @@ -4921,15 +4914,15 @@ document.contains@^1.0.1: dependencies: define-properties "^1.1.3" -dom-accessibility-api@^0.5.6: - version "0.5.14" - resolved "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.14.tgz" - integrity sha512-NMt+m9zFMPZe0JcY9gN224Qvk6qLIdqex29clBvc/y75ZBX9YA9wNK3frsYvu2DI1xcCIwxwnX+TlsJ2DSOADg== - dom-accessibility-api@^0.5.9: - version "0.5.10" - resolved "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.10.tgz" - integrity sha512-Xu9mD0UjrJisTmv7lmVSDMagQcU9R5hwAbxsaAE/35XPnPLJobbuREfV/rraiSaEj/UOvgrzQs66zyTWTlyd+g== + version "0.5.16" + resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz#5a7429e6066eb3664d911e33fb0e45de8eb08453" + integrity sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg== + +dom-accessibility-api@^0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz#993e925cc1d73f2c662e7d75dd5a5445259a8fd8" + integrity sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w== dom-converter@^0.2.0: version "0.2.0" @@ -8123,7 +8116,7 @@ lodash.sortby@^4.7.0: resolved "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz" integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= -lodash@4.17.21, lodash@^4.1.1, lodash@^4.17.13, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4: +lodash@4.17.21, lodash@^4.1.1, lodash@^4.17.13, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -8176,10 +8169,10 @@ lunr@^2.3.9: resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow== -lz-string@^1.4.4: - version "1.4.4" - resolved "https://registry.npmjs.org/lz-string/-/lz-string-1.4.4.tgz" - integrity sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY= +lz-string@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.5.0.tgz#c1ab50f77887b712621201ba9fd4e3a6ed099941" + integrity sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ== make-dir@^3.0.0: version "3.1.0" @@ -9342,11 +9335,10 @@ pretty-error@^4.0.0: renderkid "^3.0.0" pretty-format@^27.0.2: - version "27.4.2" - resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-27.4.2.tgz" - integrity sha512-p0wNtJ9oLuvgOQDEIZ9zQjZffK7KtyR6Si0jnXULIDwrlNF8Cuir3AZP0hHv0jmKuNN/edOnbMjnzd4uTcmWiw== + version "27.5.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" + integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ== dependencies: - "@jest/types" "^27.4.2" ansi-regex "^5.0.1" ansi-styles "^5.0.0" react-is "^17.0.1" @@ -9707,7 +9699,7 @@ react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1: react-is@^17.0.1: version "17.0.2" - resolved "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== react-is@^18.0.0: