diff options
author | David Cho-Lerat <117642976+david-cho-lerat-sonarsource@users.noreply.github.com> | 2024-10-22 15:19:18 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-10-22 20:03:10 +0000 |
commit | d9f6920331a0f274f1d6227c2af74d6dbfe84aa2 (patch) | |
tree | 3228b99c665c03e6c1bf2a1f68d9d90865f8558b /server/sonar-web/src/main/js/app/components/__tests__ | |
parent | c33a6b9956802dfa00133e304326887b901af901 (diff) | |
download | sonarqube-d9f6920331a0f274f1d6227c2af74d6dbfe84aa2.tar.gz sonarqube-d9f6920331a0f274f1d6227c2af74d6dbfe84aa2.zip |
SONAR-23206 Remove design-system build to have it as normal code inside sonar-web (#12088)
Co-authored-by: Grégoire Aubert <gregoire.aubert@sonarsource.com>
Co-authored-by: Jeremy Davis <jeremy.davis@sonarsource.com>
Diffstat (limited to 'server/sonar-web/src/main/js/app/components/__tests__')
21 files changed, 21 insertions, 18 deletions
diff --git a/server/sonar-web/src/main/js/app/components/__tests__/AdminContainer-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/AdminContainer-test.tsx index eca5c6fba67..54ed12766d7 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/AdminContainer-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/AdminContainer-test.tsx @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import userEvent from '@testing-library/user-event'; import * as React from 'react'; import { Route, useOutletContext } from 'react-router-dom'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/App-test.tsx index 110b311ad23..6bf918d255b 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/App-test.tsx @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import * as React from 'react'; + import { mockAppState } from '../../../helpers/testMocks'; import { renderComponent } from '../../../helpers/testReactTestingUtils'; import { App } from '../App'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/CalculationChangeMessage-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/CalculationChangeMessage-test.tsx index fa213e0394c..6d0f8cfc6b8 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/CalculationChangeMessage-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/CalculationChangeMessage-test.tsx @@ -18,7 +18,6 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import React from 'react'; import { Outlet, Route } from 'react-router-dom'; import { byRole, byText } from '~sonar-aligned/helpers/testSelector'; import { ComponentQualifier } from '~sonar-aligned/types/component'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx index 5facef0fe93..6dc78f333ea 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainer-test.tsx @@ -17,9 +17,10 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import React, { useContext } from 'react'; +import { useContext } from 'react'; import { Route } from 'react-router-dom'; import * as withRouter from '~sonar-aligned/components/hoc/withRouter'; import { byRole, byText } from '~sonar-aligned/helpers/testSelector'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainerNotFound-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainerNotFound-test.tsx index 7ba42ae3aef..a29e1904890 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainerNotFound-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/ComponentContainerNotFound-test.tsx @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { screen } from '@testing-library/react'; -import * as React from 'react'; import { renderComponent } from '../../../helpers/testReactTestingUtils'; import ComponentContainerNotFound from '../ComponentContainerNotFound'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/DocumentationRedirect-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/DocumentationRedirect-test.tsx index d037784c4fa..7548030891f 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/DocumentationRedirect-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/DocumentationRedirect-test.tsx @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { screen } from '@testing-library/react'; -import * as React from 'react'; import { Route } from 'react-router-dom'; import { mockAppState } from '../../../helpers/testMocks'; import { renderAppRoutes } from '../../../helpers/testReactTestingUtils'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/FormattingHelp-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/FormattingHelp-test.tsx index a12c4435ef7..0d0193fda67 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/FormattingHelp-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/FormattingHelp-test.tsx @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import * as React from 'react'; + import { byRole } from '~sonar-aligned/helpers/testSelector'; import { renderComponent } from '../../../helpers/testReactTestingUtils'; import FormattingHelp from '../FormattingHelp'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/GlobalFooter-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/GlobalFooter-test.tsx index af63bda5f0b..70e84d95c97 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/GlobalFooter-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/GlobalFooter-test.tsx @@ -19,7 +19,6 @@ */ import { addDays, subDays } from 'date-fns'; -import * as React from 'react'; import { byRole, byText } from '~sonar-aligned/helpers/testSelector'; import SystemServiceMock from '../../../api/mocks/SystemServiceMock'; import { mockAppState } from '../../../helpers/testMocks'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/KeyboardShortcutsModal-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/KeyboardShortcutsModal-test.tsx index a70df884cf8..6a64ce4ca46 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/KeyboardShortcutsModal-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/KeyboardShortcutsModal-test.tsx @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import userEvent from '@testing-library/user-event'; -import React from 'react'; import { byRole } from '~sonar-aligned/helpers/testSelector'; import { renderComponent } from '../../../helpers/testReactTestingUtils'; import KeyboardShortcutsModal from '../KeyboardShortcutsModal'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/Landing-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/Landing-test.tsx index 63c6350abc8..5cb372177db 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/Landing-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/Landing-test.tsx @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import * as React from 'react'; + import { byText } from '~sonar-aligned/helpers/testSelector'; import { mockCurrentUser, mockLoggedInUser } from '../../../helpers/testMocks'; import { renderApp } from '../../../helpers/testReactTestingUtils'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/MigrationContainer-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/MigrationContainer-test.tsx index d9266f10e24..44197a385c7 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/MigrationContainer-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/MigrationContainer-test.tsx @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import * as React from 'react'; + import { Route } from 'react-router-dom'; import { byText } from '~sonar-aligned/helpers/testSelector'; import { getSystemStatus } from '../../../helpers/system'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/NonAdminPagesContainer-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/NonAdminPagesContainer-test.tsx index 77664e5beb1..4e4e73d12ba 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/NonAdminPagesContainer-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/NonAdminPagesContainer-test.tsx @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { render, screen } from '@testing-library/react'; -import * as React from 'react'; import { MemoryRouter, Route, Routes } from 'react-router-dom'; import { ComponentQualifier } from '~sonar-aligned/types/component'; import { mockComponent } from '../../../helpers/mocks/component'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/PageTracker-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/PageTracker-test.tsx index 4c5325159c2..3dd4ff44f6d 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/PageTracker-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/PageTracker-test.tsx @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import userEvent from '@testing-library/user-event'; import * as React from 'react'; import { Link } from 'react-router-dom'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/PluginRiskConsent-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/PluginRiskConsent-test.tsx index dcf81c8b8d8..e2a31181693 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/PluginRiskConsent-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/PluginRiskConsent-test.tsx @@ -17,8 +17,9 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import userEvent from '@testing-library/user-event'; -import * as React from 'react'; +import { setImmediate } from 'timers'; import { byRole } from '~sonar-aligned/helpers/testSelector'; import { setSimpleSettingValue } from '../../../api/settings'; import { mockLoggedInUser, mockRouter } from '../../../helpers/testMocks'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/ProjectAdminContainer-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/ProjectAdminContainer-test.tsx index 048d615b186..4bbfd713e60 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/ProjectAdminContainer-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/ProjectAdminContainer-test.tsx @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import * as React from 'react'; + import { Route } from 'react-router-dom'; import { byText } from '~sonar-aligned/helpers/testSelector'; import handleRequiredAuthorization from '../../../app/utils/handleRequiredAuthorization'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/RecentHistory-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/RecentHistory-test.tsx index a6a79a9abd9..a9b491812f7 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/RecentHistory-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/RecentHistory-test.tsx @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { ComponentQualifier } from '~sonar-aligned/types/component'; import { get, remove, save } from '../../../helpers/storage'; import RecentHistory, { History } from '../RecentHistory'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/ResetPassword-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/ResetPassword-test.tsx index 622c16562a7..c4697b5cb77 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/ResetPassword-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/ResetPassword-test.tsx @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import userEvent from '@testing-library/user-event'; -import * as React from 'react'; import { byLabelText, byRole } from '~sonar-aligned/helpers/testSelector'; import { mockLoggedInUser } from '../../../helpers/testMocks'; import { renderComponent } from '../../../helpers/testReactTestingUtils'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/SonarLintConnection-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/SonarLintConnection-test.tsx index 1914cdf185f..09466e24fdb 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/SonarLintConnection-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/SonarLintConnection-test.tsx @@ -17,9 +17,9 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import * as React from 'react'; import UserTokensMock from '../../../api/mocks/UserTokensMock'; import handleRequiredAuthentication from '../../../helpers/handleRequiredAuthentication'; import { sendUserToken } from '../../../helpers/sonarlint'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/StartupModal-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/StartupModal-test.tsx index cbfc693f4fb..0fe62d2a16c 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/StartupModal-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/StartupModal-test.tsx @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import userEvent from '@testing-library/user-event'; -import * as React from 'react'; import { byRole, byText } from '~sonar-aligned/helpers/testSelector'; import { showLicense } from '../../../api/editions'; import { save } from '../../../helpers/storage'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/SystemAnnouncement-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/SystemAnnouncement-test.tsx index a79f529c34c..5fd8f62c631 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/SystemAnnouncement-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/SystemAnnouncement-test.tsx @@ -17,8 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import { fireEvent, screen } from '@testing-library/react'; -import * as React from 'react'; import { getValues } from '../../../api/settings'; import { renderComponent } from '../../../helpers/testReactTestingUtils'; import { Feature } from '../../../types/features'; diff --git a/server/sonar-web/src/main/js/app/components/__tests__/UpdateNotification-it.tsx b/server/sonar-web/src/main/js/app/components/__tests__/UpdateNotification-it.tsx index 95edfabe6fa..9082fd8791f 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/UpdateNotification-it.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/UpdateNotification-it.tsx @@ -17,9 +17,9 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import userEvent from '@testing-library/user-event'; import { addDays, formatISO, subDays } from 'date-fns'; -import * as React from 'react'; import { byRole } from '~sonar-aligned/helpers/testSelector'; import { getSystemUpgrades } from '../../../api/system'; import { UpdateUseCase } from '../../../components/upgrade/utils'; |