]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-18444 RTL migration tutorials
authorstanislavh <stanislav.honcharov@sonarsource.com>
Tue, 21 Feb 2023 14:45:45 +0000 (15:45 +0100)
committersonartech <sonartech@sonarsource.com>
Fri, 24 Feb 2023 20:02:44 +0000 (20:02 +0000)
147 files changed:
server/sonar-web/src/main/js/apps/tutorials/components/__tests__/TutorialsApp-test.tsx
server/sonar-web/src/main/js/apps/tutorials/components/__tests__/__snapshots__/TutorialsApp-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/__tests__/TutorialSelection-it.tsx
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/AnalysisCommand.tsx
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/BitbucketPipelinesTutorial.tsx
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/AnalysisCommand-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/BitbucketPipelinesTutorial-it.tsx [new file with mode: 0644]
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/BitbucketPipelinesTutorial-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/PreambuleYaml-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/RepositoryVariables-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/AnalysisCommand-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/BitbucketPipelinesTutorial-it.tsx.snap [new file with mode: 0644]
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/BitbucketPipelinesTutorial-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/PreambuleYaml-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/RepositoryVariables-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/EditTokenModal.tsx
server/sonar-web/src/main/js/components/tutorials/components/__tests__/AllSet-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/CompilationInfo-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/CreateYmlFile-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/DefaultProjectKey-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/EditTokenModal-test.tsx
server/sonar-web/src/main/js/components/tutorials/components/__tests__/FinishButton-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/GithubCFamilyExampleRepositories-test.tsx
server/sonar-web/src/main/js/components/tutorials/components/__tests__/LabelActionPair-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/LabelValuePair-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/RenderOptions-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/SentenceWithFilename-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/SentenceWithHighlights-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/Step-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/TokenStepGenerator-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/YamlFileStep-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/AllSet-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/CompilationInfo-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/CreateYmlFile-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/DefaultProjectKey-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/FinishButton-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/GithubCFamilyExampleRepositories-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/LabelActionPair-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/LabelValuePair-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/RenderOptions-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/SentenceWithFilename-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/SentenceWithHighlights-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/Step-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/TokenStepGenerator-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/YamlFileStep-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/github-action/AnalysisCommand.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/AnalysisCommand-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/GitHubActionTutorial-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/GithubActionTutorial-it.tsx [new file with mode: 0644]
server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/SecretStep-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/AnalysisCommand-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GitHubActionTutorial-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap [new file with mode: 0644]
server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/SecretStep-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/CFamily-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/DotNet-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/Gradle-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/JavaMaven-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/Others-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/CFamily-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/DotNet-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/Gradle-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/JavaMaven-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/Others-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/gitlabci/EnvironmentVariablesStep.tsx
server/sonar-web/src/main/js/components/tutorials/gitlabci/YmlFileStep.tsx
server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/EnvironmentVariablesStep-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/GitLabCITutorial-it.tsx [new file with mode: 0644]
server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/GitLabCITutorial-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/YmlFileStep-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/EnvironmentVariablesStep-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/GitLabCITutorial-it.tsx.snap [new file with mode: 0644]
server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/GitLabCITutorial-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/YmlFileStep-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/PipeCommand-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/__snapshots__/PipeCommand-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/JenkinsTutorial-it.tsx [new file with mode: 0644]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/JenkinsTutorial-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/JenkinsfileStep-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/MultiBranchPipelineStep-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/PipelineStep-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/PreRequisitesStep-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/SelectAlmStep-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/WebhookStep-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/WebhookStepBitbucket-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/WebhookStepGitLab-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/WebhookStepGithub-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/JenkinsTutorial-it.tsx.snap [new file with mode: 0644]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/JenkinsTutorial-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/JenkinsfileStep-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/MultiBranchPipelineStep-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/PipelineStep-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/PreRequisitesStep-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/SelectAlmStep-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/WebhookStep-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/WebhookStepBitbucket-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/WebhookStepGitLab-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/WebhookStepGithub-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/CFamilly-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/CreateJenkinsfileBulletPoint-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/DotNet-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/DotNetCore-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/DotNetFramework-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/DotNetPrereqsMSBuild-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/DotNetPrereqsScanner-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/Gradle-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/Maven-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/Other-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/CFamilly-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/CreateJenkinsfileBulletPoint-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/DotNet-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/DotNetCore-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/DotNetFramework-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/DotNetPrereqsMSBuild-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/DotNetPrereqsScanner-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/Gradle-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/Maven-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/Other-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/__tests__/OtherTutorial-it.tsx
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/AnalysisCommand-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/CLangGCCCommand-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DotNet-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DotNetExecute-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DotNetFramework-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DotnetCore-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DownloadBuildWrapper-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DownloadScanner-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/ExecBuildWrapper-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/ExecScanner-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/JavaGradle-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/JavaMaven-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/Other-test.tsx [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/AnalysisCommand-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/CLangGCCCommand-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DotNet-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DotNetExecute-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DotNetFramework-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DotnetCore-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DownloadBuildWrapper-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DownloadScanner-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/ExecBuildWrapper-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/ExecScanner-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/JavaGradle-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/JavaMaven-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/Other-test.tsx.snap [deleted file]
server/sonar-web/src/main/js/components/tutorials/test-utils.ts
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 50275e0a31da70b394a9fa7fbbe01b33f14a2421..985959180477175f8a574a084677428467908783 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-import { shallow } from 'enzyme';
-import * as React from 'react';
+import { byLabelText, byRole } from 'testing-library-selector';
+import SettingsServiceMock from '../../../../api/mocks/SettingsServiceMock';
+import UserTokensMock from '../../../../api/mocks/UserTokensMock';
 import handleRequiredAuthentication from '../../../../helpers/handleRequiredAuthentication';
-import { mockProjectAzureBindingResponse } from '../../../../helpers/mocks/alm-settings';
-import { mockComponent } from '../../../../helpers/mocks/component';
 import { mockCurrentUser, mockLoggedInUser } from '../../../../helpers/testMocks';
-import { TutorialsApp, TutorialsAppProps } from '../TutorialsApp';
+import { renderAppRoutes } from '../../../../helpers/testReactTestingUtils';
+import { Permissions } from '../../../../types/permissions';
+import routes from '../../routes';
+
+jest.mock('../../../../api/settings');
+jest.mock('../../../../api/user-tokens');
 
 jest.mock('../../../../helpers/handleRequiredAuthentication', () => jest.fn());
 
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-  expect(shallowRender({ projectBinding: mockProjectAzureBindingResponse() })).toMatchSnapshot();
+let settingsMock: SettingsServiceMock;
+let tokenMock: UserTokensMock;
+
+beforeAll(() => {
+  settingsMock = new SettingsServiceMock();
+  tokenMock = new UserTokensMock();
+});
+
+afterEach(() => {
+  tokenMock.reset();
+  settingsMock.reset();
+});
+
+beforeEach(jest.clearAllMocks);
+
+const ui = {
+  loading: byLabelText('loading'),
+  localScanButton: byRole('button', { name: 'onboarding.tutorial.choose_method.local' }),
+};
+
+it('renders tutorials page', async () => {
+  renderTutorialsApp(mockLoggedInUser({ permissions: { global: [Permissions.Scan] } }));
+  expect(ui.loading.get()).toBeInTheDocument();
+  expect(await ui.localScanButton.find()).toBeInTheDocument();
 });
 
 it('should redirect if user is not logged in', () => {
-  shallowRender({ currentUser: mockCurrentUser() });
+  renderTutorialsApp();
   expect(handleRequiredAuthentication).toHaveBeenCalled();
+  expect(ui.loading.query()).not.toBeInTheDocument();
+  expect(ui.localScanButton.query()).not.toBeInTheDocument();
 });
 
-function shallowRender(overrides: Partial<TutorialsAppProps> = {}) {
-  return shallow(
-    <TutorialsApp component={mockComponent()} currentUser={mockLoggedInUser()} {...overrides} />
-  );
+function renderTutorialsApp(currentUser = mockCurrentUser()) {
+  return renderAppRoutes('tutorials', routes, {
+    currentUser,
+  });
 }
diff --git a/server/sonar-web/src/main/js/apps/tutorials/components/__tests__/__snapshots__/TutorialsApp-test.tsx.snap b/server/sonar-web/src/main/js/apps/tutorials/components/__tests__/__snapshots__/TutorialsApp-test.tsx.snap
deleted file mode 100644 (file)
index 52fa708..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<div
-  className="page page-limited"
->
-  <withRouter(TutorialSelection)
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-    currentUser={
-      {
-        "dismissedNotices": {
-          "educationPrinciples": false,
-        },
-        "groups": [],
-        "isLoggedIn": true,
-        "login": "luke",
-        "name": "Skywalker",
-        "scmAccounts": [],
-      }
-    }
-  />
-</div>
-`;
-
-exports[`should render correctly 2`] = `
-<div
-  className="page page-limited"
->
-  <withRouter(TutorialSelection)
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-    currentUser={
-      {
-        "dismissedNotices": {
-          "educationPrinciples": false,
-        },
-        "groups": [],
-        "isLoggedIn": true,
-        "login": "luke",
-        "name": "Skywalker",
-        "scmAccounts": [],
-      }
-    }
-    projectBinding={
-      {
-        "alm": "azure",
-        "key": "foo",
-        "monorepo": false,
-        "repository": "REPOSITORY_NAME",
-        "slug": "PROJECT_NAME",
-        "url": "https://ado.my_company.com/mycollection",
-      }
-    }
-  />
-</div>
-`;
index 5349d91cd9f339e579cdcb00bd3e5d04b3b51105..89cfc0bcee55db153196cd60babd9f020ee70eec 100644 (file)
@@ -84,7 +84,7 @@ it.each([
   [TutorialModes.AzurePipelines, 'onboarding.tutorial.with.azure_pipelines.title'],
   [
     TutorialModes.BitbucketPipelines,
-    'onboarding.tutorial.with.bitbucket_pipelines.create_secret.title',
+    'onboarding.tutorial.with.bitbucket_pipelines.variables.title',
   ],
   [TutorialModes.GitHubActions, 'onboarding.tutorial.with.github_action.create_secret.title'],
   [TutorialModes.GitLabCI, 'onboarding.tutorial.with.gitlab_ci.title'],
index 3998cb59bccb4344d40749862128057c17e90595..b30644f81f0474abcda39e8bde12bb7fd8521754 100644 (file)
@@ -59,10 +59,6 @@ export function AnalysisCommand(props: AnalysisCommandProps) {
   const { buildTool, mainBranchName, component } = props;
   const branchSupportEnabled = props.hasFeature(Feature.BranchSupport);
 
-  if (!buildTool) {
-    return null;
-  }
-
   const yamlTemplate = YamlTemplate[buildTool](
     branchSupportEnabled,
     mainBranchName,
index 937b57e8e71a72124adf0ea23326d1cc51f81095..f697f99b0007e4a1548e3515c6e24096847b5b3d 100644 (file)
@@ -80,7 +80,7 @@ export default function BitbucketPipelinesTutorial(props: BitbucketPipelinesTuto
           />
         )}
         stepNumber={Steps.REPOSITORY_VARIABLES}
-        stepTitle={translate('onboarding.tutorial.with.bitbucket_pipelines.create_secret.title')}
+        stepTitle={translate('onboarding.tutorial.with.bitbucket_pipelines.variables.title')}
       />
       <Step
         finished={step > Steps.YAML}
diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/AnalysisCommand-test.tsx b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/AnalysisCommand-test.tsx
deleted file mode 100644 (file)
index 6441311..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../helpers/mocks/component';
-import { BuildTools } from '../../types';
-import { AnalysisCommand, AnalysisCommandProps } from '../AnalysisCommand';
-
-it.each([
-  [BuildTools.CFamily],
-  [BuildTools.DotNet],
-  [BuildTools.Gradle],
-  [BuildTools.Maven],
-  [BuildTools.Other],
-])('should render correctly for %s', (buildTool) => {
-  expect(shallowRender({ buildTool })).toMatchSnapshot();
-  expect(shallowRender({ hasFeature: () => true, buildTool })).toMatchSnapshot(
-    'with branch enabled'
-  );
-});
-
-function shallowRender(props: Partial<AnalysisCommandProps> = {}) {
-  return shallow<AnalysisCommandProps>(
-    <AnalysisCommand
-      hasFeature={jest.fn().mockReturnValue(false)}
-      buildTool={BuildTools.DotNet}
-      mainBranchName="main"
-      component={mockComponent()}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/BitbucketPipelinesTutorial-it.tsx b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/BitbucketPipelinesTutorial-it.tsx
new file mode 100644 (file)
index 0000000..7d85f9e
--- /dev/null
@@ -0,0 +1,166 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2023 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * 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 selectEvent from 'react-select-event';
+import UserTokensMock from '../../../../api/mocks/UserTokensMock';
+import {
+  mockAlmSettingsInstance,
+  mockProjectAlmBindingResponse,
+} from '../../../../helpers/mocks/alm-settings';
+import { mockComponent } from '../../../../helpers/mocks/component';
+import { mockLanguage, mockLoggedInUser } from '../../../../helpers/testMocks';
+import { renderApp, RenderContext } from '../../../../helpers/testReactTestingUtils';
+import { AlmKeys } from '../../../../types/alm-settings';
+import { Feature } from '../../../../types/features';
+import {
+  getCommonNodes,
+  getCopyToClipboardValue,
+  getTutorialActionButtons,
+  getTutorialBuildButtons,
+} from '../../test-utils';
+import { TutorialModes } from '../../types';
+import BitbucketPipelinesTutorial, {
+  BitbucketPipelinesTutorialProps,
+} from '../BitbucketPipelinesTutorial';
+
+jest.mock('../../../../api/user-tokens');
+
+jest.mock('../../../../api/settings', () => ({
+  getAllValues: jest.fn().mockResolvedValue([]),
+}));
+
+const tokenMock = new UserTokensMock();
+
+afterEach(() => {
+  tokenMock.reset();
+});
+
+const ui = {
+  ...getCommonNodes(TutorialModes.BitbucketPipelines),
+  ...getTutorialActionButtons(),
+  ...getTutorialBuildButtons(),
+};
+
+it('should follow and complete all steps', async () => {
+  const user = userEvent.setup();
+  renderBitbucketPipelinesTutorial();
+
+  expect(await ui.secretsStepTitle.find()).toBeInTheDocument();
+
+  // Env variables step
+  expect(getCopyToClipboardValue()).toMatchSnapshot('sonar token key');
+  expect(getCopyToClipboardValue(1)).toMatchSnapshot('sonarqube host url key');
+  expect(getCopyToClipboardValue(2)).toMatchSnapshot('sonarqube host url value');
+  await user.click(ui.continueButton.get());
+
+  // Create/update configuration file step
+  // Maven
+  await user.click(ui.mavenBuildButton.get());
+  expect(getCopyToClipboardValue(1)).toMatchSnapshot('Maven: bitbucket-pipelines.yml');
+
+  // Gradle
+  await user.click(ui.gradleBuildButton.get());
+  expect(getCopyToClipboardValue(1)).toMatchSnapshot('Gradle: build.gradle');
+  expect(getCopyToClipboardValue(3)).toMatchSnapshot('Gradle: bitbucket-pipelines.yml');
+
+  // .NET
+  await user.click(ui.dotnetBuildButton.get());
+  expect(getCopyToClipboardValue(1)).toMatchSnapshot('.NET: bitbucket-pipelines.yml');
+
+  // CFamily
+  await user.click(ui.cFamilyBuildButton.get());
+  expect(getCopyToClipboardValue()).toMatchSnapshot('CFamily: sonar-project.properties');
+  expect(getCopyToClipboardValue(2)).toMatchSnapshot('CFamily: bitbucket-pipelines.yml');
+
+  // Other
+  await user.click(ui.otherBuildButton.get());
+  expect(getCopyToClipboardValue()).toMatchSnapshot('Other: sonar-project.properties');
+  expect(getCopyToClipboardValue(2)).toMatchSnapshot('Other: .github/workflows/build.yml');
+
+  await user.click(ui.finishTutorialButton.get());
+  expect(ui.allSetSentence.get()).toBeInTheDocument();
+});
+
+it('should generate/delete a new token or use existing one', async () => {
+  const user = userEvent.setup();
+  renderBitbucketPipelinesTutorial();
+
+  expect(await ui.secretsStepTitle.find()).toBeInTheDocument();
+
+  // Generate token
+  await user.click(ui.genTokenDialogButton.get());
+  await user.click(ui.generateTokenButton.get());
+  expect(getCopyToClipboardValue(3)).toEqual('generatedtoken2');
+
+  // Revoke current token and create new one
+  await user.click(ui.deleteTokenButton.get());
+  await user.type(ui.tokenNameInput.get(), 'newtoken');
+  await selectEvent.select(ui.expiresInSelect.get(), 'users.tokens.expiration.365');
+  await user.click(ui.generateTokenButton.get());
+  expect(ui.tokenValue.get()).toBeInTheDocument();
+  await user.click(ui.continueButton.getAll()[1]);
+  expect(ui.tokenValue.query()).not.toBeInTheDocument();
+});
+
+it('navigates between steps', async () => {
+  const user = userEvent.setup();
+  renderBitbucketPipelinesTutorial({
+    almBinding: mockAlmSettingsInstance({
+      alm: AlmKeys.BitbucketCloud,
+      url: 'http://localhost/qube',
+    }),
+    projectBinding: mockProjectAlmBindingResponse({
+      alm: AlmKeys.BitbucketCloud,
+      repository: 'my-project',
+    }),
+  });
+
+  // If project is bound, link to repo is visible
+  expect(await ui.linkToRepo.find()).toBeInTheDocument();
+
+  await user.click(await ui.continueButton.find());
+  await user.click(ui.mavenBuildButton.get());
+  await user.click(ui.finishTutorialButton.get());
+  expect(ui.allSetSentence.get()).toBeInTheDocument();
+
+  await user.click(ui.ymlFileStepTitle.get());
+  expect(ui.mavenBuildButton.get()).toBeInTheDocument();
+  await user.click(ui.secretsStepTitle.get());
+  expect(ui.genTokenDialogButton.get()).toBeInTheDocument();
+});
+
+function renderBitbucketPipelinesTutorial(
+  overrides: Partial<BitbucketPipelinesTutorialProps> = {},
+  { languages = { c: mockLanguage({ key: 'c' }) } }: RenderContext = {}
+) {
+  return renderApp(
+    '/',
+    <BitbucketPipelinesTutorial
+      baseUrl="http://localhost:9000"
+      mainBranchName="main"
+      component={mockComponent()}
+      currentUser={mockLoggedInUser()}
+      {...overrides}
+    />,
+    { languages, featureList: [Feature.BranchSupport] }
+  );
+}
diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/BitbucketPipelinesTutorial-test.tsx b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/BitbucketPipelinesTutorial-test.tsx
deleted file mode 100644 (file)
index 028336c..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import {
-  mockAlmSettingsInstance,
-  mockProjectBitbucketCloudBindingResponse,
-} from '../../../../helpers/mocks/alm-settings';
-import { mockComponent } from '../../../../helpers/mocks/component';
-import { mockLoggedInUser } from '../../../../helpers/testMocks';
-import Step from '../../components/Step';
-import { renderStepContent } from '../../test-utils';
-import BitbucketPipelinesTutorial, {
-  BitbucketPipelinesTutorialProps,
-} from '../BitbucketPipelinesTutorial';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot('default');
-  expect(shallowRender({ almBinding: undefined })).toMatchSnapshot('no binding');
-  expect(renderStepContent(shallowRender())).toMatchSnapshot('repo variable step content');
-  expect(renderStepContent(shallowRender(), 1)).toMatchSnapshot('yaml file step content');
-});
-
-it('should correctly navigate through the steps', () => {
-  const wrapper = shallowRender();
-
-  expect(wrapper.find(Step).at(0).props().open).toBe(true);
-  expect(wrapper.find(Step).at(1).props().open).toBe(false);
-
-  wrapper.find(Step).at(1).simulate('open');
-  expect(wrapper.find(Step).at(0).props().open).toBe(false);
-  expect(wrapper.find(Step).at(1).props().open).toBe(true);
-});
-
-function shallowRender(props: Partial<BitbucketPipelinesTutorialProps> = {}) {
-  return shallow<BitbucketPipelinesTutorialProps>(
-    <BitbucketPipelinesTutorial
-      almBinding={mockAlmSettingsInstance()}
-      baseUrl="test"
-      mainBranchName="main"
-      currentUser={mockLoggedInUser()}
-      component={mockComponent()}
-      projectBinding={mockProjectBitbucketCloudBindingResponse()}
-      willRefreshAutomatically={true}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/PreambuleYaml-test.tsx b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/PreambuleYaml-test.tsx
deleted file mode 100644 (file)
index 61be1a1..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../helpers/mocks/component';
-import { BuildTools } from '../../types';
-import { PreambuleYaml, PreambuleYamlProps } from '../PreambuleYaml';
-
-it.each([[BuildTools.DotNet], [BuildTools.Gradle], [BuildTools.CFamily], [BuildTools.Other]])(
-  'should render correctly for %s',
-  (buildTool) => {
-    expect(shallowRender({ buildTool })).toMatchSnapshot();
-  }
-);
-
-function shallowRender(props: Partial<PreambuleYamlProps> = {}) {
-  return shallow<PreambuleYamlProps>(
-    <PreambuleYaml buildTool={BuildTools.DotNet} component={mockComponent()} {...props} />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/RepositoryVariables-test.tsx b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/RepositoryVariables-test.tsx
deleted file mode 100644 (file)
index df538ba..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import {
-  mockAlmSettingsInstance,
-  mockProjectBitbucketCloudBindingResponse,
-} from '../../../../helpers/mocks/alm-settings';
-import { mockComponent } from '../../../../helpers/mocks/component';
-import { mockLoggedInUser } from '../../../../helpers/testMocks';
-import RepositoryVariables, { RepositoryVariablesProps } from '../RepositoryVariables';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-function shallowRender(props: Partial<RepositoryVariablesProps> = {}) {
-  return shallow<RepositoryVariablesProps>(
-    <RepositoryVariables
-      almBinding={mockAlmSettingsInstance()}
-      currentUser={mockLoggedInUser()}
-      baseUrl="test"
-      onDone={jest.fn()}
-      component={mockComponent()}
-      projectBinding={mockProjectBitbucketCloudBindingResponse()}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/AnalysisCommand-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/AnalysisCommand-test.tsx.snap
deleted file mode 100644 (file)
index ac895b8..0000000
+++ /dev/null
@@ -1,591 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly for cfamily 1`] = `
-<Fragment>
-  <PreambuleYaml
-    buildTool="cfamily"
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <CreateYmlFile
-    yamlFileName="bitbucket-pipelines.yml"
-    yamlTemplate="image: <image ready for your build toolchain>
-
-definitions:
-  steps:
-    - step: &build-step
-        name: Build the project, and run the SonarQube analysis
-        script:
-          - export SONAR_SCANNER_VERSION=4.6.2.2472
-          - mkdir $HOME/.sonar
-          - curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-x86.zip
-          - unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
-          - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux.zip
-          - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
-          - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux/bin"
-          - <any step required before running your build, like ./configure>
-          - $HOME/.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command>
-          - sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output  
-  caches:
-    sonar: ~/.sonar
-
-clone:
-  depth: full
-
-pipelines:
-  branches:
-    '{main}':
-      - step: *build-step
-"
-  />
-  <CompilationInfo
-    className="abs-width-800"
-  />
-</Fragment>
-`;
-
-exports[`should render correctly for cfamily: with branch enabled 1`] = `
-<Fragment>
-  <PreambuleYaml
-    buildTool="cfamily"
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <CreateYmlFile
-    yamlFileName="bitbucket-pipelines.yml"
-    yamlTemplate="image: <image ready for your build toolchain>
-
-definitions:
-  steps:
-    - step: &build-step
-        name: Build the project, and run the SonarQube analysis
-        script:
-          - export SONAR_SCANNER_VERSION=4.6.2.2472
-          - mkdir $HOME/.sonar
-          - curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-x86.zip
-          - unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
-          - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux.zip
-          - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
-          - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux/bin"
-          - <any step required before running your build, like ./configure>
-          - $HOME/.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command>
-          - sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output  
-  caches:
-    sonar: ~/.sonar
-
-clone:
-  depth: full
-
-pipelines:
-  branches:
-    '{main}':
-      - step: *build-step
-
-  pull-requests:
-    '**':
-      - step: *build-step"
-  />
-  <CompilationInfo
-    className="abs-width-800"
-  />
-</Fragment>
-`;
-
-exports[`should render correctly for dotnet 1`] = `
-<Fragment>
-  <PreambuleYaml
-    buildTool="dotnet"
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <CreateYmlFile
-    yamlFileName="bitbucket-pipelines.yml"
-    yamlTemplate="image: mcr.microsoft.com/dotnet/core/sdk:latest
-
-definitions:
-  steps:
-    - step: &build-step
-        name: SonarQube analysis
-        caches:
-          - dotnetcore
-          - sonar
-        script:
-          - apt-get update
-          - apt-get install --yes openjdk-11-jre
-          - dotnet tool install --global dotnet-sonarscanner
-          - export PATH="$PATH:/root/.dotnet/tools"
-          - dotnet sonarscanner begin /k:"my-project" /d:"sonar.login=\${SONAR_TOKEN}"  /d:"sonar.host.url=\${SONAR_HOST_URL}"
-          - dotnet build 
-          - dotnet sonarscanner end /d:"sonar.login=\${SONAR_TOKEN}"
-  caches:
-    sonar: ~/.sonar
-
-pipelines:
-  branches:
-    '{main}':
-      - step: *build-step
-"
-  />
-</Fragment>
-`;
-
-exports[`should render correctly for dotnet: with branch enabled 1`] = `
-<Fragment>
-  <PreambuleYaml
-    buildTool="dotnet"
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <CreateYmlFile
-    yamlFileName="bitbucket-pipelines.yml"
-    yamlTemplate="image: mcr.microsoft.com/dotnet/core/sdk:latest
-
-definitions:
-  steps:
-    - step: &build-step
-        name: SonarQube analysis
-        caches:
-          - dotnetcore
-          - sonar
-        script:
-          - apt-get update
-          - apt-get install --yes openjdk-11-jre
-          - dotnet tool install --global dotnet-sonarscanner
-          - export PATH="$PATH:/root/.dotnet/tools"
-          - dotnet sonarscanner begin /k:"my-project" /d:"sonar.login=\${SONAR_TOKEN}"  /d:"sonar.host.url=\${SONAR_HOST_URL}"
-          - dotnet build 
-          - dotnet sonarscanner end /d:"sonar.login=\${SONAR_TOKEN}"
-  caches:
-    sonar: ~/.sonar
-
-pipelines:
-  branches:
-    '{main}':
-      - step: *build-step
-
-  pull-requests:
-    '**':
-      - step: *build-step"
-  />
-</Fragment>
-`;
-
-exports[`should render correctly for gradle 1`] = `
-<Fragment>
-  <PreambuleYaml
-    buildTool="gradle"
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <CreateYmlFile
-    yamlFileName="bitbucket-pipelines.yml"
-    yamlTemplate="image: openjdk:8
-
-definitions:
-  steps:
-    - step: &build-step
-        name: SonarQube analysis
-        caches:
-          - gradle
-          - sonar
-        script:
-          - bash ./gradlew sonar
-  caches:
-    sonar: ~/.sonar
-
-clone:
-  depth: full
-  
-pipelines:
-  branches:
-    '{main}':
-      - step: *build-step
-"
-  />
-</Fragment>
-`;
-
-exports[`should render correctly for gradle: with branch enabled 1`] = `
-<Fragment>
-  <PreambuleYaml
-    buildTool="gradle"
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <CreateYmlFile
-    yamlFileName="bitbucket-pipelines.yml"
-    yamlTemplate="image: openjdk:8
-
-definitions:
-  steps:
-    - step: &build-step
-        name: SonarQube analysis
-        caches:
-          - gradle
-          - sonar
-        script:
-          - bash ./gradlew sonar
-  caches:
-    sonar: ~/.sonar
-
-clone:
-  depth: full
-  
-pipelines:
-  branches:
-    '{main}':
-      - step: *build-step
-
-  pull-requests:
-    '**':
-      - step: *build-step"
-  />
-</Fragment>
-`;
-
-exports[`should render correctly for maven 1`] = `
-<Fragment>
-  <PreambuleYaml
-    buildTool="maven"
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <CreateYmlFile
-    yamlFileName="bitbucket-pipelines.yml"
-    yamlTemplate="image: maven:3-openjdk-11
-
-definitions:
-  steps:
-    - step: &build-step
-        name: SonarQube analysis
-        caches:
-          - maven
-          - sonar
-        script:
-          - mvn verify sonar:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'
-  caches:
-    sonar: ~/.sonar
-
-clone:
-  depth: full
-  
-pipelines:
-  branches:
-    '{main}':
-      - step: *build-step
-"
-  />
-</Fragment>
-`;
-
-exports[`should render correctly for maven: with branch enabled 1`] = `
-<Fragment>
-  <PreambuleYaml
-    buildTool="maven"
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <CreateYmlFile
-    yamlFileName="bitbucket-pipelines.yml"
-    yamlTemplate="image: maven:3-openjdk-11
-
-definitions:
-  steps:
-    - step: &build-step
-        name: SonarQube analysis
-        caches:
-          - maven
-          - sonar
-        script:
-          - mvn verify sonar:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'
-  caches:
-    sonar: ~/.sonar
-
-clone:
-  depth: full
-  
-pipelines:
-  branches:
-    '{main}':
-      - step: *build-step
-
-  pull-requests:
-    '**':
-      - step: *build-step"
-  />
-</Fragment>
-`;
-
-exports[`should render correctly for other 1`] = `
-<Fragment>
-  <PreambuleYaml
-    buildTool="other"
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <CreateYmlFile
-    yamlFileName="bitbucket-pipelines.yml"
-    yamlTemplate="image: maven:3.3.9
-
-definitions:
-  steps:
-    - step: &build-step
-        name: SonarQube analysis
-        script:
-          - pipe: sonarsource/sonarqube-scan:1.0.0
-            variables:
-              SONAR_HOST_URL: \${SONAR_HOST_URL} # Get the value from the repository/workspace variable.
-              SONAR_TOKEN: \${SONAR_TOKEN} # Get the value from the repository/workspace variable. You shouldn't set secret in clear text here.
-  caches:
-    sonar: ~/.sonar
-
-clone:
-  depth: full
-
-pipelines:
-  branches:
-    '{main}':
-      - step: *build-step
-"
-  />
-</Fragment>
-`;
-
-exports[`should render correctly for other: with branch enabled 1`] = `
-<Fragment>
-  <PreambuleYaml
-    buildTool="other"
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <CreateYmlFile
-    yamlFileName="bitbucket-pipelines.yml"
-    yamlTemplate="image: maven:3.3.9
-
-definitions:
-  steps:
-    - step: &build-step
-        name: SonarQube analysis
-        script:
-          - pipe: sonarsource/sonarqube-scan:1.0.0
-            variables:
-              SONAR_HOST_URL: \${SONAR_HOST_URL} # Get the value from the repository/workspace variable.
-              SONAR_TOKEN: \${SONAR_TOKEN} # Get the value from the repository/workspace variable. You shouldn't set secret in clear text here.
-  caches:
-    sonar: ~/.sonar
-
-clone:
-  depth: full
-
-pipelines:
-  branches:
-    '{main}':
-      - step: *build-step
-
-  pull-requests:
-    '**':
-      - step: *build-step
-"
-  />
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/BitbucketPipelinesTutorial-it.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/BitbucketPipelinesTutorial-it.tsx.snap
new file mode 100644 (file)
index 0000000..ee70006
--- /dev/null
@@ -0,0 +1,174 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should follow and complete all steps: .NET: bitbucket-pipelines.yml 1`] = `
+"image: mcr.microsoft.com/dotnet/core/sdk:latest
+
+definitions:
+  steps:
+    - step: &build-step
+        name: SonarQube analysis
+        caches:
+          - dotnetcore
+          - sonar
+        script:
+          - apt-get update
+          - apt-get install --yes openjdk-11-jre
+          - dotnet tool install --global dotnet-sonarscanner
+          - export PATH="$PATH:/root/.dotnet/tools"
+          - dotnet sonarscanner begin /k:"my-project" /d:"sonar.login=\${SONAR_TOKEN}"  /d:"sonar.host.url=\${SONAR_HOST_URL}"
+          - dotnet build 
+          - dotnet sonarscanner end /d:"sonar.login=\${SONAR_TOKEN}"
+  caches:
+    sonar: ~/.sonar
+
+pipelines:
+  branches:
+    '{main}':
+      - step: *build-step
+
+  pull-requests:
+    '**':
+      - step: *build-step"
+`;
+
+exports[`should follow and complete all steps: CFamily: bitbucket-pipelines.yml 1`] = `
+"image: <image ready for your build toolchain>
+
+definitions:
+  steps:
+    - step: &build-step
+        name: Build the project, and run the SonarQube analysis
+        script:
+          - export SONAR_SCANNER_VERSION=4.6.2.2472
+          - mkdir $HOME/.sonar
+          - curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-x86.zip
+          - unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
+          - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux.zip
+          - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
+          - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux/bin"
+          - <any step required before running your build, like ./configure>
+          - $HOME/.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command>
+          - sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output  
+  caches:
+    sonar: ~/.sonar
+
+clone:
+  depth: full
+
+pipelines:
+  branches:
+    '{main}':
+      - step: *build-step
+
+  pull-requests:
+    '**':
+      - step: *build-step"
+`;
+
+exports[`should follow and complete all steps: CFamily: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
+
+exports[`should follow and complete all steps: Gradle: bitbucket-pipelines.yml 1`] = `
+"image: openjdk:8
+
+definitions:
+  steps:
+    - step: &build-step
+        name: SonarQube analysis
+        caches:
+          - gradle
+          - sonar
+        script:
+          - bash ./gradlew sonar
+  caches:
+    sonar: ~/.sonar
+
+clone:
+  depth: full
+  
+pipelines:
+  branches:
+    '{main}':
+      - step: *build-step
+
+  pull-requests:
+    '**':
+      - step: *build-step"
+`;
+
+exports[`should follow and complete all steps: Gradle: build.gradle 1`] = `
+"plugins {
+  id "org.sonarqube" version "3.5.0.2730"
+}
+
+sonar {
+  properties {
+    property "sonar.projectKey", "my-project"
+    property "sonar.projectName", "MyProject"
+  }
+}"
+`;
+
+exports[`should follow and complete all steps: Maven: bitbucket-pipelines.yml 1`] = `
+"image: maven:3-openjdk-11
+
+definitions:
+  steps:
+    - step: &build-step
+        name: SonarQube analysis
+        caches:
+          - maven
+          - sonar
+        script:
+          - mvn verify sonar:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'
+  caches:
+    sonar: ~/.sonar
+
+clone:
+  depth: full
+  
+pipelines:
+  branches:
+    '{main}':
+      - step: *build-step
+
+  pull-requests:
+    '**':
+      - step: *build-step"
+`;
+
+exports[`should follow and complete all steps: Other: .github/workflows/build.yml 1`] = `
+"image: maven:3.3.9
+
+definitions:
+  steps:
+    - step: &build-step
+        name: SonarQube analysis
+        script:
+          - pipe: sonarsource/sonarqube-scan:1.0.0
+            variables:
+              SONAR_HOST_URL: \${SONAR_HOST_URL} # Get the value from the repository/workspace variable.
+              SONAR_TOKEN: \${SONAR_TOKEN} # Get the value from the repository/workspace variable. You shouldn't set secret in clear text here.
+  caches:
+    sonar: ~/.sonar
+
+clone:
+  depth: full
+
+pipelines:
+  branches:
+    '{main}':
+      - step: *build-step
+
+  pull-requests:
+    '**':
+      - step: *build-step
+"
+`;
+
+exports[`should follow and complete all steps: Other: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
+
+exports[`should follow and complete all steps: sonar token key 1`] = `"SONAR_TOKEN"`;
+
+exports[`should follow and complete all steps: sonarqube host url key 1`] = `"SONAR_HOST_URL"`;
+
+exports[`should follow and complete all steps: sonarqube host url value 1`] = `"http://localhost:9000"`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/BitbucketPipelinesTutorial-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/BitbucketPipelinesTutorial-test.tsx.snap
deleted file mode 100644 (file)
index 001c0cb..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly: default 1`] = `
-<Fragment>
-  <Step
-    finished={false}
-    onOpen={[Function]}
-    open={true}
-    renderForm={[Function]}
-    stepNumber={1}
-    stepTitle="onboarding.tutorial.with.bitbucket_pipelines.create_secret.title"
-  />
-  <Step
-    finished={false}
-    onOpen={[Function]}
-    open={false}
-    renderForm={[Function]}
-    stepNumber={2}
-    stepTitle="onboarding.tutorial.with.bitbucket_pipelines.yaml.title"
-  />
-  <AllSetStep
-    alm="github"
-    open={false}
-    stepNumber={3}
-    willRefreshAutomatically={true}
-  />
-</Fragment>
-`;
-
-exports[`should render correctly: no binding 1`] = `
-<Fragment>
-  <Step
-    finished={false}
-    onOpen={[Function]}
-    open={true}
-    renderForm={[Function]}
-    stepNumber={1}
-    stepTitle="onboarding.tutorial.with.bitbucket_pipelines.create_secret.title"
-  />
-  <Step
-    finished={false}
-    onOpen={[Function]}
-    open={false}
-    renderForm={[Function]}
-    stepNumber={2}
-    stepTitle="onboarding.tutorial.with.bitbucket_pipelines.yaml.title"
-  />
-  <AllSetStep
-    alm="bitbucketcloud"
-    open={false}
-    stepNumber={3}
-    willRefreshAutomatically={true}
-  />
-</Fragment>
-`;
-
-exports[`should render correctly: repo variable step content 1`] = `
-<RepositoryVariables
-  almBinding={
-    {
-      "alm": "github",
-      "key": "key",
-    }
-  }
-  baseUrl="test"
-  component={
-    {
-      "breadcrumbs": [],
-      "key": "my-project",
-      "name": "MyProject",
-      "qualifier": "TRK",
-      "qualityGate": {
-        "isDefault": true,
-        "key": "30",
-        "name": "Sonar way",
-      },
-      "qualityProfiles": [
-        {
-          "deleted": false,
-          "key": "my-qp",
-          "language": "ts",
-          "name": "Sonar way",
-        },
-      ],
-      "tags": [],
-    }
-  }
-  currentUser={
-    {
-      "dismissedNotices": {
-        "educationPrinciples": false,
-      },
-      "groups": [],
-      "isLoggedIn": true,
-      "login": "luke",
-      "name": "Skywalker",
-      "scmAccounts": [],
-    }
-  }
-  onDone={[Function]}
-  projectBinding={
-    {
-      "alm": "bitbucketcloud",
-      "key": "foo",
-      "monorepo": true,
-      "repository": "repo-slug",
-    }
-  }
-/>
-`;
-
-exports[`should render correctly: yaml file step content 1`] = `
-<withCLanguageFeature(YamlFileStep)>
-  [Function]
-</withCLanguageFeature(YamlFileStep)>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/PreambuleYaml-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/PreambuleYaml-test.tsx.snap
deleted file mode 100644 (file)
index f4662e4..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly for cfamily 1`] = `
-<DefaultProjectKey
-  component={
-    {
-      "breadcrumbs": [],
-      "key": "my-project",
-      "name": "MyProject",
-      "qualifier": "TRK",
-      "qualityGate": {
-        "isDefault": true,
-        "key": "30",
-        "name": "Sonar way",
-      },
-      "qualityProfiles": [
-        {
-          "deleted": false,
-          "key": "my-qp",
-          "language": "ts",
-          "name": "Sonar way",
-        },
-      ],
-      "tags": [],
-    }
-  }
-/>
-`;
-
-exports[`should render correctly for dotnet 1`] = `""`;
-
-exports[`should render correctly for gradle 1`] = `
-<li
-  className="abs-width-600"
->
-  <FormattedMessage
-    defaultMessage="onboarding.tutorial.with.yaml.gradle"
-    id="onboarding.tutorial.with.yaml.gradle"
-    values={
-      {
-        "gradle": <React.Fragment>
-          <code
-            className="rule"
-          >
-            build.gradle
-          </code>
-          <ClipboardIconButton
-            copyValue="build.gradle"
-          />
-        </React.Fragment>,
-        "sq": <code
-          className="rule"
-        >
-          org.sonarqube
-        </code>,
-      }
-    }
-  />
-  <CodeSnippet
-    snippet="plugins {
-  id "org.sonarqube" version "3.5.0.2730"
-}
-
-sonar {
-  properties {
-    property "sonar.projectKey", "my-project"
-    property "sonar.projectName", "MyProject"
-  }
-}"
-  />
-</li>
-`;
-
-exports[`should render correctly for other 1`] = `
-<DefaultProjectKey
-  component={
-    {
-      "breadcrumbs": [],
-      "key": "my-project",
-      "name": "MyProject",
-      "qualifier": "TRK",
-      "qualityGate": {
-        "isDefault": true,
-        "key": "30",
-        "name": "Sonar way",
-      },
-      "qualityProfiles": [
-        {
-          "deleted": false,
-          "key": "my-qp",
-          "language": "ts",
-          "name": "Sonar way",
-        },
-      ],
-      "tags": [],
-    }
-  }
-/>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/RepositoryVariables-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/RepositoryVariables-test.tsx.snap
deleted file mode 100644 (file)
index 7a8eff4..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <p
-    className="big-spacer-bottom"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.bitbucket_pipelines.variables.intro"
-      id="onboarding.tutorial.with.bitbucket_pipelines.variables.intro"
-      values={
-        {
-          "repository_variables": <strong>
-            onboarding.tutorial.with.bitbucket_pipelines.variables.intro.link
-          </strong>,
-        }
-      }
-    />
-  </p>
-  <ol
-    className="list-styled"
-  >
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "name",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.bitbucket_pipelines.variables.name"
-      />
-      <code
-        className="rule little-spacer-left"
-      >
-        SONAR_TOKEN
-      </code>
-      <ClipboardIconButton
-        copyValue="SONAR_TOKEN"
-      />
-    </li>
-    <TokenStepGenerator
-      component={
-        {
-          "breadcrumbs": [],
-          "key": "my-project",
-          "name": "MyProject",
-          "qualifier": "TRK",
-          "qualityGate": {
-            "isDefault": true,
-            "key": "30",
-            "name": "Sonar way",
-          },
-          "qualityProfiles": [
-            {
-              "deleted": false,
-              "key": "my-qp",
-              "language": "ts",
-              "name": "Sonar way",
-            },
-          ],
-          "tags": [],
-        }
-      }
-      currentUser={
-        {
-          "dismissedNotices": {
-            "educationPrinciples": false,
-          },
-          "groups": [],
-          "isLoggedIn": true,
-          "login": "luke",
-          "name": "Skywalker",
-          "scmAccounts": [],
-        }
-      }
-    />
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "secured",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.bitbucket_pipelines.variables.secured"
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "add",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.bitbucket_pipelines.variables.add"
-      />
-    </li>
-  </ol>
-  <hr
-    className="no-horizontal-margins"
-  />
-  <ol
-    className="list-styled big-spacer-top big-spacer-bottom"
-  >
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "name",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.bitbucket_pipelines.variables.name"
-      />
-      <code
-        className="rule little-spacer-left"
-      >
-        SONAR_HOST_URL
-      </code>
-      <ClipboardIconButton
-        copyValue="SONAR_HOST_URL"
-      />
-    </li>
-    <li
-      className="big-spacer-bottom"
-    >
-      <FormattedMessage
-        defaultMessage="onboarding.tutorial.env_variables"
-        id="onboarding.tutorial.env_variables"
-        values={
-          {
-            "extra": <ClipboardIconButton
-              copyValue="test"
-            />,
-            "field": <strong>
-              onboarding.tutorial.env_variables.field
-            </strong>,
-            "value": <code
-              className="rule"
-            >
-              test
-            </code>,
-          }
-        }
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "add",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.bitbucket_pipelines.variables.add"
-      />
-    </li>
-  </ol>
-  <Button
-    onClick={[MockFunction]}
-  >
-    continue
-  </Button>
-</div>
-`;
index 708e99b3c4ac8347f6fcda8683a3b24fece24d20..ef9f3b4ab092b6b9710cddee885efb19fb376ae9 100644 (file)
@@ -196,7 +196,7 @@ export default class EditTokenModal extends React.PureComponent<Props, State> {
                     <ClipboardIconButton copyValue={token} />
 
                     <DeleteButton
-                      aria-label={translate('users.tokens.revoke_token')}
+                      aria-label={translate('onboarding.token.delete')}
                       onClick={this.handleTokenRevoke}
                     />
                   </div>
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/AllSet-test.tsx b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/AllSet-test.tsx
deleted file mode 100644 (file)
index 2a9afa2..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { AlmKeys } from '../../../../types/alm-settings';
-import { AllSet, AllSetProps } from '../AllSet';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-  expect(shallowRender({ hasFeature: () => false })).toMatchSnapshot('without branch');
-  expect(shallowRender({ willRefreshAutomatically: true })).toMatchSnapshot('with auto refresh');
-});
-
-function shallowRender(props: Partial<AllSetProps> = {}) {
-  return shallow<AllSetProps>(
-    <AllSet alm={AlmKeys.GitHub} hasFeature={jest.fn().mockReturnValue(true)} {...props} />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/CompilationInfo-test.tsx b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/CompilationInfo-test.tsx
deleted file mode 100644 (file)
index e03ee25..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { CompilationInfo } from '../CompilationInfo';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-function shallowRender() {
-  return shallow(<CompilationInfo />);
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/CreateYmlFile-test.tsx b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/CreateYmlFile-test.tsx
deleted file mode 100644 (file)
index b9315e6..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { GradleProps } from '../../github-action/commands/Gradle';
-import CreateYmlFile, { CreateYmlFileProps } from '../CreateYmlFile';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-function shallowRender(props: Partial<CreateYmlFileProps> = {}) {
-  return shallow<GradleProps>(
-    <CreateYmlFile yamlFileName="test.yml" yamlTemplate="temaplate" {...props} />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/DefaultProjectKey-test.tsx b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/DefaultProjectKey-test.tsx
deleted file mode 100644 (file)
index a11723d..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../helpers/mocks/component';
-import DefaultProjectKey, { DefaultProjectKeyProps } from '../DefaultProjectKey';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-function shallowRender(props: Partial<DefaultProjectKeyProps> = {}) {
-  return shallow<DefaultProjectKeyProps>(
-    <DefaultProjectKey component={mockComponent()} {...props} />
-  );
-}
index cb32b3a99fcc7293d9e30240b0284679271c9a89..478430b58d73bbc1de841dc226263356606aa89b 100644 (file)
@@ -87,7 +87,7 @@ it('should behave correctly', async () => {
   expect(screen.getByRole('button', { name: 'copy_to_clipboard' })).toBeInTheDocument();
 
   // Revoke token.
-  await clickButton(user, 'users.tokens.revoke_token');
+  await clickButton(user, 'onboarding.token.delete');
   expect(tokenMock.tokens.map((t) => t.name)).not.toContain(lastToken.name);
 
   // Generate a new token.
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/FinishButton-test.tsx b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/FinishButton-test.tsx
deleted file mode 100644 (file)
index 2bf0ef8..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import FinishButton, { FinishButtonProps } from '../FinishButton';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-function shallowRender(props: Partial<FinishButtonProps> = {}) {
-  return shallow<FinishButtonProps>(<FinishButton onClick={jest.fn()} {...props} />);
-}
index c44fdfb15e7e2094d2bb44b6f1a94ecda4aea8ba..b42006e882f63fd76ec47141ca29617adac4e513 100644 (file)
  * along with this program; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
-import { shallow } from 'enzyme';
 import * as React from 'react';
+import { byRole } from 'testing-library-selector';
+import { renderComponent } from '../../../../helpers/testReactTestingUtils';
 import { OSs, TutorialModes } from '../../types';
 import GithubCFamilyExampleRepositories, {
   GithubCFamilyExampleRepositoriesProps,
 } from '../GithubCFamilyExampleRepositories';
 
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-  expect(shallowRender({ os: OSs.MacOS, ci: TutorialModes.AzurePipelines })).toMatchSnapshot();
-});
+const ui = {
+  cfamilyExamplesLink: byRole('link', { name: /sonarsource-cfamily-examples/ }),
+};
 
-function shallowRender(props: Partial<GithubCFamilyExampleRepositoriesProps> = {}) {
-  return shallow<GithubCFamilyExampleRepositoriesProps>(
-    <GithubCFamilyExampleRepositories className="test-class" {...props} />
+it.each([
+  [OSs.Linux, TutorialModes.Jenkins, 'linux', 'jenkins'],
+  [OSs.MacOS, TutorialModes.AzurePipelines, 'macos', 'azure'],
+])(
+  'should set correct value for CFamily examples link for %s and %ss',
+  async (os: OSs, ci: TutorialModes, formattedOS: string, formattedCI: string) => {
+    renderGithubCFamilyExampleRepositories({ os, ci });
+    expect(await ui.cfamilyExamplesLink.find()).toHaveAttribute(
+      'href',
+      `https://github.com/orgs/sonarsource-cfamily-examples/repositories?q=sq+${formattedOS}+${formattedCI}`
+    );
+  }
+);
+
+function renderGithubCFamilyExampleRepositories(
+  overrides: Partial<GithubCFamilyExampleRepositoriesProps> = {}
+) {
+  return renderComponent(
+    <GithubCFamilyExampleRepositories className="test-class" {...overrides} />
   );
 }
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/LabelActionPair-test.tsx b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/LabelActionPair-test.tsx
deleted file mode 100644 (file)
index b1f3f1e..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import LabelActionPair, { LabelActionPairProps } from '../LabelActionPair';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-function shallowRender(props: Partial<LabelActionPairProps> = {}) {
-  return shallow<LabelActionPairProps>(<LabelActionPair translationKey="foo" {...props} />);
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/LabelValuePair-test.tsx b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/LabelValuePair-test.tsx
deleted file mode 100644 (file)
index 54c7d4c..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import LabelValuePair, { LabelValuePairProps } from '../LabelValuePair';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-function shallowRender(props: Partial<LabelValuePairProps> = {}) {
-  return shallow<LabelValuePairProps>(
-    <LabelValuePair translationKey="foo" value="bar" {...props} />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/RenderOptions-test.tsx b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/RenderOptions-test.tsx
deleted file mode 100644 (file)
index bfbd2cb..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import RenderOptions, { RenderOptionsProps } from '../RenderOptions';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot('default');
-  expect(shallowRender({ checked: 'baz' })).toMatchSnapshot('option checked');
-  expect(shallowRender({ titleLabelKey: 'title.key' })).toMatchSnapshot('with title');
-});
-
-function shallowRender(props: Partial<RenderOptionsProps> = {}) {
-  return shallow<RenderOptionsProps>(
-    <RenderOptions
-      label="test-label"
-      checked={undefined}
-      onCheck={jest.fn()}
-      optionLabelKey="foo.bar"
-      options={['foo', 'baz']}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/SentenceWithFilename-test.tsx b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/SentenceWithFilename-test.tsx
deleted file mode 100644 (file)
index 7ee0b30..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import SentenceWithFilename, { SentenceWithFilenameProps } from '../SentenceWithFilename';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-function shallowRender(props: Partial<SentenceWithFilenameProps> = {}) {
-  return shallow<SentenceWithFilenameProps>(
-    <SentenceWithFilename filename="foo.txt" translationKey="bar" {...props} />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/SentenceWithHighlights-test.tsx b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/SentenceWithHighlights-test.tsx
deleted file mode 100644 (file)
index aed2bee..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import SentenceWithHighlights, { SentenceWithHighlightsProps } from '../SentenceWithHighlights';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-function shallowRender(props: Partial<SentenceWithHighlightsProps> = {}) {
-  return shallow<SentenceWithHighlightsProps>(
-    <SentenceWithHighlights highlightKeys={['hello', 'world']} translationKey="foo" {...props} />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/Step-test.tsx b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/Step-test.tsx
deleted file mode 100644 (file)
index d358150..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { click } from '../../../../helpers/testUtils';
-import Step from '../Step';
-
-it('renders', () => {
-  const wrapper = shallow(
-    <Step
-      finished={true}
-      onOpen={jest.fn()}
-      open={true}
-      renderForm={() => <div>form</div>}
-      renderResult={() => <div>result</div>}
-      stepNumber={1}
-      stepTitle="First Step"
-    />
-  );
-  expect(wrapper).toMatchSnapshot();
-  wrapper.setProps({ open: false });
-  expect(wrapper).toMatchSnapshot();
-});
-
-it('re-opens', () => {
-  const onOpen = jest.fn();
-  const wrapper = shallow(
-    <Step
-      finished={true}
-      onOpen={onOpen}
-      open={false}
-      renderForm={() => <div>form</div>}
-      renderResult={() => <div>result</div>}
-      stepNumber={1}
-      stepTitle="First Step"
-    />
-  );
-  click(wrapper);
-  expect(onOpen).toHaveBeenCalled();
-});
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/TokenStepGenerator-test.tsx b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/TokenStepGenerator-test.tsx
deleted file mode 100644 (file)
index 767019c..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../helpers/mocks/component';
-import { mockLoggedInUser } from '../../../../helpers/testMocks';
-import TokenStepGenerator, { TokenStepGeneratorProps } from '../TokenStepGenerator';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-function shallowRender(props: Partial<TokenStepGeneratorProps> = {}) {
-  return shallow<TokenStepGeneratorProps>(
-    <TokenStepGenerator component={mockComponent()} currentUser={mockLoggedInUser()} {...props} />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/YamlFileStep-test.tsx b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/YamlFileStep-test.tsx
deleted file mode 100644 (file)
index a6bde48..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { BuildTools } from '../../types';
-import RenderOptions from '../RenderOptions';
-import { YamlFileStep, YamlFileStepProps } from '../YamlFileStep';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot('C unavailable');
-  expect(shallowRender({ hasCLanguageFeature: true })).toMatchSnapshot('C available');
-});
-
-it('should render child correctly', () => {
-  const children = jest.fn();
-  const wrapper = shallowRender({ children });
-  expect(wrapper).toMatchSnapshot('C unavailable');
-  wrapper.find(RenderOptions).simulate('check', BuildTools.DotNet);
-  expect(children).toHaveBeenCalledWith(BuildTools.DotNet);
-});
-
-function shallowRender(props: Partial<YamlFileStepProps> = {}) {
-  return shallow<YamlFileStepProps>(<YamlFileStep hasCLanguageFeature={false} {...props} />);
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/AllSet-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/AllSet-test.tsx.snap
deleted file mode 100644 (file)
index 056a8d8..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<Fragment>
-  <div
-    className="abs-width-600"
-  >
-    <p
-      className="big-spacer-bottom"
-    >
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "all_set",
-          ]
-        }
-        translationKey="onboarding.tutorial.ci_outro.all_set"
-      />
-    </p>
-    <div
-      className="display-flex-row big-spacer-bottom"
-    >
-      <div>
-        <img
-          alt=""
-          className="big-spacer-right"
-          src="/images/tutorials/commit.svg"
-          width={30}
-        />
-      </div>
-      <div>
-        <p
-          className="little-spacer-bottom"
-        >
-          <strong>
-            onboarding.tutorial.ci_outro.commit
-          </strong>
-        </p>
-        <p>
-          onboarding.tutorial.ci_outro.commit.why.github
-        </p>
-      </div>
-    </div>
-  </div>
-</Fragment>
-`;
-
-exports[`should render correctly: with auto refresh 1`] = `
-<Fragment>
-  <div
-    className="abs-width-600"
-  >
-    <p
-      className="big-spacer-bottom"
-    >
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "all_set",
-          ]
-        }
-        translationKey="onboarding.tutorial.ci_outro.all_set"
-      />
-    </p>
-    <div
-      className="display-flex-row big-spacer-bottom"
-    >
-      <div>
-        <img
-          alt=""
-          className="big-spacer-right"
-          src="/images/tutorials/commit.svg"
-          width={30}
-        />
-      </div>
-      <div>
-        <p
-          className="little-spacer-bottom"
-        >
-          <strong>
-            onboarding.tutorial.ci_outro.commit
-          </strong>
-        </p>
-        <p>
-          onboarding.tutorial.ci_outro.commit.why.github
-        </p>
-      </div>
-    </div>
-    <div
-      className="display-flex-row"
-    >
-      <div>
-        <img
-          alt=""
-          className="big-spacer-right"
-          src="/images/tutorials/refresh.svg"
-          width={30}
-        />
-      </div>
-      <div>
-        <p
-          className="little-spacer-bottom"
-        >
-          <strong>
-            onboarding.tutorial.ci_outro.refresh
-          </strong>
-        </p>
-        <p>
-          onboarding.tutorial.ci_outro.refresh.why
-        </p>
-      </div>
-    </div>
-  </div>
-  <div
-    className="huge-spacer-bottom huge-spacer-top big-padded-top text-muted display-flex-center display-flex-justify-center"
-  >
-    <i
-      className="spinner spacer-right"
-    />
-    onboarding.tutorial.ci_outro.waiting_for_fist_analysis
-  </div>
-</Fragment>
-`;
-
-exports[`should render correctly: without branch 1`] = `
-<Fragment>
-  <div
-    className="abs-width-600"
-  >
-    <p
-      className="big-spacer-bottom"
-    >
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "all_set",
-          ]
-        }
-        translationKey="onboarding.tutorial.ci_outro.all_set"
-      />
-    </p>
-    <div
-      className="display-flex-row big-spacer-bottom"
-    >
-      <div>
-        <img
-          alt=""
-          className="big-spacer-right"
-          src="/images/tutorials/commit.svg"
-          width={30}
-        />
-      </div>
-      <div>
-        <p
-          className="little-spacer-bottom"
-        >
-          <strong>
-            onboarding.tutorial.ci_outro.commit
-          </strong>
-        </p>
-        <p>
-          onboarding.tutorial.ci_outro.commit.why.no_branches
-        </p>
-      </div>
-    </div>
-  </div>
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/CompilationInfo-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/CompilationInfo-test.tsx.snap
deleted file mode 100644 (file)
index 327efdd..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<Alert
-  className="spacer-top spacer-bottom"
-  variant="info"
->
-  <p
-    className="spacer-bottom"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.cfamilly.compilation_database_info"
-      id="onboarding.tutorial.cfamilly.compilation_database_info"
-      values={
-        {
-          "link": <withAppStateContext(DocLink)
-            to="/analyzing-source-code/languages/c-family/"
-          >
-            onboarding.tutorial.cfamilly.compilation_database_info.link
-          </withAppStateContext(DocLink)>,
-        }
-      }
-    />
-  </p>
-  <p>
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.cfamilly.speed_caching"
-      id="onboarding.tutorial.cfamilly.speed_caching"
-      values={
-        {
-          "link": <withAppStateContext(DocLink)
-            to="/analyzing-source-code/languages/c-family/#analysis-cache"
-          >
-            onboarding.tutorial.cfamilly.speed_caching.link
-          </withAppStateContext(DocLink)>,
-        }
-      }
-    />
-  </p>
-</Alert>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/CreateYmlFile-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/CreateYmlFile-test.tsx.snap
deleted file mode 100644 (file)
index d9976c9..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<li
-  className="abs-width-800"
->
-  <FormattedMessage
-    defaultMessage="onboarding.tutorial.with.github_action.yaml.create_yml"
-    id="onboarding.tutorial.with.github_action.yaml.create_yml"
-    values={
-      {
-        "file": <React.Fragment>
-          <code
-            className="rule"
-          >
-            test.yml
-          </code>
-          <ClipboardIconButton
-            copyValue="test.yml"
-          />
-        </React.Fragment>,
-      }
-    }
-  />
-  <CodeSnippet
-    snippet="temaplate"
-  />
-</li>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/DefaultProjectKey-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/DefaultProjectKey-test.tsx.snap
deleted file mode 100644 (file)
index cb21627..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<li
-  className="abs-width-600"
->
-  <SentenceWithFilename
-    filename="sonar-project.properties"
-    translationKey="onboarding.tutorial.other.project_key"
-  />
-  <CodeSnippet
-    snippet="sonar.projectKey=my-project"
-  />
-</li>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/FinishButton-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/FinishButton-test.tsx.snap
deleted file mode 100644 (file)
index fe4e121..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<Button
-  className="big-spacer-top big-spacer-bottom"
-  onClick={[MockFunction]}
->
-  tutorials.finish
-  <ChevronRightIcon
-    size={13}
-  />
-</Button>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/GithubCFamilyExampleRepositories-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/GithubCFamilyExampleRepositories-test.tsx.snap
deleted file mode 100644 (file)
index 14cb44e..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<div
-  className="github-cfamily-example-repositories-box big-padded boxed-group test-class"
->
-  <div
-    className="display-flex-center"
-  >
-    <img
-      alt=""
-      className="spacer-right"
-      height={20}
-      src="/images/alm/github.svg"
-    />
-    <ForwardRef(Link)
-      className="spacer-left big"
-      target="_blank"
-      to="https://github.com/orgs/sonarsource-cfamily-examples/repositories?q=sq"
-    >
-      sonarsource-cfamily-examples
-    </ForwardRef(Link)>
-  </div>
-  <p
-    className="spacer-top"
-  >
-    onboarding.tutorial.cfamily.examples_repositories_description
-  </p>
-</div>
-`;
-
-exports[`should render correctly 2`] = `
-<div
-  className="github-cfamily-example-repositories-box big-padded boxed-group test-class"
->
-  <div
-    className="display-flex-center"
-  >
-    <img
-      alt=""
-      className="spacer-right"
-      height={20}
-      src="/images/alm/github.svg"
-    />
-    <ForwardRef(Link)
-      className="spacer-left big"
-      target="_blank"
-      to="https://github.com/orgs/sonarsource-cfamily-examples/repositories?q=sq+macos+azure"
-    >
-      sonarsource-cfamily-examples
-    </ForwardRef(Link)>
-  </div>
-  <p
-    className="spacer-top"
-  >
-    onboarding.tutorial.cfamily.examples_repositories_description
-  </p>
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/LabelActionPair-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/LabelActionPair-test.tsx.snap
deleted file mode 100644 (file)
index 574d189..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<Fragment>
-  <strong>
-    foo.label
-    :
-  </strong>
-   
-  foo.action
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/LabelValuePair-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/LabelValuePair-test.tsx.snap
deleted file mode 100644 (file)
index 9930524..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<div
-  className="display-flex-center"
->
-  <strong
-    className="little-spacer-right"
-  >
-    foo.label
-    :
-  </strong>
-   
-  bar
-  <ClipboardIconButton
-    className="little-spacer-left"
-    copyValue="bar"
-  />
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/RenderOptions-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/RenderOptions-test.tsx.snap
deleted file mode 100644 (file)
index d62e872..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly: default 1`] = `
-<div
-  className="big-spacer-top"
->
-  <ButtonToggle
-    label="test-label"
-    onCheck={[MockFunction]}
-    options={
-      [
-        {
-          "label": "foo.bar.foo",
-          "value": "foo",
-        },
-        {
-          "label": "foo.bar.baz",
-          "value": "baz",
-        },
-      ]
-    }
-  />
-</div>
-`;
-
-exports[`should render correctly: option checked 1`] = `
-<div
-  className="big-spacer-top"
->
-  <ButtonToggle
-    label="test-label"
-    onCheck={[MockFunction]}
-    options={
-      [
-        {
-          "label": "foo.bar.foo",
-          "value": "foo",
-        },
-        {
-          "label": "foo.bar.baz",
-          "value": "baz",
-        },
-      ]
-    }
-    value="baz"
-  />
-</div>
-`;
-
-exports[`should render correctly: with title 1`] = `
-<div
-  className="big-spacer-top"
->
-  <h4
-    className="spacer-bottom"
-  >
-    title.key
-  </h4>
-  <ButtonToggle
-    label="test-label"
-    onCheck={[MockFunction]}
-    options={
-      [
-        {
-          "label": "foo.bar.foo",
-          "value": "foo",
-        },
-        {
-          "label": "foo.bar.baz",
-          "value": "baz",
-        },
-      ]
-    }
-  />
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/SentenceWithFilename-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/SentenceWithFilename-test.tsx.snap
deleted file mode 100644 (file)
index 9e8423f..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<span
-  className="markdown"
->
-  <FormattedMessage
-    defaultMessage="bar.sentence"
-    id="bar.sentence"
-    values={
-      {
-        "file": <code>
-          foo.txt
-        </code>,
-      }
-    }
-  />
-</span>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/SentenceWithHighlights-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/SentenceWithHighlights-test.tsx.snap
deleted file mode 100644 (file)
index 594f5ba..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<FormattedMessage
-  defaultMessage="foo.sentence"
-  id="foo.sentence"
-  values={
-    {
-      "hello": <strong>
-        foo.sentence.hello
-      </strong>,
-      "world": <strong>
-        foo.sentence.world
-      </strong>,
-    }
-  }
-/>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/Step-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/Step-test.tsx.snap
deleted file mode 100644 (file)
index e386e05..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`renders 1`] = `
-<div
-  className="boxed-group onboarding-step is-open is-finished"
->
-  <div
-    className="onboarding-step-number"
-  >
-    1
-  </div>
-  <div
-    className="boxed-group-header"
-  >
-    <h2>
-      First Step
-    </h2>
-  </div>
-  <div>
-    <div>
-      form
-    </div>
-  </div>
-</div>
-`;
-
-exports[`renders 2`] = `
-<div
-  className="boxed-group onboarding-step is-finished"
-  onClick={[Function]}
-  role="button"
-  tabIndex={0}
->
-  <div
-    className="onboarding-step-number"
-  >
-    1
-  </div>
-  <div>
-    result
-  </div>
-  <div
-    className="boxed-group-header"
-  >
-    <h2>
-      First Step
-    </h2>
-  </div>
-  <div
-    className="boxed-group-inner"
-  />
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/TokenStepGenerator-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/TokenStepGenerator-test.tsx.snap
deleted file mode 100644 (file)
index e3f4357..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<Fragment>
-  <li
-    className="big-spacer-bottom"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.env_variables"
-      id="onboarding.tutorial.env_variables"
-      values={
-        {
-          "extra": <Button
-            className="spacer-left"
-            onClick={[Function]}
-          >
-            onboarding.token.generate.long
-          </Button>,
-          "field": <strong>
-            onboarding.tutorial.env_variables.field
-          </strong>,
-          "value": "onboarding.tutorial.env_variables.token_generator.value",
-        }
-      }
-    />
-  </li>
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/YamlFileStep-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/YamlFileStep-test.tsx.snap
deleted file mode 100644 (file)
index 763c04d..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render child correctly: C unavailable 1`] = `
-<ol
-  className="list-styled big-spacer-top big-spacer-bottom"
->
-  <li
-    className="abs-width-600"
-  >
-    onboarding.build
-    <RenderOptions
-      label="onboarding.build"
-      onCheck={[Function]}
-      optionLabelKey="onboarding.build"
-      options={
-        [
-          "maven",
-          "gradle",
-          "dotnet",
-          "other",
-        ]
-      }
-    />
-  </li>
-</ol>
-`;
-
-exports[`should render correctly: C available 1`] = `
-<ol
-  className="list-styled big-spacer-top big-spacer-bottom"
->
-  <li
-    className="abs-width-600"
-  >
-    onboarding.build
-    <RenderOptions
-      label="onboarding.build"
-      onCheck={[Function]}
-      optionLabelKey="onboarding.build"
-      options={
-        [
-          "maven",
-          "gradle",
-          "dotnet",
-          "cfamily",
-          "other",
-        ]
-      }
-    />
-  </li>
-</ol>
-`;
-
-exports[`should render correctly: C unavailable 1`] = `
-<ol
-  className="list-styled big-spacer-top big-spacer-bottom"
->
-  <li
-    className="abs-width-600"
-  >
-    onboarding.build
-    <RenderOptions
-      label="onboarding.build"
-      onCheck={[Function]}
-      optionLabelKey="onboarding.build"
-      options={
-        [
-          "maven",
-          "gradle",
-          "dotnet",
-          "other",
-        ]
-      }
-    />
-  </li>
-</ol>
-`;
index e6d736dcb2689ad816591dc96a5ee8fae94e48b2..6204a994d682295f37d01be2e8e4991a0d099b7f 100644 (file)
@@ -41,10 +41,6 @@ export function AnalysisCommand(props: AnalysisCommandProps) {
   const { buildTool, component, mainBranchName } = props;
   const branchSupportEnabled = props.hasFeature(Feature.BranchSupport);
 
-  if (!buildTool) {
-    return null;
-  }
-
   switch (buildTool) {
     case BuildTools.Maven:
       return (
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/AnalysisCommand-test.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/AnalysisCommand-test.tsx
deleted file mode 100644 (file)
index f3ad33a..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../helpers/mocks/component';
-import { BuildTools } from '../../types';
-import { AnalysisCommand, AnalysisCommandProps } from '../AnalysisCommand';
-
-it.each([
-  undefined,
-  BuildTools.CFamily,
-  BuildTools.DotNet,
-  BuildTools.Gradle,
-  BuildTools.Maven,
-  BuildTools.Other,
-])('should render correctly for %p', (buildTool) => {
-  expect(shallowRender({ buildTool })).toMatchSnapshot();
-});
-
-function shallowRender(props: Partial<AnalysisCommandProps> = {}) {
-  return shallow<AnalysisCommandProps>(
-    <AnalysisCommand
-      hasFeature={jest.fn().mockReturnValue(false)}
-      mainBranchName="main"
-      component={mockComponent()}
-      buildTool={BuildTools.DotNet}
-      onDone={jest.fn()}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/GitHubActionTutorial-test.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/GitHubActionTutorial-test.tsx
deleted file mode 100644 (file)
index a32c9d2..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import {
-  mockAlmSettingsInstance,
-  mockProjectGithubBindingResponse,
-} from '../../../../helpers/mocks/alm-settings';
-import { mockComponent } from '../../../../helpers/mocks/component';
-import { mockLoggedInUser } from '../../../../helpers/testMocks';
-import Step from '../../components/Step';
-import { renderStepContent } from '../../test-utils';
-import GitHubActionTutorial, { GitHubActionTutorialProps } from '../GitHubActionTutorial';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot('default');
-  expect(shallowRender({ almBinding: undefined })).toMatchSnapshot('no binding');
-  expect(renderStepContent(shallowRender())).toMatchSnapshot('secrets step content');
-  expect(renderStepContent(shallowRender(), 1)).toMatchSnapshot('yaml file step content');
-});
-
-it('should correctly navigate through the steps', () => {
-  const wrapper = shallowRender();
-
-  expect(wrapper.find(Step).at(0).props().open).toBe(true);
-  expect(wrapper.find(Step).at(1).props().open).toBe(false);
-
-  wrapper.find(Step).at(1).simulate('open');
-  expect(wrapper.find(Step).at(0).props().open).toBe(false);
-  expect(wrapper.find(Step).at(1).props().open).toBe(true);
-});
-
-function shallowRender(props: Partial<GitHubActionTutorialProps> = {}) {
-  return shallow<GitHubActionTutorialProps>(
-    <GitHubActionTutorial
-      almBinding={mockAlmSettingsInstance()}
-      baseUrl="test"
-      currentUser={mockLoggedInUser()}
-      component={mockComponent()}
-      mainBranchName="master"
-      projectBinding={mockProjectGithubBindingResponse()}
-      willRefreshAutomatically={true}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/GithubActionTutorial-it.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/GithubActionTutorial-it.tsx
new file mode 100644 (file)
index 0000000..22bd345
--- /dev/null
@@ -0,0 +1,168 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2023 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * 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 selectEvent from 'react-select-event';
+import UserTokensMock from '../../../../api/mocks/UserTokensMock';
+import {
+  mockAlmSettingsInstance,
+  mockProjectAlmBindingResponse,
+} from '../../../../helpers/mocks/alm-settings';
+import { mockComponent } from '../../../../helpers/mocks/component';
+import { mockLanguage, mockLoggedInUser } from '../../../../helpers/testMocks';
+import { renderApp, RenderContext } from '../../../../helpers/testReactTestingUtils';
+import { AlmKeys } from '../../../../types/alm-settings';
+import { Feature } from '../../../../types/features';
+import {
+  getCommonNodes,
+  getCopyToClipboardValue,
+  getTutorialActionButtons,
+  getTutorialBuildButtons,
+} from '../../test-utils';
+import { TutorialModes } from '../../types';
+import GitHubActionTutorial, { GitHubActionTutorialProps } from '../GitHubActionTutorial';
+
+jest.mock('../../../../api/user-tokens');
+
+jest.mock('../../../../api/settings', () => ({
+  getAllValues: jest.fn().mockResolvedValue([]),
+}));
+
+const tokenMock = new UserTokensMock();
+
+afterEach(() => {
+  tokenMock.reset();
+});
+
+const ui = {
+  ...getCommonNodes(TutorialModes.GitHubActions),
+  ...getTutorialActionButtons(),
+  ...getTutorialBuildButtons(),
+};
+
+it('should follow and complete all steps', async () => {
+  const user = userEvent.setup();
+  renderGithubActionTutorial();
+
+  expect(await ui.secretsStepTitle.find()).toBeInTheDocument();
+
+  // Env variables step
+  expect(getCopyToClipboardValue()).toMatchSnapshot('sonar token key');
+  expect(getCopyToClipboardValue(1)).toMatchSnapshot('sonarqube host url key');
+  expect(getCopyToClipboardValue(2)).toMatchSnapshot('sonarqube host url value');
+  await user.click(ui.continueButton.get());
+
+  // Create/update configuration file step
+  // Maven
+  await user.click(ui.mavenBuildButton.get());
+  expect(getCopyToClipboardValue(1)).toMatchSnapshot('Maven: .github/workflows/build.yml');
+
+  // Gradle
+  await user.click(ui.gradleBuildButton.get());
+  expect(getCopyToClipboardValue(1)).toMatchSnapshot('Gradle: build.gradle');
+  expect(getCopyToClipboardValue(3)).toMatchSnapshot('Gradle: .github/workflows/build.yml');
+
+  // .NET
+  await user.click(ui.dotnetBuildButton.get());
+  expect(getCopyToClipboardValue(1)).toMatchSnapshot('.NET: .github/workflows/build.yml');
+
+  // CFamily
+  await user.click(ui.cFamilyBuildButton.get());
+  expect(getCopyToClipboardValue()).toMatchSnapshot('CFamily: sonar-project.properties');
+  await user.click(ui.linuxButton.get());
+  expect(getCopyToClipboardValue(2)).toMatchSnapshot('CFamily Linux: .github/workflows/build.yml');
+  await user.click(ui.windowsButton.get());
+  expect(getCopyToClipboardValue(2)).toMatchSnapshot(
+    'CFamily Windows: .github/workflows/build.yml'
+  );
+  await user.click(ui.macosButton.get());
+  expect(getCopyToClipboardValue(2)).toMatchSnapshot('CFamily MacOS: .github/workflows/build.yml');
+
+  // Other
+  await user.click(ui.otherBuildButton.get());
+  expect(getCopyToClipboardValue()).toMatchSnapshot('Other: sonar-project.properties');
+  expect(getCopyToClipboardValue(2)).toMatchSnapshot('Other: .github/workflows/build.yml');
+
+  await user.click(ui.finishTutorialButton.get());
+  expect(ui.allSetSentence.get()).toBeInTheDocument();
+});
+
+it('should generate/delete a new token or use existing one', async () => {
+  const user = userEvent.setup();
+  renderGithubActionTutorial();
+
+  expect(await ui.secretsStepTitle.find()).toBeInTheDocument();
+
+  // Generate token
+  await user.click(ui.genTokenDialogButton.get());
+  await user.click(ui.generateTokenButton.get());
+  expect(getCopyToClipboardValue(3)).toEqual('generatedtoken2');
+
+  // Revoke current token and create new one
+  await user.click(ui.deleteTokenButton.get());
+  await user.type(ui.tokenNameInput.get(), 'newtoken');
+  await selectEvent.select(ui.expiresInSelect.get(), 'users.tokens.expiration.365');
+  await user.click(ui.generateTokenButton.get());
+  expect(ui.tokenValue.get()).toBeInTheDocument();
+  await user.click(ui.continueButton.getAll()[1]);
+  expect(ui.tokenValue.query()).not.toBeInTheDocument();
+});
+
+it('navigates between steps', async () => {
+  const user = userEvent.setup();
+  renderGithubActionTutorial({
+    almBinding: mockAlmSettingsInstance({
+      alm: AlmKeys.GitHub,
+      url: 'http://localhost/qube',
+    }),
+    projectBinding: mockProjectAlmBindingResponse({ alm: AlmKeys.GitHub }),
+  });
+
+  // If project is bound, link to repo is visible
+  expect(await ui.linkToRepo.find()).toBeInTheDocument();
+
+  await user.click(await ui.continueButton.find());
+  await user.click(ui.mavenBuildButton.get());
+  await user.click(ui.finishTutorialButton.get());
+  expect(ui.allSetSentence.get()).toBeInTheDocument();
+
+  await user.click(ui.ymlFileStepTitle.get());
+  expect(ui.mavenBuildButton.get()).toBeInTheDocument();
+  await user.click(ui.secretsStepTitle.get());
+  expect(ui.genTokenDialogButton.get()).toBeInTheDocument();
+});
+
+function renderGithubActionTutorial(
+  overrides: Partial<GitHubActionTutorialProps> = {},
+  { languages = { c: mockLanguage({ key: 'c' }) } }: RenderContext = {}
+) {
+  return renderApp(
+    '/',
+    <GitHubActionTutorial
+      baseUrl="http://localhost:9000"
+      mainBranchName="main"
+      component={mockComponent()}
+      currentUser={mockLoggedInUser()}
+      {...overrides}
+    />,
+    { languages, featureList: [Feature.BranchSupport] }
+  );
+}
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/SecretStep-test.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/SecretStep-test.tsx
deleted file mode 100644 (file)
index 73d2222..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import {
-  mockAlmSettingsInstance,
-  mockProjectGithubBindingResponse,
-} from '../../../../helpers/mocks/alm-settings';
-import { mockComponent } from '../../../../helpers/mocks/component';
-import { mockLoggedInUser } from '../../../../helpers/testMocks';
-import SecretStep, { SecretStepProps } from '../SecretStep';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot('default');
-  expect(
-    shallowRender({
-      almBinding: mockAlmSettingsInstance({ url: 'http://github.enterprise.com/api/v3' }),
-      projectBinding: mockProjectGithubBindingResponse(),
-    })
-  ).toMatchSnapshot('with binding information');
-});
-
-function shallowRender(props: Partial<SecretStepProps> = {}) {
-  return shallow<SecretStepProps>(
-    <SecretStep
-      baseUrl="test"
-      component={mockComponent()}
-      currentUser={mockLoggedInUser()}
-      onDone={jest.fn()}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/AnalysisCommand-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/AnalysisCommand-test.tsx.snap
deleted file mode 100644 (file)
index a9d3a81..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly for "cfamily" 1`] = `
-<CFamily
-  branchesEnabled={false}
-  component={
-    {
-      "breadcrumbs": [],
-      "key": "my-project",
-      "name": "MyProject",
-      "qualifier": "TRK",
-      "qualityGate": {
-        "isDefault": true,
-        "key": "30",
-        "name": "Sonar way",
-      },
-      "qualityProfiles": [
-        {
-          "deleted": false,
-          "key": "my-qp",
-          "language": "ts",
-          "name": "Sonar way",
-        },
-      ],
-      "tags": [],
-    }
-  }
-  mainBranchName="main"
-  onDone={[MockFunction]}
-/>
-`;
-
-exports[`should render correctly for "dotnet" 1`] = `
-<DotNet
-  branchesEnabled={false}
-  component={
-    {
-      "breadcrumbs": [],
-      "key": "my-project",
-      "name": "MyProject",
-      "qualifier": "TRK",
-      "qualityGate": {
-        "isDefault": true,
-        "key": "30",
-        "name": "Sonar way",
-      },
-      "qualityProfiles": [
-        {
-          "deleted": false,
-          "key": "my-qp",
-          "language": "ts",
-          "name": "Sonar way",
-        },
-      ],
-      "tags": [],
-    }
-  }
-  mainBranchName="main"
-  onDone={[MockFunction]}
-/>
-`;
-
-exports[`should render correctly for "gradle" 1`] = `
-<Gradle
-  branchesEnabled={false}
-  component={
-    {
-      "breadcrumbs": [],
-      "key": "my-project",
-      "name": "MyProject",
-      "qualifier": "TRK",
-      "qualityGate": {
-        "isDefault": true,
-        "key": "30",
-        "name": "Sonar way",
-      },
-      "qualityProfiles": [
-        {
-          "deleted": false,
-          "key": "my-qp",
-          "language": "ts",
-          "name": "Sonar way",
-        },
-      ],
-      "tags": [],
-    }
-  }
-  mainBranchName="main"
-  onDone={[MockFunction]}
-/>
-`;
-
-exports[`should render correctly for "maven" 1`] = `
-<JavaMaven
-  branchesEnabled={false}
-  component={
-    {
-      "breadcrumbs": [],
-      "key": "my-project",
-      "name": "MyProject",
-      "qualifier": "TRK",
-      "qualityGate": {
-        "isDefault": true,
-        "key": "30",
-        "name": "Sonar way",
-      },
-      "qualityProfiles": [
-        {
-          "deleted": false,
-          "key": "my-qp",
-          "language": "ts",
-          "name": "Sonar way",
-        },
-      ],
-      "tags": [],
-    }
-  }
-  mainBranchName="main"
-  onDone={[MockFunction]}
-/>
-`;
-
-exports[`should render correctly for "other" 1`] = `
-<Others
-  branchesEnabled={false}
-  component={
-    {
-      "breadcrumbs": [],
-      "key": "my-project",
-      "name": "MyProject",
-      "qualifier": "TRK",
-      "qualityGate": {
-        "isDefault": true,
-        "key": "30",
-        "name": "Sonar way",
-      },
-      "qualityProfiles": [
-        {
-          "deleted": false,
-          "key": "my-qp",
-          "language": "ts",
-          "name": "Sonar way",
-        },
-      ],
-      "tags": [],
-    }
-  }
-  mainBranchName="main"
-  onDone={[MockFunction]}
-/>
-`;
-
-exports[`should render correctly for undefined 1`] = `""`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GitHubActionTutorial-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GitHubActionTutorial-test.tsx.snap
deleted file mode 100644 (file)
index 4756320..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly: default 1`] = `
-<Fragment>
-  <Step
-    finished={false}
-    onOpen={[Function]}
-    open={true}
-    renderForm={[Function]}
-    stepNumber={1}
-    stepTitle="onboarding.tutorial.with.github_action.create_secret.title"
-  />
-  <Step
-    finished={false}
-    onOpen={[Function]}
-    open={false}
-    renderForm={[Function]}
-    stepNumber={2}
-    stepTitle="onboarding.tutorial.with.github_action.yaml.title"
-  />
-  <AllSetStep
-    alm="github"
-    open={false}
-    stepNumber={3}
-    willRefreshAutomatically={true}
-  />
-</Fragment>
-`;
-
-exports[`should render correctly: no binding 1`] = `
-<Fragment>
-  <Step
-    finished={false}
-    onOpen={[Function]}
-    open={true}
-    renderForm={[Function]}
-    stepNumber={1}
-    stepTitle="onboarding.tutorial.with.github_action.create_secret.title"
-  />
-  <Step
-    finished={false}
-    onOpen={[Function]}
-    open={false}
-    renderForm={[Function]}
-    stepNumber={2}
-    stepTitle="onboarding.tutorial.with.github_action.yaml.title"
-  />
-  <AllSetStep
-    alm="github"
-    open={false}
-    stepNumber={3}
-    willRefreshAutomatically={true}
-  />
-</Fragment>
-`;
-
-exports[`should render correctly: secrets step content 1`] = `
-<SecretStep
-  almBinding={
-    {
-      "alm": "github",
-      "key": "key",
-    }
-  }
-  baseUrl="test"
-  component={
-    {
-      "breadcrumbs": [],
-      "key": "my-project",
-      "name": "MyProject",
-      "qualifier": "TRK",
-      "qualityGate": {
-        "isDefault": true,
-        "key": "30",
-        "name": "Sonar way",
-      },
-      "qualityProfiles": [
-        {
-          "deleted": false,
-          "key": "my-qp",
-          "language": "ts",
-          "name": "Sonar way",
-        },
-      ],
-      "tags": [],
-    }
-  }
-  currentUser={
-    {
-      "dismissedNotices": {
-        "educationPrinciples": false,
-      },
-      "groups": [],
-      "isLoggedIn": true,
-      "login": "luke",
-      "name": "Skywalker",
-      "scmAccounts": [],
-    }
-  }
-  onDone={[Function]}
-  projectBinding={
-    {
-      "alm": "github",
-      "key": "foo",
-      "monorepo": true,
-      "repository": "PROJECT_KEY",
-    }
-  }
-/>
-`;
-
-exports[`should render correctly: yaml file step content 1`] = `
-<withCLanguageFeature(YamlFileStep)>
-  [Function]
-</withCLanguageFeature(YamlFileStep)>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap
new file mode 100644 (file)
index 0000000..98f9cf9
--- /dev/null
@@ -0,0 +1,325 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should follow and complete all steps: .NET: .github/workflows/build.yml 1`] = `
+"name: Build
+
+on:
+  push:
+    branches:
+      - main
+  pull_request:
+    types: [opened, synchronize, reopened]
+
+jobs:
+  build:
+    name: Build
+    runs-on: windows-latest
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
+      - name: Set up JDK 11
+        uses: actions/setup-java@v1
+        with:
+          java-version: 1.11
+      - name: Cache SonarQube packages
+        uses: actions/cache@v1
+        with:
+          path: ~\\sonar\\cache
+          key: \${{ runner.os }}-sonar
+          restore-keys: \${{ runner.os }}-sonar
+      - name: Cache SonarQube scanner
+        id: cache-sonar-scanner
+        uses: actions/cache@v1
+        with:
+          path: .\\.sonar\\scanner
+          key: \${{ runner.os }}-sonar-scanner
+          restore-keys: \${{ runner.os }}-sonar-scanner
+      - name: Install SonarQube scanner
+        if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
+        shell: powershell
+        run: |
+          New-Item -Path .\\.sonar\\scanner -ItemType Directory
+          dotnet tool update dotnet-sonarscanner --tool-path .\\.sonar\\scanner
+      - name: Build and analyze
+        env:
+          GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
+        shell: powershell
+        run: |
+          .\\.sonar\\scanner\\dotnet-sonarscanner begin /k:"my-project" /d:sonar.login="\${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="\${{ secrets.SONAR_HOST_URL }}"
+          dotnet build
+          .\\.sonar\\scanner\\dotnet-sonarscanner end /d:sonar.login="\${{ secrets.SONAR_TOKEN }}""
+`;
+
+exports[`should follow and complete all steps: CFamily Linux: .github/workflows/build.yml 1`] = `
+"name: Build
+
+on:
+  push:
+    branches:
+      - main
+  pull_request:
+    types: [opened, synchronize, reopened]
+
+jobs:
+  build:
+    name: Build
+    runs-on: <image ready for your build toolchain>
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
+      - name: Download and install the build wrapper, build the project
+        run: |
+          mkdir $HOME/.sonar
+          curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \${{ secrets.SONAR_HOST_URL }}/static/cpp/build-wrapper-linux-x86.zip
+          unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
+          $HOME/.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command>
+        env:
+          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
+
+      - name: Download and install the SonarScanner
+        env:
+          SONAR_SCANNER_VERSION: 4.6.2.2472
+        run: |
+          curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${{ env.SONAR_SCANNER_VERSION }}-linux.zip
+          unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
+          echo "$HOME/.sonar/sonar-scanner-\${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH
+
+      - name: SonarQube analysis
+        run: |
+          sonar-scanner --define sonar.cfamily.build-wrapper-output=bw-output  
+        env:
+          SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
+          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}"
+`;
+
+exports[`should follow and complete all steps: CFamily MacOS: .github/workflows/build.yml 1`] = `
+"name: Build
+
+on:
+  push:
+    branches:
+      - main
+  pull_request:
+    types: [opened, synchronize, reopened]
+
+jobs:
+  build:
+    name: Build
+    runs-on: <image ready for your build toolchain>
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
+      - name: Download and install the build wrapper
+        run: |
+          mkdir $HOME/.sonar
+          curl -sSLo $HOME/.sonar/build-wrapper-macosx-x86.zip \${{ secrets.SONAR_HOST_URL }}/static/cpp/build-wrapper-macosx-x86.zip
+          unzip -o $HOME/.sonar/build-wrapper-macosx-x86.zip -d $HOME/.sonar/
+        env:
+          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
+
+      - name: Download and install the SonarScanner
+        run: |
+          curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-macosx.zip
+          unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
+
+      - name: Build and analyse the project
+        run: |
+          # Potential improvement : add these paths to the PATH env var.
+          $HOME/.sonar/build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir bw-output <your clean build command>
+          $HOME/.sonar/sonar-scanner-4.6.2.2472-macosx/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output
+        env:
+          SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
+          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}"
+`;
+
+exports[`should follow and complete all steps: CFamily Windows: .github/workflows/build.yml 1`] = `
+"name: Build
+
+on:
+  push:
+    branches:
+      - main
+  pull_request:
+    types: [opened, synchronize, reopened]
+
+jobs:
+  build:
+    name: Build
+    runs-on: <image ready for your build toolchain>
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
+      - name: Download and install the build wrapper
+        shell: powershell
+        run: |
+          $path = "$HOME/.sonar/build-wrapper-win-x86.zip"
+          mkdir $HOME/.sonar
+          [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
+          (New-Object System.Net.WebClient).DownloadFile("\${{ secrets.SONAR_HOST_URL }}/static/cpp/build-wrapper-win-x86.zip", $path)
+          Add-Type -AssemblyName System.IO.Compression.FileSystem
+          [System.IO.Compression.ZipFile]::ExtractToDirectory($path, "$HOME/.sonar")
+        env:
+          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
+
+      - name: Download and install the SonarScanner
+        shell: powershell
+        run: |
+          $path = "$HOME/.sonar/sonar-scanner-cli-4.6.2.2472-windows.zip"
+          [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
+          (New-Object System.Net.WebClient).DownloadFile("https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-windows.zip", $path)
+          Add-Type -AssemblyName System.IO.Compression.FileSystem
+          [System.IO.Compression.ZipFile]::ExtractToDirectory($path, "$HOME/.sonar")
+
+      - name: Build and analyse the project
+        shell: powershell
+        run: |
+          $env:Path += ";$HOME/.sonar/build-wrapper-win-x86;$HOME/.sonar/sonar-scanner-4.6.2.2472-windows/bin"
+          build-wrapper-win-x86-64 --out-dir bw-output <your clean build command>
+          sonar-scanner.bat "-Dsonar.cfamily.build-wrapper-output=bw-output"
+        env:
+          SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
+          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}"
+`;
+
+exports[`should follow and complete all steps: CFamily: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
+
+exports[`should follow and complete all steps: Gradle: .github/workflows/build.yml 1`] = `
+"name: Build
+
+on:
+  push:
+    branches:
+      - main
+  pull_request:
+    types: [opened, synchronize, reopened]
+
+jobs:
+  build:
+    name: Build
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
+      - name: Set up JDK 11
+        uses: actions/setup-java@v1
+        with:
+          java-version: 11
+      - name: Cache SonarQube packages
+        uses: actions/cache@v1
+        with:
+          path: ~/.sonar/cache
+          key: \${{ runner.os }}-sonar
+          restore-keys: \${{ runner.os }}-sonar
+      - name: Cache Gradle packages
+        uses: actions/cache@v1
+        with:
+          path: ~/.gradle/caches
+          key: \${{ runner.os }}-gradle-\${{ hashFiles('**/*.gradle') }}
+          restore-keys: \${{ runner.os }}-gradle
+      - name: Build and analyze
+        env:
+          GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
+          SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
+          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
+        run: ./gradlew build sonar --info"
+`;
+
+exports[`should follow and complete all steps: Gradle: build.gradle 1`] = `
+"plugins {
+  id "org.sonarqube" version "3.5.0.2730"
+}
+
+sonar {
+  properties {
+    property "sonar.projectKey", "my-project"
+    property "sonar.projectName", "MyProject"
+  }
+}"
+`;
+
+exports[`should follow and complete all steps: Maven: .github/workflows/build.yml 1`] = `
+"name: Build
+
+on:
+  push:
+    branches:
+      - main
+  pull_request:
+    types: [opened, synchronize, reopened]
+
+jobs:
+  build:
+    name: Build
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
+      - name: Set up JDK 11
+        uses: actions/setup-java@v1
+        with:
+          java-version: 11
+      - name: Cache SonarQube packages
+        uses: actions/cache@v1
+        with:
+          path: ~/.sonar/cache
+          key: \${{ runner.os }}-sonar
+          restore-keys: \${{ runner.os }}-sonar
+      - name: Cache Maven packages
+        uses: actions/cache@v1
+        with:
+          path: ~/.m2
+          key: \${{ runner.os }}-m2-\${{ hashFiles('**/pom.xml') }}
+          restore-keys: \${{ runner.os }}-m2
+      - name: Build and analyze
+        env:
+          GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
+          SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
+          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
+        run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'"
+`;
+
+exports[`should follow and complete all steps: Other: .github/workflows/build.yml 1`] = `
+"name: Build
+
+on:
+  push:
+    branches:
+      - main
+  pull_request:
+    types: [opened, synchronize, reopened]
+
+jobs:
+  build:
+    name: Build
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
+      - uses: sonarsource/sonarqube-scan-action@master
+        env:
+          SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
+          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
+      # If you wish to fail your job when the Quality Gate is red, uncomment the
+      # following lines. This would typically be used to fail a deployment.
+      # We do not recommend to use this in a pull request. Prefer using pull request
+      # decoration instead.
+      # - uses: sonarsource/sonarqube-quality-gate-action@master
+      #   timeout-minutes: 5
+      #   env:
+      #     SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}"
+`;
+
+exports[`should follow and complete all steps: Other: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`;
+
+exports[`should follow and complete all steps: sonar token key 1`] = `"SONAR_TOKEN"`;
+
+exports[`should follow and complete all steps: sonarqube host url key 1`] = `"SONAR_HOST_URL"`;
+
+exports[`should follow and complete all steps: sonarqube host url value 1`] = `"http://localhost:9000"`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/SecretStep-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/SecretStep-test.tsx.snap
deleted file mode 100644 (file)
index 1e8933b..0000000
+++ /dev/null
@@ -1,351 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly: default 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <p
-    className="big-spacer-bottom"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.github_action.secret.intro"
-      id="onboarding.tutorial.with.github_action.secret.intro"
-      values={
-        {
-          "settings_secret": <strong>
-            onboarding.tutorial.with.github_action.secret.intro.link
-          </strong>,
-        }
-      }
-    />
-  </p>
-  <ol
-    className="list-styled"
-  >
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "new_secret",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.github_action.secret.new"
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "name",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.github_action.secret.name"
-      />
-      <code
-        className="rule little-spacer-left"
-      >
-        SONAR_TOKEN
-      </code>
-      <ClipboardIconButton
-        copyValue="SONAR_TOKEN"
-      />
-    </li>
-    <TokenStepGenerator
-      component={
-        {
-          "breadcrumbs": [],
-          "key": "my-project",
-          "name": "MyProject",
-          "qualifier": "TRK",
-          "qualityGate": {
-            "isDefault": true,
-            "key": "30",
-            "name": "Sonar way",
-          },
-          "qualityProfiles": [
-            {
-              "deleted": false,
-              "key": "my-qp",
-              "language": "ts",
-              "name": "Sonar way",
-            },
-          ],
-          "tags": [],
-        }
-      }
-      currentUser={
-        {
-          "dismissedNotices": {
-            "educationPrinciples": false,
-          },
-          "groups": [],
-          "isLoggedIn": true,
-          "login": "luke",
-          "name": "Skywalker",
-          "scmAccounts": [],
-        }
-      }
-    />
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "add_secret",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.github_action.secret.add"
-      />
-    </li>
-  </ol>
-  <hr
-    className="no-horizontal-margins"
-  />
-  <ol
-    className="list-styled big-spacer-top big-spacer-bottom"
-  >
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "new_secret",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.github_action.secret.new"
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "name",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.github_action.secret.name"
-      />
-      <code
-        className="rule little-spacer-left"
-      >
-        SONAR_HOST_URL
-      </code>
-      <ClipboardIconButton
-        copyValue="SONAR_HOST_URL"
-      />
-    </li>
-    <li
-      className="big-spacer-bottom"
-    >
-      <FormattedMessage
-        defaultMessage="onboarding.tutorial.env_variables"
-        id="onboarding.tutorial.env_variables"
-        values={
-          {
-            "extra": <ClipboardIconButton
-              copyValue="test"
-            />,
-            "field": <strong>
-              onboarding.tutorial.env_variables.field
-            </strong>,
-            "value": <code
-              className="rule"
-            >
-              test
-            </code>,
-          }
-        }
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "add_secret",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.github_action.secret.add"
-      />
-    </li>
-  </ol>
-  <Button
-    onClick={[MockFunction]}
-  >
-    continue
-  </Button>
-</div>
-`;
-
-exports[`should render correctly: with binding information 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <p
-    className="big-spacer-bottom"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.github_action.secret.intro"
-      id="onboarding.tutorial.with.github_action.secret.intro"
-      values={
-        {
-          "settings_secret": <a
-            href="http://github.enterprise.com/PROJECT_KEY/settings/secrets"
-            rel="noopener noreferrer"
-            target="_blank"
-          >
-            onboarding.tutorial.with.github_action.secret.intro.link
-          </a>,
-        }
-      }
-    />
-  </p>
-  <ol
-    className="list-styled"
-  >
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "new_secret",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.github_action.secret.new"
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "name",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.github_action.secret.name"
-      />
-      <code
-        className="rule little-spacer-left"
-      >
-        SONAR_TOKEN
-      </code>
-      <ClipboardIconButton
-        copyValue="SONAR_TOKEN"
-      />
-    </li>
-    <TokenStepGenerator
-      component={
-        {
-          "breadcrumbs": [],
-          "key": "my-project",
-          "name": "MyProject",
-          "qualifier": "TRK",
-          "qualityGate": {
-            "isDefault": true,
-            "key": "30",
-            "name": "Sonar way",
-          },
-          "qualityProfiles": [
-            {
-              "deleted": false,
-              "key": "my-qp",
-              "language": "ts",
-              "name": "Sonar way",
-            },
-          ],
-          "tags": [],
-        }
-      }
-      currentUser={
-        {
-          "dismissedNotices": {
-            "educationPrinciples": false,
-          },
-          "groups": [],
-          "isLoggedIn": true,
-          "login": "luke",
-          "name": "Skywalker",
-          "scmAccounts": [],
-        }
-      }
-    />
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "add_secret",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.github_action.secret.add"
-      />
-    </li>
-  </ol>
-  <hr
-    className="no-horizontal-margins"
-  />
-  <ol
-    className="list-styled big-spacer-top big-spacer-bottom"
-  >
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "new_secret",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.github_action.secret.new"
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "name",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.github_action.secret.name"
-      />
-      <code
-        className="rule little-spacer-left"
-      >
-        SONAR_HOST_URL
-      </code>
-      <ClipboardIconButton
-        copyValue="SONAR_HOST_URL"
-      />
-    </li>
-    <li
-      className="big-spacer-bottom"
-    >
-      <FormattedMessage
-        defaultMessage="onboarding.tutorial.env_variables"
-        id="onboarding.tutorial.env_variables"
-        values={
-          {
-            "extra": <ClipboardIconButton
-              copyValue="test"
-            />,
-            "field": <strong>
-              onboarding.tutorial.env_variables.field
-            </strong>,
-            "value": <code
-              className="rule"
-            >
-              test
-            </code>,
-          }
-        }
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "add_secret",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.github_action.secret.add"
-      />
-    </li>
-  </ol>
-  <Button
-    onClick={[MockFunction]}
-  >
-    continue
-  </Button>
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/CFamily-test.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/CFamily-test.tsx
deleted file mode 100644 (file)
index 598a54d..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import RenderOptions from '../../../components/RenderOptions';
-import { OSs } from '../../../types';
-import CFamily, { CFamilyProps } from '../CFamily';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-it.each([
-  [OSs.Linux, false],
-  [OSs.MacOS, true],
-  [OSs.Windows, true],
-])('should render correctly for %s', (os: OSs, branchesEnabled: boolean) => {
-  const wrapper = shallowRender({ branchesEnabled });
-  wrapper.find(RenderOptions).props().onCheck(os);
-  expect(wrapper).toMatchSnapshot(`branches ${branchesEnabled ? 'enabled' : 'disabled'}`);
-});
-
-function shallowRender(props: Partial<CFamilyProps> = {}) {
-  return shallow<CFamilyProps>(
-    <CFamily
-      branchesEnabled={true}
-      component={mockComponent()}
-      mainBranchName="main"
-      onDone={jest.fn()}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/DotNet-test.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/DotNet-test.tsx
deleted file mode 100644 (file)
index ec42d71..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import DotNet, { DotNetProps } from '../DotNet';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-  expect(shallowRender({ branchesEnabled: false })).toMatchSnapshot('without branch enabled');
-});
-
-function shallowRender(props: Partial<DotNetProps> = {}) {
-  return shallow<DotNetProps>(
-    <DotNet
-      branchesEnabled={true}
-      component={mockComponent()}
-      mainBranchName="main"
-      {...props}
-      onDone={jest.fn()}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/Gradle-test.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/Gradle-test.tsx
deleted file mode 100644 (file)
index 9b587d7..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import Gradle, { GradleProps } from '../Gradle';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-  expect(shallowRender({ branchesEnabled: false })).toMatchSnapshot('without branch enabled');
-});
-
-function shallowRender(props: Partial<GradleProps> = {}) {
-  return shallow<GradleProps>(
-    <Gradle
-      branchesEnabled={true}
-      component={mockComponent()}
-      mainBranchName="main"
-      onDone={jest.fn()}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/JavaMaven-test.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/JavaMaven-test.tsx
deleted file mode 100644 (file)
index a3fbb2a..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import JavaMaven, { JavaMavenProps } from '../../commands/JavaMaven';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-  expect(shallowRender({ branchesEnabled: false })).toMatchSnapshot('without branch enabled');
-});
-
-function shallowRender(props: Partial<JavaMavenProps> = {}) {
-  return shallow<JavaMavenProps>(
-    <JavaMaven
-      branchesEnabled={true}
-      component={mockComponent()}
-      mainBranchName="main"
-      onDone={jest.fn()}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/Others-test.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/Others-test.tsx
deleted file mode 100644 (file)
index efc223b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import Others, { OthersProps } from '../../commands/Others';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-  expect(shallowRender({ branchesEnabled: false })).toMatchSnapshot('without branch enabled');
-});
-
-function shallowRender(props: Partial<OthersProps> = {}) {
-  return shallow<OthersProps>(
-    <Others
-      branchesEnabled={true}
-      component={mockComponent()}
-      mainBranchName="main"
-      onDone={jest.fn()}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/CFamily-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/CFamily-test.tsx.snap
deleted file mode 100644 (file)
index d431922..0000000
+++ /dev/null
@@ -1,362 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<Fragment>
-  <DefaultProjectKey
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <li
-    className="abs-width-600"
-  >
-    <span>
-      onboarding.build.other.os
-    </span>
-    <RenderOptions
-      label="onboarding.build.other.os"
-      onCheck={[Function]}
-      optionLabelKey="onboarding.build.other.os"
-      options={
-        [
-          "linux",
-          "win",
-          "mac",
-        ]
-      }
-    />
-  </li>
-</Fragment>
-`;
-
-exports[`should render correctly for linux: branches disabled 1`] = `
-<Fragment>
-  <DefaultProjectKey
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <li
-    className="abs-width-600"
-  >
-    <span>
-      onboarding.build.other.os
-    </span>
-    <RenderOptions
-      checked="linux"
-      label="onboarding.build.other.os"
-      onCheck={[Function]}
-      optionLabelKey="onboarding.build.other.os"
-      options={
-        [
-          "linux",
-          "win",
-          "mac",
-        ]
-      }
-    />
-    <GithubCFamilyExampleRepositories
-      ci="github-actions"
-      className="big-spacer-top"
-      os="linux"
-    />
-  </li>
-  <CreateYmlFile
-    yamlFileName=".github/workflows/build.yml"
-    yamlTemplate="name: Build
-
-on:
-  push:
-    branches:
-      - main
-
-
-jobs:
-  build:
-    name: Build
-    runs-on: <image ready for your build toolchain>
-    steps:
-      - uses: actions/checkout@v2
-        with:
-          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
-      - name: Download and install the build wrapper, build the project
-        run: |
-          mkdir $HOME/.sonar
-          curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \${{ secrets.SONAR_HOST_URL }}/static/cpp/build-wrapper-linux-x86.zip
-          unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
-          $HOME/.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command>
-        env:
-          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
-
-      - name: Download and install the SonarScanner
-        env:
-          SONAR_SCANNER_VERSION: 4.6.2.2472
-        run: |
-          curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${{ env.SONAR_SCANNER_VERSION }}-linux.zip
-          unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
-          echo "$HOME/.sonar/sonar-scanner-\${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH
-
-      - name: SonarQube analysis
-        run: |
-          sonar-scanner --define sonar.cfamily.build-wrapper-output=bw-output  
-        env:
-          SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
-          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}"
-  />
-  <CompilationInfo
-    className="abs-width-800"
-  />
-  <FinishButton
-    onClick={[MockFunction]}
-  />
-</Fragment>
-`;
-
-exports[`should render correctly for mac: branches enabled 1`] = `
-<Fragment>
-  <DefaultProjectKey
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <li
-    className="abs-width-600"
-  >
-    <span>
-      onboarding.build.other.os
-    </span>
-    <RenderOptions
-      checked="mac"
-      label="onboarding.build.other.os"
-      onCheck={[Function]}
-      optionLabelKey="onboarding.build.other.os"
-      options={
-        [
-          "linux",
-          "win",
-          "mac",
-        ]
-      }
-    />
-    <GithubCFamilyExampleRepositories
-      ci="github-actions"
-      className="big-spacer-top"
-      os="mac"
-    />
-  </li>
-  <CreateYmlFile
-    yamlFileName=".github/workflows/build.yml"
-    yamlTemplate="name: Build
-
-on:
-  push:
-    branches:
-      - main
-  pull_request:
-    types: [opened, synchronize, reopened]
-
-jobs:
-  build:
-    name: Build
-    runs-on: <image ready for your build toolchain>
-    steps:
-      - uses: actions/checkout@v2
-        with:
-          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
-      - name: Download and install the build wrapper
-        run: |
-          mkdir $HOME/.sonar
-          curl -sSLo $HOME/.sonar/build-wrapper-macosx-x86.zip \${{ secrets.SONAR_HOST_URL }}/static/cpp/build-wrapper-macosx-x86.zip
-          unzip -o $HOME/.sonar/build-wrapper-macosx-x86.zip -d $HOME/.sonar/
-        env:
-          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
-
-      - name: Download and install the SonarScanner
-        run: |
-          curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-macosx.zip
-          unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
-
-      - name: Build and analyse the project
-        run: |
-          # Potential improvement : add these paths to the PATH env var.
-          $HOME/.sonar/build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir bw-output <your clean build command>
-          $HOME/.sonar/sonar-scanner-4.6.2.2472-macosx/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output
-        env:
-          SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
-          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}"
-  />
-  <CompilationInfo
-    className="abs-width-800"
-  />
-  <FinishButton
-    onClick={[MockFunction]}
-  />
-</Fragment>
-`;
-
-exports[`should render correctly for win: branches enabled 1`] = `
-<Fragment>
-  <DefaultProjectKey
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <li
-    className="abs-width-600"
-  >
-    <span>
-      onboarding.build.other.os
-    </span>
-    <RenderOptions
-      checked="win"
-      label="onboarding.build.other.os"
-      onCheck={[Function]}
-      optionLabelKey="onboarding.build.other.os"
-      options={
-        [
-          "linux",
-          "win",
-          "mac",
-        ]
-      }
-    />
-    <GithubCFamilyExampleRepositories
-      ci="github-actions"
-      className="big-spacer-top"
-      os="win"
-    />
-  </li>
-  <CreateYmlFile
-    yamlFileName=".github/workflows/build.yml"
-    yamlTemplate="name: Build
-
-on:
-  push:
-    branches:
-      - main
-  pull_request:
-    types: [opened, synchronize, reopened]
-
-jobs:
-  build:
-    name: Build
-    runs-on: <image ready for your build toolchain>
-    steps:
-      - uses: actions/checkout@v2
-        with:
-          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
-      - name: Download and install the build wrapper
-        shell: powershell
-        run: |
-          $path = "$HOME/.sonar/build-wrapper-win-x86.zip"
-          mkdir $HOME/.sonar
-          [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
-          (New-Object System.Net.WebClient).DownloadFile("\${{ secrets.SONAR_HOST_URL }}/static/cpp/build-wrapper-win-x86.zip", $path)
-          Add-Type -AssemblyName System.IO.Compression.FileSystem
-          [System.IO.Compression.ZipFile]::ExtractToDirectory($path, "$HOME/.sonar")
-        env:
-          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
-
-      - name: Download and install the SonarScanner
-        shell: powershell
-        run: |
-          $path = "$HOME/.sonar/sonar-scanner-cli-4.6.2.2472-windows.zip"
-          [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
-          (New-Object System.Net.WebClient).DownloadFile("https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-windows.zip", $path)
-          Add-Type -AssemblyName System.IO.Compression.FileSystem
-          [System.IO.Compression.ZipFile]::ExtractToDirectory($path, "$HOME/.sonar")
-
-      - name: Build and analyse the project
-        shell: powershell
-        run: |
-          $env:Path += ";$HOME/.sonar/build-wrapper-win-x86;$HOME/.sonar/sonar-scanner-4.6.2.2472-windows/bin"
-          build-wrapper-win-x86-64 --out-dir bw-output <your clean build command>
-          sonar-scanner.bat "-Dsonar.cfamily.build-wrapper-output=bw-output"
-        env:
-          SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
-          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}"
-  />
-  <CompilationInfo
-    className="abs-width-800"
-  />
-  <FinishButton
-    onClick={[MockFunction]}
-  />
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/DotNet-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/DotNet-test.tsx.snap
deleted file mode 100644 (file)
index ae9060f..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<Fragment>
-  <CreateYmlFile
-    yamlFileName=".github/workflows/build.yml"
-    yamlTemplate="name: Build
-
-on:
-  push:
-    branches:
-      - main
-  pull_request:
-    types: [opened, synchronize, reopened]
-
-jobs:
-  build:
-    name: Build
-    runs-on: windows-latest
-    steps:
-      - uses: actions/checkout@v2
-        with:
-          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
-      - name: Set up JDK 11
-        uses: actions/setup-java@v1
-        with:
-          java-version: 1.11
-      - name: Cache SonarQube packages
-        uses: actions/cache@v1
-        with:
-          path: ~\\sonar\\cache
-          key: \${{ runner.os }}-sonar
-          restore-keys: \${{ runner.os }}-sonar
-      - name: Cache SonarQube scanner
-        id: cache-sonar-scanner
-        uses: actions/cache@v1
-        with:
-          path: .\\.sonar\\scanner
-          key: \${{ runner.os }}-sonar-scanner
-          restore-keys: \${{ runner.os }}-sonar-scanner
-      - name: Install SonarQube scanner
-        if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
-        shell: powershell
-        run: |
-          New-Item -Path .\\.sonar\\scanner -ItemType Directory
-          dotnet tool update dotnet-sonarscanner --tool-path .\\.sonar\\scanner
-      - name: Build and analyze
-        env:
-          GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
-        shell: powershell
-        run: |
-          .\\.sonar\\scanner\\dotnet-sonarscanner begin /k:"my-project" /d:sonar.login="\${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="\${{ secrets.SONAR_HOST_URL }}"
-          dotnet build
-          .\\.sonar\\scanner\\dotnet-sonarscanner end /d:sonar.login="\${{ secrets.SONAR_TOKEN }}""
-  />
-  <FinishButton
-    onClick={[MockFunction]}
-  />
-</Fragment>
-`;
-
-exports[`should render correctly: without branch enabled 1`] = `
-<Fragment>
-  <CreateYmlFile
-    yamlFileName=".github/workflows/build.yml"
-    yamlTemplate="name: Build
-
-on:
-  push:
-    branches:
-      - main
-
-
-jobs:
-  build:
-    name: Build
-    runs-on: windows-latest
-    steps:
-      - uses: actions/checkout@v2
-        with:
-          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
-      - name: Set up JDK 11
-        uses: actions/setup-java@v1
-        with:
-          java-version: 1.11
-      - name: Cache SonarQube packages
-        uses: actions/cache@v1
-        with:
-          path: ~\\sonar\\cache
-          key: \${{ runner.os }}-sonar
-          restore-keys: \${{ runner.os }}-sonar
-      - name: Cache SonarQube scanner
-        id: cache-sonar-scanner
-        uses: actions/cache@v1
-        with:
-          path: .\\.sonar\\scanner
-          key: \${{ runner.os }}-sonar-scanner
-          restore-keys: \${{ runner.os }}-sonar-scanner
-      - name: Install SonarQube scanner
-        if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
-        shell: powershell
-        run: |
-          New-Item -Path .\\.sonar\\scanner -ItemType Directory
-          dotnet tool update dotnet-sonarscanner --tool-path .\\.sonar\\scanner
-      - name: Build and analyze
-        env:
-          GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
-        shell: powershell
-        run: |
-          .\\.sonar\\scanner\\dotnet-sonarscanner begin /k:"my-project" /d:sonar.login="\${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="\${{ secrets.SONAR_HOST_URL }}"
-          dotnet build
-          .\\.sonar\\scanner\\dotnet-sonarscanner end /d:sonar.login="\${{ secrets.SONAR_TOKEN }}""
-  />
-  <FinishButton
-    onClick={[MockFunction]}
-  />
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/Gradle-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/Gradle-test.tsx.snap
deleted file mode 100644 (file)
index c57af2d..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<Fragment>
-  <li
-    className="abs-width-600"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.yaml.gradle"
-      id="onboarding.tutorial.with.yaml.gradle"
-      values={
-        {
-          "gradle": <React.Fragment>
-            <code
-              className="rule"
-            >
-              build.gradle
-            </code>
-            <ClipboardIconButton
-              copyValue="build.gradle"
-            />
-          </React.Fragment>,
-          "sq": <code
-            className="rule"
-          >
-            org.sonarqube
-          </code>,
-        }
-      }
-    />
-    <CodeSnippet
-      snippet="plugins {
-  id "org.sonarqube" version "3.5.0.2730"
-}
-
-sonar {
-  properties {
-    property "sonar.projectKey", "my-project"
-    property "sonar.projectName", "MyProject"
-  }
-}"
-    />
-  </li>
-  <CreateYmlFile
-    yamlFileName=".github/workflows/build.yml"
-    yamlTemplate="name: Build
-
-on:
-  push:
-    branches:
-      - main
-  pull_request:
-    types: [opened, synchronize, reopened]
-
-jobs:
-  build:
-    name: Build
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v2
-        with:
-          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
-      - name: Set up JDK 11
-        uses: actions/setup-java@v1
-        with:
-          java-version: 11
-      - name: Cache SonarQube packages
-        uses: actions/cache@v1
-        with:
-          path: ~/.sonar/cache
-          key: \${{ runner.os }}-sonar
-          restore-keys: \${{ runner.os }}-sonar
-      - name: Cache Gradle packages
-        uses: actions/cache@v1
-        with:
-          path: ~/.gradle/caches
-          key: \${{ runner.os }}-gradle-\${{ hashFiles('**/*.gradle') }}
-          restore-keys: \${{ runner.os }}-gradle
-      - name: Build and analyze
-        env:
-          GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
-          SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
-          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
-        run: ./gradlew build sonar --info"
-  />
-  <FinishButton
-    onClick={[MockFunction]}
-  />
-</Fragment>
-`;
-
-exports[`should render correctly: without branch enabled 1`] = `
-<Fragment>
-  <li
-    className="abs-width-600"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.yaml.gradle"
-      id="onboarding.tutorial.with.yaml.gradle"
-      values={
-        {
-          "gradle": <React.Fragment>
-            <code
-              className="rule"
-            >
-              build.gradle
-            </code>
-            <ClipboardIconButton
-              copyValue="build.gradle"
-            />
-          </React.Fragment>,
-          "sq": <code
-            className="rule"
-          >
-            org.sonarqube
-          </code>,
-        }
-      }
-    />
-    <CodeSnippet
-      snippet="plugins {
-  id "org.sonarqube" version "3.5.0.2730"
-}
-
-sonar {
-  properties {
-    property "sonar.projectKey", "my-project"
-    property "sonar.projectName", "MyProject"
-  }
-}"
-    />
-  </li>
-  <CreateYmlFile
-    yamlFileName=".github/workflows/build.yml"
-    yamlTemplate="name: Build
-
-on:
-  push:
-    branches:
-      - main
-
-
-jobs:
-  build:
-    name: Build
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v2
-        with:
-          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
-      - name: Set up JDK 11
-        uses: actions/setup-java@v1
-        with:
-          java-version: 11
-      - name: Cache SonarQube packages
-        uses: actions/cache@v1
-        with:
-          path: ~/.sonar/cache
-          key: \${{ runner.os }}-sonar
-          restore-keys: \${{ runner.os }}-sonar
-      - name: Cache Gradle packages
-        uses: actions/cache@v1
-        with:
-          path: ~/.gradle/caches
-          key: \${{ runner.os }}-gradle-\${{ hashFiles('**/*.gradle') }}
-          restore-keys: \${{ runner.os }}-gradle
-      - name: Build and analyze
-        env:
-          GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
-          SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
-          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
-        run: ./gradlew build sonar --info"
-  />
-  <FinishButton
-    onClick={[MockFunction]}
-  />
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/JavaMaven-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/JavaMaven-test.tsx.snap
deleted file mode 100644 (file)
index 4b5b2b2..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<Fragment>
-  <CreateYmlFile
-    yamlFileName=".github/workflows/build.yml"
-    yamlTemplate="name: Build
-
-on:
-  push:
-    branches:
-      - main
-  pull_request:
-    types: [opened, synchronize, reopened]
-
-jobs:
-  build:
-    name: Build
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v2
-        with:
-          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
-      - name: Set up JDK 11
-        uses: actions/setup-java@v1
-        with:
-          java-version: 11
-      - name: Cache SonarQube packages
-        uses: actions/cache@v1
-        with:
-          path: ~/.sonar/cache
-          key: \${{ runner.os }}-sonar
-          restore-keys: \${{ runner.os }}-sonar
-      - name: Cache Maven packages
-        uses: actions/cache@v1
-        with:
-          path: ~/.m2
-          key: \${{ runner.os }}-m2-\${{ hashFiles('**/pom.xml') }}
-          restore-keys: \${{ runner.os }}-m2
-      - name: Build and analyze
-        env:
-          GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
-          SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
-          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
-        run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'"
-  />
-  <FinishButton
-    onClick={[MockFunction]}
-  />
-</Fragment>
-`;
-
-exports[`should render correctly: without branch enabled 1`] = `
-<Fragment>
-  <CreateYmlFile
-    yamlFileName=".github/workflows/build.yml"
-    yamlTemplate="name: Build
-
-on:
-  push:
-    branches:
-      - main
-
-
-jobs:
-  build:
-    name: Build
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v2
-        with:
-          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
-      - name: Set up JDK 11
-        uses: actions/setup-java@v1
-        with:
-          java-version: 11
-      - name: Cache SonarQube packages
-        uses: actions/cache@v1
-        with:
-          path: ~/.sonar/cache
-          key: \${{ runner.os }}-sonar
-          restore-keys: \${{ runner.os }}-sonar
-      - name: Cache Maven packages
-        uses: actions/cache@v1
-        with:
-          path: ~/.m2
-          key: \${{ runner.os }}-m2-\${{ hashFiles('**/pom.xml') }}
-          restore-keys: \${{ runner.os }}-m2
-      - name: Build and analyze
-        env:
-          GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
-          SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
-          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
-        run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'"
-  />
-  <FinishButton
-    onClick={[MockFunction]}
-  />
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/Others-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/__tests__/__snapshots__/Others-test.tsx.snap
deleted file mode 100644 (file)
index ef6da91..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<Fragment>
-  <DefaultProjectKey
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <CreateYmlFile
-    yamlFileName=".github/workflows/build.yml"
-    yamlTemplate="name: Build
-
-on:
-  push:
-    branches:
-      - main
-  pull_request:
-    types: [opened, synchronize, reopened]
-
-jobs:
-  build:
-    name: Build
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v2
-        with:
-          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
-      - uses: sonarsource/sonarqube-scan-action@master
-        env:
-          SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
-          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
-      # If you wish to fail your job when the Quality Gate is red, uncomment the
-      # following lines. This would typically be used to fail a deployment.
-      # We do not recommend to use this in a pull request. Prefer using pull request
-      # decoration instead.
-      # - uses: sonarsource/sonarqube-quality-gate-action@master
-      #   timeout-minutes: 5
-      #   env:
-      #     SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}"
-  />
-  <FinishButton
-    onClick={[MockFunction]}
-  />
-</Fragment>
-`;
-
-exports[`should render correctly: without branch enabled 1`] = `
-<Fragment>
-  <DefaultProjectKey
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <CreateYmlFile
-    yamlFileName=".github/workflows/build.yml"
-    yamlTemplate="name: Build
-
-on:
-  push:
-    branches:
-      - main
-
-
-jobs:
-  build:
-    name: Build
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v2
-        with:
-          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
-      - uses: sonarsource/sonarqube-scan-action@master
-        env:
-          SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}
-          SONAR_HOST_URL: \${{ secrets.SONAR_HOST_URL }}
-      # If you wish to fail your job when the Quality Gate is red, uncomment the
-      # following lines. This would typically be used to fail a deployment.
-      # - uses: sonarsource/sonarqube-quality-gate-action@master
-      #   timeout-minutes: 5
-      #   env:
-      #     SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }}"
-  />
-  <FinishButton
-    onClick={[MockFunction]}
-  />
-</Fragment>
-`;
index 779f066ac577868b17d05da262f54ade468d8aa9..4c0f3fa42cb89ea82f15dd890d7ac69554713f49 100644 (file)
@@ -38,7 +38,7 @@ export interface EnvironmentVariablesStepProps {
 }
 
 const pipelineDescriptionLinkLabel = translate(
-  'onboarding.tutorial.with.gitlab_ci.env_variables.description.link'
+  'onboarding.tutorial.with.gitlab_ci.variables.description.link'
 );
 
 export default function EnvironmentVariablesStep(props: EnvironmentVariablesStepProps) {
@@ -51,14 +51,14 @@ export default function EnvironmentVariablesStep(props: EnvironmentVariablesStep
       <ol className="list-styled">
         <li>
           <p className="big-spacer-bottom">
-            {translate('onboarding.tutorial.with.gitlab_ci.env_variables.section.title')}
+            {translate('onboarding.tutorial.with.gitlab_ci.variables.section.title')}
           </p>
 
           <FormattedMessage
             defaultMessage={translate(
-              'onboarding.tutorial.with.gitlab_ci.env_variables.section.description'
+              'onboarding.tutorial.with.gitlab_ci.variables.section.description'
             )}
-            id="onboarding.tutorial.with.gitlab_ci.env_variables.section.description"
+            id="onboarding.tutorial.with.gitlab_ci.variables.section.description"
             values={{
               /* This link will be added when the backend provides the project URL */
               link: <strong>{pipelineDescriptionLinkLabel}</strong>,
@@ -69,12 +69,12 @@ export default function EnvironmentVariablesStep(props: EnvironmentVariablesStep
             <li className="big-spacer-bottom">
               <FormattedMessage
                 defaultMessage={fieldValueTranslation}
-                id="onboarding.tutorial.with.gitlab_ci.env_variables.step1"
+                id="onboarding.tutorial.with.gitlab_ci.variables.step1"
                 values={{
                   extra: <ClipboardIconButton copyValue="SONAR_TOKEN" />,
                   field: (
                     <strong>
-                      {translate('onboarding.tutorial.with.gitlab_ci.env_variables.step1')}
+                      {translate('onboarding.tutorial.with.gitlab_ci.variables.step1')}
                     </strong>
                   ),
                   value: <code className="rule">SONAR_TOKEN</code>,
@@ -84,12 +84,12 @@ export default function EnvironmentVariablesStep(props: EnvironmentVariablesStep
             <TokenStepGenerator component={component} currentUser={currentUser} />
             <li className="big-spacer-bottom">
               <FormattedMessage
-                defaultMessage={translate('onboarding.tutorial.with.gitlab_ci.env_variables.step3')}
-                id="onboarding.tutorial.with.gitlab_ci.env_variables.step3"
+                defaultMessage={translate('onboarding.tutorial.with.gitlab_ci.variables.step3')}
+                id="onboarding.tutorial.with.gitlab_ci.variables.step3"
                 values={{
                   value: (
                     <strong>
-                      {translate('onboarding.tutorial.with.gitlab_ci.env_variables.step3.value')}
+                      {translate('onboarding.tutorial.with.gitlab_ci.variables.step3.value')}
                     </strong>
                   ),
                 }}
@@ -98,14 +98,14 @@ export default function EnvironmentVariablesStep(props: EnvironmentVariablesStep
             <li className="big-spacer-bottom">
               <FormattedMessage
                 defaultMessage={translate(
-                  'onboarding.tutorial.with.gitlab_ci.env_variables.section.step4'
+                  'onboarding.tutorial.with.gitlab_ci.variables.section.step4'
                 )}
-                id="onboarding.tutorial.with.gitlab_ci.env_variables.section.step4"
+                id="onboarding.tutorial.with.gitlab_ci.variables.section.step4"
                 values={{
                   value: (
                     <strong>
                       {translate(
-                        'onboarding.tutorial.with.gitlab_ci.env_variables.section.step4.value'
+                        'onboarding.tutorial.with.gitlab_ci.variables.section.step4.value'
                       )}
                     </strong>
                   ),
@@ -117,14 +117,14 @@ export default function EnvironmentVariablesStep(props: EnvironmentVariablesStep
         </li>
         <li>
           <p className="big-spacer-bottom big-spacer-top">
-            {translate('onboarding.tutorial.with.gitlab_ci.env_variables.section2.title')}
+            {translate('onboarding.tutorial.with.gitlab_ci.variables.section2.title')}
           </p>
 
           <FormattedMessage
             defaultMessage={translate(
-              'onboarding.tutorial.with.gitlab_ci.env_variables.section2.description'
+              'onboarding.tutorial.with.gitlab_ci.variables.section2.description'
             )}
-            id="onboarding.tutorial.with.gitlab_ci.env_variables.section2.description"
+            id="onboarding.tutorial.with.gitlab_ci.variables.section2.description"
             values={{
               /* This link will be added when the backend provides the project URL */
               link: <strong>{pipelineDescriptionLinkLabel}</strong>,
@@ -135,12 +135,12 @@ export default function EnvironmentVariablesStep(props: EnvironmentVariablesStep
             <li className="big-spacer-bottom">
               <FormattedMessage
                 defaultMessage={fieldValueTranslation}
-                id="onboarding.tutorial.with.gitlab_ci.env_variables.step1"
+                id="onboarding.tutorial.with.gitlab_ci.variables.step1"
                 values={{
                   extra: <ClipboardIconButton copyValue="SONAR_HOST_URL" />,
                   field: (
                     <strong>
-                      {translate('onboarding.tutorial.with.gitlab_ci.env_variables.step1')}
+                      {translate('onboarding.tutorial.with.gitlab_ci.variables.step1')}
                     </strong>
                   ),
                   value: <code className="rule">SONAR_HOST_URL</code>,
@@ -150,7 +150,7 @@ export default function EnvironmentVariablesStep(props: EnvironmentVariablesStep
             <li className="big-spacer-bottom">
               <FormattedMessage
                 defaultMessage={fieldValueTranslation}
-                id="onboarding.tutorial.with.gitlab_ci.env_variables.step2"
+                id="onboarding.tutorial.with.gitlab_ci.variables.step2"
                 values={{
                   extra: <ClipboardIconButton copyValue={baseUrl} />,
                   field: <strong>{translate('onboarding.tutorial.env_variables.field')}</strong>,
@@ -160,12 +160,12 @@ export default function EnvironmentVariablesStep(props: EnvironmentVariablesStep
             </li>
             <li className="big-spacer-bottom">
               <FormattedMessage
-                defaultMessage={translate('onboarding.tutorial.with.gitlab_ci.env_variables.step3')}
-                id="onboarding.tutorial.with.gitlab_ci.env_variables.step3"
+                defaultMessage={translate('onboarding.tutorial.with.gitlab_ci.variables.step3')}
+                id="onboarding.tutorial.with.gitlab_ci.variables.step3"
                 values={{
                   value: (
                     <strong>
-                      {translate('onboarding.tutorial.with.gitlab_ci.env_variables.step3.value')}
+                      {translate('onboarding.tutorial.with.gitlab_ci.variables.step3.value')}
                     </strong>
                   ),
                 }}
@@ -174,14 +174,14 @@ export default function EnvironmentVariablesStep(props: EnvironmentVariablesStep
             <li className="big-spacer-bottom">
               <FormattedMessage
                 defaultMessage={translate(
-                  'onboarding.tutorial.with.gitlab_ci.env_variables.section2.step4'
+                  'onboarding.tutorial.with.gitlab_ci.variables.section2.step4'
                 )}
-                id="onboarding.tutorial.with.gitlab_ci.env_variables.section2.step4"
+                id="onboarding.tutorial.with.gitlab_ci.variables.section2.step4"
                 values={{
                   value: (
                     <strong>
                       {translate(
-                        'onboarding.tutorial.with.gitlab_ci.env_variables.section.step4.value'
+                        'onboarding.tutorial.with.gitlab_ci.variables.section.step4.value'
                       )}
                     </strong>
                   ),
@@ -205,7 +205,7 @@ export default function EnvironmentVariablesStep(props: EnvironmentVariablesStep
       open={open}
       renderForm={renderForm}
       stepNumber={1}
-      stepTitle={translate('onboarding.tutorial.with.gitlab_ci.env_variables.title')}
+      stepTitle={translate('onboarding.tutorial.with.gitlab_ci.variables.title')}
     />
   );
 }
index e66962d295ca631ccae2a0e9027b72fb3b0cbd11..ea255c15c0fcdb8dde12ea3ca626b855bf56c475 100644 (file)
@@ -137,17 +137,17 @@ export function YmlFileStep(props: YmlFileStepProps) {
           <li className="abs-width-600">
             <div className="big-spacer-bottom">
               <FormattedMessage
-                defaultMessage={translate('onboarding.tutorial.with.gitlab_ci.yml.description')}
-                id="onboarding.tutorial.with.gitlab_ci.yml.description"
+                defaultMessage={translate('onboarding.tutorial.with.gitlab_ci.yaml.description')}
+                id="onboarding.tutorial.with.gitlab_ci.yaml.description"
                 values={{
                   filename: (
                     <>
                       <code className="rule">
-                        {translate('onboarding.tutorial.with.gitlab_ci.yml.filename')}
+                        {translate('onboarding.tutorial.with.gitlab_ci.yaml.filename')}
                       </code>
                       <ClipboardIconButton
                         className="little-spacer-left"
-                        copyValue={translate('onboarding.tutorial.with.gitlab_ci.yml.filename')}
+                        copyValue={translate('onboarding.tutorial.with.gitlab_ci.yaml.filename')}
                       />
                     </>
                   ),
@@ -165,10 +165,10 @@ export function YmlFileStep(props: YmlFileStepProps) {
             </div>
             <p className="little-spacer-bottom">
               {branchSupportEnabled
-                ? translate('onboarding.tutorial.with.gitlab_ci.yml.baseconfig')
-                : translate('onboarding.tutorial.with.gitlab_ci.yml.baseconfig.no_branches')}
+                ? translate('onboarding.tutorial.with.gitlab_ci.yaml.baseconfig')
+                : translate('onboarding.tutorial.with.gitlab_ci.yaml.baseconfig.no_branches')}
             </p>
-            <p>{translate('onboarding.tutorial.with.gitlab_ci.yml.existing')}</p>
+            <p>{translate('onboarding.tutorial.with.gitlab_ci.yaml.existing')}</p>
             <FinishButton onClick={props.onDone} />
           </li>
         )}
@@ -183,7 +183,7 @@ export function YmlFileStep(props: YmlFileStepProps) {
       open={open}
       renderForm={renderForm}
       stepNumber={2}
-      stepTitle={translate('onboarding.tutorial.with.gitlab_ci.yml.title')}
+      stepTitle={translate('onboarding.tutorial.with.gitlab_ci.yaml.title')}
     />
   );
 }
diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/EnvironmentVariablesStep-test.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/EnvironmentVariablesStep-test.tsx
deleted file mode 100644 (file)
index 90df517..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../helpers/mocks/component';
-import { mockLoggedInUser } from '../../../../helpers/testMocks';
-import { renderStepContent } from '../../test-utils';
-import EnvironmentVariablesStep, {
-  EnvironmentVariablesStepProps,
-} from '../EnvironmentVariablesStep';
-
-it('should render correctly', () => {
-  const wrapper = shallowRender();
-  expect(wrapper).toMatchSnapshot('Step wrapper');
-  expect(renderStepContent(wrapper)).toMatchSnapshot('initial content');
-});
-
-function shallowRender(props: Partial<EnvironmentVariablesStepProps> = {}) {
-  return shallow<EnvironmentVariablesStepProps>(
-    <EnvironmentVariablesStep
-      baseUrl="http://localhost:9000"
-      currentUser={mockLoggedInUser()}
-      component={mockComponent()}
-      finished={false}
-      onDone={jest.fn()}
-      onOpen={jest.fn()}
-      open={true}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/GitLabCITutorial-it.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/GitLabCITutorial-it.tsx
new file mode 100644 (file)
index 0000000..d251382
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2023 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * 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 selectEvent from 'react-select-event';
+import UserTokensMock from '../../../../api/mocks/UserTokensMock';
+import { mockComponent } from '../../../../helpers/mocks/component';
+import { mockLanguage, mockLoggedInUser } from '../../../../helpers/testMocks';
+import { renderApp, RenderContext } from '../../../../helpers/testReactTestingUtils';
+import {
+  getCommonNodes,
+  getCopyToClipboardValue,
+  getTutorialActionButtons,
+  getTutorialBuildButtons,
+} from '../../test-utils';
+import { TutorialModes } from '../../types';
+import GitLabCITutorial, { GitLabCITutorialProps } from '../GitLabCITutorial';
+
+jest.mock('../../../../api/user-tokens');
+
+jest.mock('../../../../api/settings', () => ({
+  getAllValues: jest.fn().mockResolvedValue([]),
+}));
+
+const tokenMock = new UserTokensMock();
+
+afterEach(() => {
+  tokenMock.reset();
+});
+
+const ui = {
+  ...getCommonNodes(TutorialModes.GitLabCI),
+  ...getTutorialActionButtons(),
+  ...getTutorialBuildButtons(),
+};
+
+it('should follow and complete all steps', async () => {
+  const user = userEvent.setup();
+  renderGitLabTutorial();
+
+  expect(await ui.secretsStepTitle.find()).toBeInTheDocument();
+
+  // Env variables step
+  expect(getCopyToClipboardValue()).toMatchSnapshot('sonar token key');
+  expect(getCopyToClipboardValue(1)).toMatchSnapshot('sonarqube host url key');
+  expect(getCopyToClipboardValue(2)).toMatchSnapshot('sonarqube host url value');
+  await user.click(ui.continueButton.get());
+
+  // Create/update configuration file step
+  // Maven
+  await user.click(ui.mavenBuildButton.get());
+  expect(getCopyToClipboardValue(1)).toMatchSnapshot('Maven: pom.xml');
+  expect(getCopyToClipboardValue(3)).toMatchSnapshot('Maven: gitlab-ci.yml');
+
+  // Gradle
+  await user.click(ui.gradleBuildButton.get());
+  expect(getCopyToClipboardValue(1)).toMatchSnapshot('Gradle: build.gradle');
+  expect(getCopyToClipboardValue(3)).toMatchSnapshot('Gradle: gitlab-ci.yml');
+
+  // .NET
+  await user.click(ui.dotnetBuildButton.get());
+  expect(getCopyToClipboardValue(1)).toMatchSnapshot('.NET: gitlab-ci.yml');
+
+  // CFamily
+  await user.click(ui.cFamilyBuildButton.get());
+  expect(getCopyToClipboardValue(1)).toMatchSnapshot('CFamily: sonar-project.properties');
+  expect(getCopyToClipboardValue(3)).toMatchSnapshot('CFamily: gitlab-ci.yml');
+
+  // Other
+  await user.click(ui.otherBuildButton.get());
+  expect(getCopyToClipboardValue(1)).toMatchSnapshot('Other: sonar-project.properties');
+  expect(getCopyToClipboardValue(3)).toMatchSnapshot('Other: gitlab-ci.yml');
+
+  await user.click(ui.finishTutorialButton.get());
+  expect(ui.allSetSentence.get()).toBeInTheDocument();
+});
+
+it('should generate/delete a new token or use existing one', async () => {
+  const user = userEvent.setup();
+  renderGitLabTutorial();
+
+  expect(await ui.secretsStepTitle.find()).toBeInTheDocument();
+
+  // Generate token
+  await user.click(ui.genTokenDialogButton.get());
+  await user.click(ui.generateTokenButton.get());
+  expect(getCopyToClipboardValue(3)).toEqual('generatedtoken2');
+
+  // Revoke current token and create new one
+  await user.click(ui.deleteTokenButton.get());
+  await user.type(ui.tokenNameInput.get(), 'newtoken');
+  await selectEvent.select(ui.expiresInSelect.get(), 'users.tokens.expiration.365');
+  await user.click(ui.generateTokenButton.get());
+  expect(ui.tokenValue.get()).toBeInTheDocument();
+  await user.click(ui.continueButton.getAll()[1]);
+  expect(ui.tokenValue.query()).not.toBeInTheDocument();
+});
+
+it('navigates between steps', async () => {
+  const user = userEvent.setup();
+  renderGitLabTutorial();
+
+  await user.click(await ui.continueButton.find());
+  await user.click(ui.mavenBuildButton.get());
+  await user.click(ui.finishTutorialButton.get());
+  expect(ui.allSetSentence.get()).toBeInTheDocument();
+
+  await user.click(ui.ymlFileStepTitle.get());
+  expect(ui.finishTutorialButton.get()).toBeInTheDocument();
+  await user.click(ui.secretsStepTitle.get());
+  expect(ui.continueButton.get()).toBeInTheDocument();
+});
+
+function renderGitLabTutorial(
+  overrides: Partial<GitLabCITutorialProps> = {},
+  { languages = { c: mockLanguage({ key: 'c' }) } }: RenderContext = {}
+) {
+  return renderApp(
+    '/',
+    <GitLabCITutorial
+      baseUrl="http://localhost:9000"
+      mainBranchName="main"
+      component={mockComponent()}
+      currentUser={mockLoggedInUser()}
+      {...overrides}
+    />,
+    { languages }
+  );
+}
diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/GitLabCITutorial-test.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/GitLabCITutorial-test.tsx
deleted file mode 100644 (file)
index cc83a76..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../helpers/mocks/component';
-import { mockLoggedInUser } from '../../../../helpers/testMocks';
-import GitLabCITutorial, { GitLabCITutorialProps } from '../GitLabCITutorial';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-function shallowRender(props: Partial<GitLabCITutorialProps> = {}) {
-  return shallow<GitLabCITutorialProps>(
-    <GitLabCITutorial
-      baseUrl="http://localhost:9000"
-      component={mockComponent()}
-      currentUser={mockLoggedInUser()}
-      mainBranchName="main"
-      willRefreshAutomatically={true}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/YmlFileStep-test.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/YmlFileStep-test.tsx
deleted file mode 100644 (file)
index ecb14c2..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../helpers/mocks/component';
-import { renderStepContent } from '../../test-utils';
-import { YmlFileStep, YmlFileStepProps } from '../YmlFileStep';
-
-it('should render correctly', () => {
-  const wrapper = shallowRender();
-  expect(wrapper).toMatchSnapshot('Step wrapper');
-  expect(renderStepContent(wrapper)).toMatchSnapshot('initial content');
-});
-
-function shallowRender(props: Partial<YmlFileStepProps> = {}) {
-  return shallow<YmlFileStepProps>(
-    <YmlFileStep
-      hasCLanguageFeature={true}
-      component={mockComponent()}
-      hasFeature={jest.fn().mockReturnValue(true)}
-      open={true}
-      finished={true}
-      mainBranchName="main"
-      onDone={jest.fn()}
-      onOpen={jest.fn()}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/EnvironmentVariablesStep-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/EnvironmentVariablesStep-test.tsx.snap
deleted file mode 100644 (file)
index 0840eb1..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly: Step wrapper 1`] = `
-<Step
-  finished={false}
-  onOpen={[MockFunction]}
-  open={true}
-  renderForm={[Function]}
-  stepNumber={1}
-  stepTitle="onboarding.tutorial.with.gitlab_ci.env_variables.title"
-/>
-`;
-
-exports[`should render correctly: initial content 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <ol
-    className="list-styled"
-  >
-    <li>
-      <p
-        className="big-spacer-bottom"
-      >
-        onboarding.tutorial.with.gitlab_ci.env_variables.section.title
-      </p>
-      <FormattedMessage
-        defaultMessage="onboarding.tutorial.with.gitlab_ci.env_variables.section.description"
-        id="onboarding.tutorial.with.gitlab_ci.env_variables.section.description"
-        values={
-          {
-            "link": <strong>
-              onboarding.tutorial.with.gitlab_ci.env_variables.description.link
-            </strong>,
-          }
-        }
-      />
-      <ul
-        className="list-styled list-alpha big-spacer-top"
-      >
-        <li
-          className="big-spacer-bottom"
-        >
-          <FormattedMessage
-            defaultMessage="onboarding.tutorial.env_variables"
-            id="onboarding.tutorial.with.gitlab_ci.env_variables.step1"
-            values={
-              {
-                "extra": <ClipboardIconButton
-                  copyValue="SONAR_TOKEN"
-                />,
-                "field": <strong>
-                  onboarding.tutorial.with.gitlab_ci.env_variables.step1
-                </strong>,
-                "value": <code
-                  className="rule"
-                >
-                  SONAR_TOKEN
-                </code>,
-              }
-            }
-          />
-        </li>
-        <TokenStepGenerator
-          component={
-            {
-              "breadcrumbs": [],
-              "key": "my-project",
-              "name": "MyProject",
-              "qualifier": "TRK",
-              "qualityGate": {
-                "isDefault": true,
-                "key": "30",
-                "name": "Sonar way",
-              },
-              "qualityProfiles": [
-                {
-                  "deleted": false,
-                  "key": "my-qp",
-                  "language": "ts",
-                  "name": "Sonar way",
-                },
-              ],
-              "tags": [],
-            }
-          }
-          currentUser={
-            {
-              "dismissedNotices": {
-                "educationPrinciples": false,
-              },
-              "groups": [],
-              "isLoggedIn": true,
-              "login": "luke",
-              "name": "Skywalker",
-              "scmAccounts": [],
-            }
-          }
-        />
-        <li
-          className="big-spacer-bottom"
-        >
-          <FormattedMessage
-            defaultMessage="onboarding.tutorial.with.gitlab_ci.env_variables.step3"
-            id="onboarding.tutorial.with.gitlab_ci.env_variables.step3"
-            values={
-              {
-                "value": <strong>
-                  onboarding.tutorial.with.gitlab_ci.env_variables.step3.value
-                </strong>,
-              }
-            }
-          />
-        </li>
-        <li
-          className="big-spacer-bottom"
-        >
-          <FormattedMessage
-            defaultMessage="onboarding.tutorial.with.gitlab_ci.env_variables.section.step4"
-            id="onboarding.tutorial.with.gitlab_ci.env_variables.section.step4"
-            values={
-              {
-                "value": <strong>
-                  onboarding.tutorial.with.gitlab_ci.env_variables.section.step4.value
-                </strong>,
-              }
-            }
-          />
-        </li>
-      </ul>
-      <hr
-        className="no-horizontal-margins"
-      />
-    </li>
-    <li>
-      <p
-        className="big-spacer-bottom big-spacer-top"
-      >
-        onboarding.tutorial.with.gitlab_ci.env_variables.section2.title
-      </p>
-      <FormattedMessage
-        defaultMessage="onboarding.tutorial.with.gitlab_ci.env_variables.section2.description"
-        id="onboarding.tutorial.with.gitlab_ci.env_variables.section2.description"
-        values={
-          {
-            "link": <strong>
-              onboarding.tutorial.with.gitlab_ci.env_variables.description.link
-            </strong>,
-          }
-        }
-      />
-      <ul
-        className="list-styled list-alpha big-spacer-top big-spacer-bottom"
-      >
-        <li
-          className="big-spacer-bottom"
-        >
-          <FormattedMessage
-            defaultMessage="onboarding.tutorial.env_variables"
-            id="onboarding.tutorial.with.gitlab_ci.env_variables.step1"
-            values={
-              {
-                "extra": <ClipboardIconButton
-                  copyValue="SONAR_HOST_URL"
-                />,
-                "field": <strong>
-                  onboarding.tutorial.with.gitlab_ci.env_variables.step1
-                </strong>,
-                "value": <code
-                  className="rule"
-                >
-                  SONAR_HOST_URL
-                </code>,
-              }
-            }
-          />
-        </li>
-        <li
-          className="big-spacer-bottom"
-        >
-          <FormattedMessage
-            defaultMessage="onboarding.tutorial.env_variables"
-            id="onboarding.tutorial.with.gitlab_ci.env_variables.step2"
-            values={
-              {
-                "extra": <ClipboardIconButton
-                  copyValue="http://localhost:9000"
-                />,
-                "field": <strong>
-                  onboarding.tutorial.env_variables.field
-                </strong>,
-                "value": <code
-                  className="rule"
-                >
-                  http://localhost:9000
-                </code>,
-              }
-            }
-          />
-        </li>
-        <li
-          className="big-spacer-bottom"
-        >
-          <FormattedMessage
-            defaultMessage="onboarding.tutorial.with.gitlab_ci.env_variables.step3"
-            id="onboarding.tutorial.with.gitlab_ci.env_variables.step3"
-            values={
-              {
-                "value": <strong>
-                  onboarding.tutorial.with.gitlab_ci.env_variables.step3.value
-                </strong>,
-              }
-            }
-          />
-        </li>
-        <li
-          className="big-spacer-bottom"
-        >
-          <FormattedMessage
-            defaultMessage="onboarding.tutorial.with.gitlab_ci.env_variables.section2.step4"
-            id="onboarding.tutorial.with.gitlab_ci.env_variables.section2.step4"
-            values={
-              {
-                "value": <strong>
-                  onboarding.tutorial.with.gitlab_ci.env_variables.section.step4.value
-                </strong>,
-              }
-            }
-          />
-        </li>
-      </ul>
-      <Button
-        className="big-spacer-bottom"
-        onClick={[MockFunction]}
-      >
-        continue
-      </Button>
-    </li>
-  </ol>
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/GitLabCITutorial-it.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/GitLabCITutorial-it.tsx.snap
new file mode 100644 (file)
index 0000000..7768ee7
--- /dev/null
@@ -0,0 +1,151 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should follow and complete all steps: .NET: gitlab-ci.yml 1`] = `
+"sonarqube-check:
+  image: mcr.microsoft.com/dotnet/core/sdk:latest
+  variables:
+    SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar"  # Defines the location of the analysis task cache
+    GIT_DEPTH: "0"  # Tells git to fetch all the branches of the project, required by the analysis task
+  cache:
+    key: "\${CI_JOB_NAME}"
+    paths:
+      - .sonar/cache
+  script: 
+      - "apt-get update"
+      - "apt-get install --yes openjdk-11-jre"
+      - "dotnet tool install --global dotnet-sonarscanner"
+      - "export PATH=\\"$PATH:$HOME/.dotnet/tools\\""
+      - "dotnet sonarscanner begin /k:\\"my-project\\" /d:sonar.login=\\"$SONAR_TOKEN\\" /d:\\"sonar.host.url=$SONAR_HOST_URL\\" "
+      - "dotnet build"
+      - "dotnet sonarscanner end /d:sonar.login=\\"$SONAR_TOKEN\\""
+  allow_failure: true
+  rules:
+    - if: $CI_COMMIT_BRANCH == 'main'
+"
+`;
+
+exports[`should follow and complete all steps: CFamily: gitlab-ci.yml 1`] = `
+"image: <image ready for your build toolchain>
+
+cache:
+  paths:
+    - .sonar
+
+stages:
+  - download
+  - build
+  - scan
+
+download:
+  stage: download
+  script:
+      - mkdir -p .sonar
+      - curl -sSLo build-wrapper-linux-x86.zip  $SONAR_HOST_URL/static/cpp/build-wrapper-linux-x86.zip
+      - unzip -o build-wrapper-linux-x86.zip -d .sonar
+
+build:
+  stage: build
+  script:
+      - .sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir .sonar/bw-output <your clean build command>
+
+sonarqube-check:
+  stage: scan
+  script: 
+    - curl -sSLo sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-linux.zip
+    - unzip -o sonar-scanner.zip -d .sonar
+    - .sonar/sonar-scanner-4.6.2.2472-linux/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=.sonar/bw-output
+  allow_failure: true"
+`;
+
+exports[`should follow and complete all steps: CFamily: sonar-project.properties 1`] = `
+"sonar.projectKey=my-project
+sonar.qualitygate.wait=true
+"
+`;
+
+exports[`should follow and complete all steps: Gradle: build.gradle 1`] = `
+"plugins {
+  id "org.sonarqube" version "3.5.0.2730"
+}
+
+sonar {
+  properties {
+    property "sonar.projectKey", "my-project"
+    property "sonar.projectName", "MyProject"
+    property "sonar.qualitygate.wait", true 
+  }
+}"
+`;
+
+exports[`should follow and complete all steps: Gradle: gitlab-ci.yml 1`] = `
+"sonarqube-check:
+  image: gradle:jre11-slim
+  variables:
+    SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar"  # Defines the location of the analysis task cache
+    GIT_DEPTH: "0"  # Tells git to fetch all the branches of the project, required by the analysis task
+  cache:
+    key: "\${CI_JOB_NAME}"
+    paths:
+      - .sonar/cache
+  script: gradle sonar
+  allow_failure: true
+  rules:
+    - if: $CI_COMMIT_BRANCH == 'main'
+"
+`;
+
+exports[`should follow and complete all steps: Maven: gitlab-ci.yml 1`] = `
+"sonarqube-check:
+  image: maven:3.6.3-jdk-11
+  variables:
+    SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar"  # Defines the location of the analysis task cache
+    GIT_DEPTH: "0"  # Tells git to fetch all the branches of the project, required by the analysis task
+  cache:
+    key: "\${CI_JOB_NAME}"
+    paths:
+      - .sonar/cache
+  script: 
+    - mvn verify sonar:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'
+  allow_failure: true
+  rules:
+    - if: $CI_COMMIT_BRANCH == 'main'
+"
+`;
+
+exports[`should follow and complete all steps: Maven: pom.xml 1`] = `
+"<properties>
+  <sonar.qualitygate.wait>true</sonar.qualitygate.wait>
+</properties>"
+`;
+
+exports[`should follow and complete all steps: Other: gitlab-ci.yml 1`] = `
+"sonarqube-check:
+  image: 
+    name: sonarsource/sonar-scanner-cli:latest
+    entrypoint: [""]
+  variables:
+    SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar"  # Defines the location of the analysis task cache
+    GIT_DEPTH: "0"  # Tells git to fetch all the branches of the project, required by the analysis task
+  cache:
+    key: "\${CI_JOB_NAME}"
+    paths:
+      - .sonar/cache
+  script: 
+    - sonar-scanner
+  allow_failure: true
+  rules:
+    - if: $CI_COMMIT_BRANCH == 'main'
+"
+`;
+
+exports[`should follow and complete all steps: Other: sonar-project.properties 1`] = `
+"sonar.projectKey=my-project
+sonar.qualitygate.wait=true
+"
+`;
+
+exports[`should follow and complete all steps: sonar token key 1`] = `"SONAR_TOKEN"`;
+
+exports[`should follow and complete all steps: sonarqube host url key 1`] = `"SONAR_HOST_URL"`;
+
+exports[`should follow and complete all steps: sonarqube host url value 1`] = `"http://localhost:9000"`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/GitLabCITutorial-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/GitLabCITutorial-test.tsx.snap
deleted file mode 100644 (file)
index ce506bc..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<Fragment>
-  <div
-    className="page-header big-spacer-bottom"
-  >
-    <h2
-      className="page-title"
-    >
-      onboarding.tutorial.with.gitlab_ci.title
-    </h2>
-  </div>
-  <EnvironmentVariablesStep
-    baseUrl="http://localhost:9000"
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-    currentUser={
-      {
-        "dismissedNotices": {
-          "educationPrinciples": false,
-        },
-        "groups": [],
-        "isLoggedIn": true,
-        "login": "luke",
-        "name": "Skywalker",
-        "scmAccounts": [],
-      }
-    }
-    finished={false}
-    onDone={[Function]}
-    onOpen={[Function]}
-    open={true}
-  />
-  <withCLanguageFeature(withAvailableFeaturesContext(YmlFileStep))
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-    finished={false}
-    mainBranchName="main"
-    onDone={[Function]}
-    onOpen={[Function]}
-    open={false}
-  />
-  <AllSetStep
-    alm="gitlab"
-    open={false}
-    stepNumber={3}
-    willRefreshAutomatically={true}
-  />
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/YmlFileStep-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/gitlabci/__tests__/__snapshots__/YmlFileStep-test.tsx.snap
deleted file mode 100644 (file)
index b8da45d..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly: Step wrapper 1`] = `
-<Step
-  finished={true}
-  onOpen={[MockFunction]}
-  open={true}
-  renderForm={[Function]}
-  stepNumber={2}
-  stepTitle="onboarding.tutorial.with.gitlab_ci.yml.title"
-/>
-`;
-
-exports[`should render correctly: initial content 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <ol
-    className="list-styled"
-  >
-    <li>
-      onboarding.build
-      <RenderOptions
-        label="onboarding.build"
-        onCheck={[Function]}
-        optionLabelKey="onboarding.build"
-        options={
-          [
-            "maven",
-            "gradle",
-            "dotnet",
-            "cfamily",
-            "other",
-          ]
-        }
-      />
-    </li>
-  </ol>
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/PipeCommand-test.tsx b/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/PipeCommand-test.tsx
deleted file mode 100644 (file)
index 1715a1f..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { BuildTools } from '../../../types';
-import PipeCommand from '../PipeCommand';
-
-it.each([
-  [BuildTools.Maven],
-  [BuildTools.Gradle],
-  [BuildTools.DotNet],
-  [BuildTools.CFamily],
-  [BuildTools.Other],
-])('should render correctly for %s', (buildTool) => {
-  expect(
-    shallow(
-      <PipeCommand
-        buildTool={buildTool}
-        branchesEnabled={true}
-        mainBranchName="main"
-        projectKey="test"
-        projectName="Test Project"
-      />
-    )
-  ).toMatchSnapshot('branches enabled');
-  expect(
-    shallow(
-      <PipeCommand
-        buildTool={buildTool}
-        branchesEnabled={true}
-        mainBranchName="main"
-        projectKey="test"
-        projectName="Test Project"
-      />
-    )
-  ).toMatchSnapshot('branches not enabled');
-});
diff --git a/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/__snapshots__/PipeCommand-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/gitlabci/commands/__tests__/__snapshots__/PipeCommand-test.tsx.snap
deleted file mode 100644 (file)
index b079bca..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly for cfamily: branches enabled 1`] = `
-<Fragment>
-  <CodeSnippet
-    snippet="image: <image ready for your build toolchain>
-
-cache:
-  paths:
-    - .sonar
-
-stages:
-  - download
-  - build
-  - scan
-
-download:
-  stage: download
-  script:
-      - mkdir -p .sonar
-      - curl -sSLo build-wrapper-linux-x86.zip  $SONAR_HOST_URL/static/cpp/build-wrapper-linux-x86.zip
-      - unzip -o build-wrapper-linux-x86.zip -d .sonar
-
-build:
-  stage: build
-  script:
-      - .sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir .sonar/bw-output <your clean build command>
-
-sonarqube-check:
-  stage: scan
-  script: 
-    - curl -sSLo sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-linux.zip
-    - unzip -o sonar-scanner.zip -d .sonar
-    - .sonar/sonar-scanner-4.6.2.2472-linux/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=.sonar/bw-output
-  allow_failure: true"
-  />
-  <CompilationInfo />
-</Fragment>
-`;
-
-exports[`should render correctly for cfamily: branches not enabled 1`] = `
-<Fragment>
-  <CodeSnippet
-    snippet="image: <image ready for your build toolchain>
-
-cache:
-  paths:
-    - .sonar
-
-stages:
-  - download
-  - build
-  - scan
-
-download:
-  stage: download
-  script:
-      - mkdir -p .sonar
-      - curl -sSLo build-wrapper-linux-x86.zip  $SONAR_HOST_URL/static/cpp/build-wrapper-linux-x86.zip
-      - unzip -o build-wrapper-linux-x86.zip -d .sonar
-
-build:
-  stage: build
-  script:
-      - .sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir .sonar/bw-output <your clean build command>
-
-sonarqube-check:
-  stage: scan
-  script: 
-    - curl -sSLo sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-linux.zip
-    - unzip -o sonar-scanner.zip -d .sonar
-    - .sonar/sonar-scanner-4.6.2.2472-linux/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=.sonar/bw-output
-  allow_failure: true"
-  />
-  <CompilationInfo />
-</Fragment>
-`;
-
-exports[`should render correctly for dotnet: branches enabled 1`] = `
-<Fragment>
-  <CodeSnippet
-    snippet="sonarqube-check:
-  image: mcr.microsoft.com/dotnet/core/sdk:latest
-  variables:
-    SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar"  # Defines the location of the analysis task cache
-    GIT_DEPTH: "0"  # Tells git to fetch all the branches of the project, required by the analysis task
-  cache:
-    key: "\${CI_JOB_NAME}"
-    paths:
-      - .sonar/cache
-  script: 
-      - "apt-get update"
-      - "apt-get install --yes openjdk-11-jre"
-      - "dotnet tool install --global dotnet-sonarscanner"
-      - "export PATH=\\"$PATH:$HOME/.dotnet/tools\\""
-      - "dotnet sonarscanner begin /k:\\"test\\" /d:sonar.login=\\"$SONAR_TOKEN\\" /d:\\"sonar.host.url=$SONAR_HOST_URL\\" "
-      - "dotnet build"
-      - "dotnet sonarscanner end /d:sonar.login=\\"$SONAR_TOKEN\\""
-  allow_failure: true
-  rules:
-    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
-    - if: $CI_COMMIT_BRANCH == 'main'
-    - if: $CI_COMMIT_BRANCH == 'develop'
-"
-  />
-</Fragment>
-`;
-
-exports[`should render correctly for dotnet: branches not enabled 1`] = `
-<Fragment>
-  <CodeSnippet
-    snippet="sonarqube-check:
-  image: mcr.microsoft.com/dotnet/core/sdk:latest
-  variables:
-    SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar"  # Defines the location of the analysis task cache
-    GIT_DEPTH: "0"  # Tells git to fetch all the branches of the project, required by the analysis task
-  cache:
-    key: "\${CI_JOB_NAME}"
-    paths:
-      - .sonar/cache
-  script: 
-      - "apt-get update"
-      - "apt-get install --yes openjdk-11-jre"
-      - "dotnet tool install --global dotnet-sonarscanner"
-      - "export PATH=\\"$PATH:$HOME/.dotnet/tools\\""
-      - "dotnet sonarscanner begin /k:\\"test\\" /d:sonar.login=\\"$SONAR_TOKEN\\" /d:\\"sonar.host.url=$SONAR_HOST_URL\\" "
-      - "dotnet build"
-      - "dotnet sonarscanner end /d:sonar.login=\\"$SONAR_TOKEN\\""
-  allow_failure: true
-  rules:
-    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
-    - if: $CI_COMMIT_BRANCH == 'main'
-    - if: $CI_COMMIT_BRANCH == 'develop'
-"
-  />
-</Fragment>
-`;
-
-exports[`should render correctly for gradle: branches enabled 1`] = `
-<Fragment>
-  <CodeSnippet
-    snippet="sonarqube-check:
-  image: gradle:jre11-slim
-  variables:
-    SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar"  # Defines the location of the analysis task cache
-    GIT_DEPTH: "0"  # Tells git to fetch all the branches of the project, required by the analysis task
-  cache:
-    key: "\${CI_JOB_NAME}"
-    paths:
-      - .sonar/cache
-  script: gradle sonar
-  allow_failure: true
-  rules:
-    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
-    - if: $CI_COMMIT_BRANCH == 'main'
-    - if: $CI_COMMIT_BRANCH == 'develop'
-"
-  />
-</Fragment>
-`;
-
-exports[`should render correctly for gradle: branches not enabled 1`] = `
-<Fragment>
-  <CodeSnippet
-    snippet="sonarqube-check:
-  image: gradle:jre11-slim
-  variables:
-    SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar"  # Defines the location of the analysis task cache
-    GIT_DEPTH: "0"  # Tells git to fetch all the branches of the project, required by the analysis task
-  cache:
-    key: "\${CI_JOB_NAME}"
-    paths:
-      - .sonar/cache
-  script: gradle sonar
-  allow_failure: true
-  rules:
-    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
-    - if: $CI_COMMIT_BRANCH == 'main'
-    - if: $CI_COMMIT_BRANCH == 'develop'
-"
-  />
-</Fragment>
-`;
-
-exports[`should render correctly for maven: branches enabled 1`] = `
-<Fragment>
-  <CodeSnippet
-    snippet="sonarqube-check:
-  image: maven:3.6.3-jdk-11
-  variables:
-    SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar"  # Defines the location of the analysis task cache
-    GIT_DEPTH: "0"  # Tells git to fetch all the branches of the project, required by the analysis task
-  cache:
-    key: "\${CI_JOB_NAME}"
-    paths:
-      - .sonar/cache
-  script: 
-    - mvn verify sonar:sonar -Dsonar.projectKey=test -Dsonar.projectName='Test Project'
-  allow_failure: true
-  rules:
-    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
-    - if: $CI_COMMIT_BRANCH == 'main'
-    - if: $CI_COMMIT_BRANCH == 'develop'
-"
-  />
-</Fragment>
-`;
-
-exports[`should render correctly for maven: branches not enabled 1`] = `
-<Fragment>
-  <CodeSnippet
-    snippet="sonarqube-check:
-  image: maven:3.6.3-jdk-11
-  variables:
-    SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar"  # Defines the location of the analysis task cache
-    GIT_DEPTH: "0"  # Tells git to fetch all the branches of the project, required by the analysis task
-  cache:
-    key: "\${CI_JOB_NAME}"
-    paths:
-      - .sonar/cache
-  script: 
-    - mvn verify sonar:sonar -Dsonar.projectKey=test -Dsonar.projectName='Test Project'
-  allow_failure: true
-  rules:
-    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
-    - if: $CI_COMMIT_BRANCH == 'main'
-    - if: $CI_COMMIT_BRANCH == 'develop'
-"
-  />
-</Fragment>
-`;
-
-exports[`should render correctly for other: branches enabled 1`] = `
-<Fragment>
-  <CodeSnippet
-    snippet="sonarqube-check:
-  image: 
-    name: sonarsource/sonar-scanner-cli:latest
-    entrypoint: [""]
-  variables:
-    SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar"  # Defines the location of the analysis task cache
-    GIT_DEPTH: "0"  # Tells git to fetch all the branches of the project, required by the analysis task
-  cache:
-    key: "\${CI_JOB_NAME}"
-    paths:
-      - .sonar/cache
-  script: 
-    - sonar-scanner
-  allow_failure: true
-  rules:
-    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
-    - if: $CI_COMMIT_BRANCH == 'main'
-    - if: $CI_COMMIT_BRANCH == 'develop'
-"
-  />
-</Fragment>
-`;
-
-exports[`should render correctly for other: branches not enabled 1`] = `
-<Fragment>
-  <CodeSnippet
-    snippet="sonarqube-check:
-  image: 
-    name: sonarsource/sonar-scanner-cli:latest
-    entrypoint: [""]
-  variables:
-    SONAR_USER_HOME: "\${CI_PROJECT_DIR}/.sonar"  # Defines the location of the analysis task cache
-    GIT_DEPTH: "0"  # Tells git to fetch all the branches of the project, required by the analysis task
-  cache:
-    key: "\${CI_JOB_NAME}"
-    paths:
-      - .sonar/cache
-  script: 
-    - sonar-scanner
-  allow_failure: true
-  rules:
-    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
-    - if: $CI_COMMIT_BRANCH == 'main'
-    - if: $CI_COMMIT_BRANCH == 'develop'
-"
-  />
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/JenkinsTutorial-it.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/JenkinsTutorial-it.tsx
new file mode 100644 (file)
index 0000000..045672d
--- /dev/null
@@ -0,0 +1,252 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2023 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * 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, byText } from 'testing-library-selector';
+import UserTokensMock from '../../../../api/mocks/UserTokensMock';
+import { mockComponent } from '../../../../helpers/mocks/component';
+import { mockLanguage } from '../../../../helpers/testMocks';
+import { renderApp, RenderContext } from '../../../../helpers/testReactTestingUtils';
+import { AlmKeys } from '../../../../types/alm-settings';
+import { Feature } from '../../../../types/features';
+import {
+  getCopyToClipboardValue,
+  getTutorialActionButtons,
+  getTutorialBuildButtons,
+} from '../../test-utils';
+import JenkinsTutorial, { JenkinsTutorialProps } from '../JenkinsTutorial';
+
+jest.mock('../../../../api/user-tokens');
+
+jest.mock('../../../../api/settings', () => ({
+  getAllValues: jest.fn().mockResolvedValue([]),
+}));
+
+const tokenMock = new UserTokensMock();
+
+afterEach(() => {
+  tokenMock.reset();
+});
+
+const ui = {
+  devopsPlatformTitle: byRole('heading', {
+    name: 'onboarding.tutorial.with.jenkins.alm_selection.title',
+  }),
+  devopsPlatformButton: (alm: AlmKeys) => byRole('button', { name: `alm.${alm}.long` }),
+  prerequisitesTitle: byRole('heading', { name: 'onboarding.tutorial.with.jenkins.prereqs.title' }),
+  branchSourcePluginBulletPoint: (alm: AlmKeys) =>
+    byText(`onboarding.tutorial.with.jenkins.prereqs.plugins.branch_source.${alm}`),
+  configureAnalysisButton: byRole('button', {
+    name: 'onboarding.tutorial.with.jenkins.prereqs.done',
+  }),
+  multiBranchStepTitle: byRole('heading', {
+    name: 'onboarding.tutorial.with.jenkins.multi_branch_pipeline.title',
+  }),
+  multiBranchPipelineSecondListItem: (alm: AlmKeys) =>
+    byText(`onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.${alm}.sentence`),
+  pipelineStepTitle: byRole('heading', { name: 'onboarding.tutorial.with.jenkins.pipeline.title' }),
+  pipelineIntroText: byText('onboarding.tutorial.with.jenkins.pipeline.intro'),
+  webhookStepTitle: (alm: AlmKeys) =>
+    byRole('heading', {
+      name: `onboarding.tutorial.with.jenkins.webhook.${alm}.title`,
+    }),
+  webhookStepIntroSentence: byText('onboarding.tutorial.with.jenkins.webhook.intro.sentence'),
+  webhookGHLink: byRole('link', {
+    name: 'onboarding.tutorial.with.jenkins.webhook.github.step1.link',
+  }),
+  webhookAlmLink: (alm: AlmKeys) =>
+    byRole('link', {
+      name: new RegExp(`onboarding.tutorial.with.jenkins.webhook.${alm}.step1.link`),
+    }),
+  jenkinsStepTitle: byRole('heading', {
+    name: 'onboarding.tutorial.with.jenkins.jenkinsfile.title',
+  }),
+  allSetSentence: byText('onboarding.tutorial.ci_outro.all_set.sentence'),
+  ...getTutorialActionButtons(),
+  ...getTutorialBuildButtons(),
+};
+
+it.each([AlmKeys.BitbucketCloud, AlmKeys.BitbucketServer, AlmKeys.GitHub, AlmKeys.GitLab])(
+  '%s: can select devops platform and complete all the steps with copying code snippets',
+  async (alm: AlmKeys) => {
+    const user = userEvent.setup();
+    renderJenkinsTutorial();
+
+    expect(await ui.devopsPlatformTitle.find()).toBeInTheDocument();
+
+    // 1. Select platform and go to prerequisites step
+    await user.click(ui.devopsPlatformButton(alm).get());
+
+    // 2. Prerequisites
+    expect(ui.branchSourcePluginBulletPoint(alm).get()).toBeInTheDocument();
+
+    await user.click(ui.configureAnalysisButton.get());
+
+    // 3. Multibranch Pipeline Job
+    expect(ui.multiBranchPipelineSecondListItem(alm).get()).toBeInTheDocument();
+    expect(getCopyToClipboardValue()).toMatchSnapshot(`ref spec`);
+
+    await user.click(ui.continueButton.get());
+
+    // 4. Create DevOps platform webhook
+    expect(ui.webhookStepTitle(alm).get()).toBeInTheDocument();
+    expect(getCopyToClipboardValue()).toMatchSnapshot(`jenkins url`);
+
+    await user.click(ui.continueButton.get());
+
+    // 5. Create jenkinsfile
+    // Maven
+    await user.click(ui.mavenBuildButton.get());
+    expect(getCopyToClipboardValue()).toMatchSnapshot(`maven jenkinsfile`);
+
+    // Gradle
+    await user.click(ui.gradleBuildButton.get());
+    expect(getCopyToClipboardValue()).toMatchSnapshot(`build.gradle file`);
+    expect(getCopyToClipboardValue(1)).toMatchSnapshot(`gradle jenkinsfile`);
+
+    // .NET
+    await user.click(ui.dotnetBuildButton.get());
+    await user.click(ui.windowsDotnetCoreButton.get());
+    expect(getCopyToClipboardValue(1)).toMatchSnapshot(`windows dotnet core jenkinsfile`);
+
+    await user.click(ui.windowsDotnetFrameworkButton.get());
+    expect(getCopyToClipboardValue(2)).toMatchSnapshot(`windows dotnet framework jenkinsfile`);
+
+    await user.click(ui.linuxDotnetCoreButton.get());
+    expect(getCopyToClipboardValue(1)).toMatchSnapshot(`linux dotnet core jenkinsfile`);
+
+    // CFamilly
+    await user.click(ui.cFamilyBuildButton.get());
+    expect(getCopyToClipboardValue()).toMatchSnapshot(`sonar-project.properties code`);
+
+    await user.click(ui.linuxButton.get());
+    expect(getCopyToClipboardValue(1)).toMatchSnapshot(`cfamily linux jenkinsfile`);
+
+    await user.click(ui.windowsButton.get());
+    expect(getCopyToClipboardValue(1)).toMatchSnapshot(`cfamily windows jenkinsfile`);
+
+    await user.click(ui.macosButton.get());
+    expect(getCopyToClipboardValue(1)).toMatchSnapshot(`cfamily macos jenkinsfile`);
+
+    // Other
+    await user.click(ui.otherBuildButton.get());
+    expect(getCopyToClipboardValue()).toMatchSnapshot(
+      `other build tools sonar-project.properties code`
+    );
+    expect(getCopyToClipboardValue(1)).toMatchSnapshot(`other build tools jenkinsfile`);
+
+    await user.click(ui.finishTutorialButton.get());
+    expect(ui.allSetSentence.get()).toBeInTheDocument();
+  }
+);
+
+it.each([AlmKeys.GitHub, AlmKeys.GitLab, AlmKeys.BitbucketCloud])(
+  '%s: has Pipeline step instead of MultiBranchPipeline step if branchSupport is not enabled',
+  async (alm: AlmKeys) => {
+    const user = userEvent.setup();
+    renderJenkinsTutorial({}, { featureList: [] });
+
+    expect(await ui.devopsPlatformTitle.find()).toBeInTheDocument();
+    await user.click(ui.devopsPlatformButton(alm).get());
+    await user.click(ui.configureAnalysisButton.get());
+    expect(ui.pipelineIntroText.get()).toBeInTheDocument();
+    await user.click(ui.continueButton.get());
+    // navigate back and forth
+    await user.click(ui.pipelineStepTitle.get());
+    await user.click(ui.continueButton.get());
+    expect(ui.webhookStepIntroSentence.get()).toBeInTheDocument();
+  }
+);
+
+it.each([AlmKeys.GitHub, AlmKeys.BitbucketCloud])(
+  '%s: completes tutorial with bound alm and project',
+  async (alm: AlmKeys) => {
+    const user = userEvent.setup();
+    renderJenkinsTutorial({
+      almBinding: {
+        alm,
+        url: 'http://localhost/qube',
+        key: 'my-project',
+      },
+      projectBinding: {
+        alm,
+        key: 'my-project',
+        repository: 'my-project',
+        monorepo: true,
+      },
+    });
+
+    expect(ui.devopsPlatformTitle.query()).not.toBeInTheDocument();
+
+    await user.click(ui.configureAnalysisButton.get());
+    await user.click(ui.continueButton.get());
+
+    expect(ui.webhookAlmLink(alm).get()).toBeInTheDocument();
+
+    await user.click(ui.continueButton.get());
+    await user.click(ui.mavenBuildButton.get());
+    await user.click(ui.finishTutorialButton.get());
+    expect(ui.allSetSentence.get()).toBeInTheDocument();
+  }
+);
+
+it('navigates between steps', async () => {
+  const user = userEvent.setup();
+  renderJenkinsTutorial();
+
+  await user.click(ui.devopsPlatformButton(AlmKeys.GitHub).get());
+  await user.click(ui.configureAnalysisButton.get());
+  await user.click(ui.continueButton.get());
+  await user.click(ui.continueButton.get());
+  await user.click(ui.mavenBuildButton.get());
+  await user.click(ui.finishTutorialButton.get());
+  expect(ui.allSetSentence.get()).toBeInTheDocument();
+
+  // Navigate back
+  await user.click(ui.jenkinsStepTitle.get());
+  expect(ui.mavenBuildButton.get()).toBeInTheDocument();
+
+  await user.click(ui.webhookStepTitle(AlmKeys.GitHub).get());
+  expect(ui.webhookStepIntroSentence.get()).toBeInTheDocument();
+
+  await user.click(ui.multiBranchStepTitle.get());
+  expect(ui.multiBranchPipelineSecondListItem(AlmKeys.GitHub).get()).toBeInTheDocument();
+
+  await user.click(ui.prerequisitesTitle.get());
+  expect(ui.configureAnalysisButton.get()).toBeInTheDocument();
+
+  await user.click(ui.devopsPlatformTitle.get());
+  expect(ui.devopsPlatformButton(AlmKeys.BitbucketCloud).get()).toBeInTheDocument();
+});
+
+function renderJenkinsTutorial(
+  overrides: Partial<JenkinsTutorialProps> = {},
+  {
+    featureList = [Feature.BranchSupport],
+    languages = { c: mockLanguage({ key: 'c' }) },
+  }: RenderContext = {}
+) {
+  return renderApp(
+    '/',
+    <JenkinsTutorial baseUrl="http://localhost:9000" component={mockComponent()} {...overrides} />,
+    { featureList, languages }
+  );
+}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/JenkinsTutorial-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/JenkinsTutorial-test.tsx
deleted file mode 100644 (file)
index 9d59001..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockProjectBitbucketBindingResponse } from '../../../../helpers/mocks/alm-settings';
-import { mockComponent } from '../../../../helpers/mocks/component';
-import { AlmKeys } from '../../../../types/alm-settings';
-import JenkinsfileStep from '../JenkinsfileStep';
-import { JenkinsTutorial, JenkinsTutorialProps } from '../JenkinsTutorial';
-import MultiBranchPipelineStep from '../MultiBranchPipelineStep';
-import PreRequisitesStep from '../PreRequisitesStep';
-import SelectAlmStep from '../SelectAlmStep';
-import WebhookStep from '../WebhookStep';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot('default');
-  expect(shallowRender({ hasFeature: () => false })).toMatchSnapshot('branches not enabled');
-  expect(shallowRender({ projectBinding: undefined })).toMatchSnapshot('no project binding');
-});
-
-it('should correctly navigate between steps', () => {
-  const wrapper = shallowRender();
-
-  expect(wrapper.find(PreRequisitesStep).props().open).toBe(true);
-  expect(wrapper.find(MultiBranchPipelineStep).props().open).toBe(false);
-  expect(wrapper.find(WebhookStep).props().open).toBe(false);
-  expect(wrapper.find(JenkinsfileStep).props().open).toBe(false);
-
-  // Pre-reqs done.
-  wrapper.find(PreRequisitesStep).props().onDone();
-  expect(wrapper.find(PreRequisitesStep).props().open).toBe(false);
-  expect(wrapper.find(MultiBranchPipelineStep).props().open).toBe(true);
-  expect(wrapper.find(WebhookStep).props().open).toBe(false);
-  expect(wrapper.find(JenkinsfileStep).props().open).toBe(false);
-
-  // Multibranch done.
-  wrapper.find(MultiBranchPipelineStep).props().onDone();
-  expect(wrapper.find(PreRequisitesStep).props().open).toBe(false);
-  expect(wrapper.find(MultiBranchPipelineStep).props().open).toBe(false);
-  expect(wrapper.find(WebhookStep).props().open).toBe(true);
-  expect(wrapper.find(JenkinsfileStep).props().open).toBe(false);
-
-  // Webhook done.
-  wrapper.find(WebhookStep).props().onDone();
-  expect(wrapper.find(PreRequisitesStep).props().open).toBe(false);
-  expect(wrapper.find(MultiBranchPipelineStep).props().open).toBe(false);
-  expect(wrapper.find(WebhookStep).props().open).toBe(false);
-  expect(wrapper.find(JenkinsfileStep).props().open).toBe(true);
-
-  // Open Pre-reqs.
-  wrapper.find(PreRequisitesStep).props().onOpen();
-  expect(wrapper.find(PreRequisitesStep).props().open).toBe(true);
-
-  // Open Multibranch.
-  wrapper.find(MultiBranchPipelineStep).props().onOpen();
-  expect(wrapper.find(MultiBranchPipelineStep).props().open).toBe(true);
-
-  // Open Webhook.
-  wrapper.find(WebhookStep).props().onOpen();
-  expect(wrapper.find(WebhookStep).props().open).toBe(true);
-});
-
-it('should correctly select an ALM if no project is bound', () => {
-  const wrapper = shallowRender({ projectBinding: undefined });
-  expect(wrapper.find(PreRequisitesStep).exists()).toBe(false);
-  wrapper.find(SelectAlmStep).props().onCheck(AlmKeys.BitbucketCloud);
-  expect(wrapper.find(SelectAlmStep).props().open).toBe(false);
-  expect(wrapper.find(PreRequisitesStep).exists()).toBe(true);
-});
-
-function shallowRender(props: Partial<JenkinsTutorialProps> = {}) {
-  return shallow<JenkinsTutorialProps>(
-    <JenkinsTutorial
-      baseUrl=""
-      hasFeature={jest.fn().mockReturnValue(true)}
-      component={mockComponent()}
-      projectBinding={mockProjectBitbucketBindingResponse()}
-      willRefreshAutomatically={true}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/JenkinsfileStep-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/JenkinsfileStep-test.tsx
deleted file mode 100644 (file)
index 0b3a8a0..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow, ShallowWrapper } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../helpers/mocks/component';
-import RenderOptions from '../../components/RenderOptions';
-import Step from '../../components/Step';
-import { renderStepContent } from '../../test-utils';
-import { BuildTools } from '../../types';
-import { JenkinsfileStep, JenkinsfileStepProps } from '../JenkinsfileStep';
-
-it('should render correctly', () => {
-  const wrapper = shallowRender();
-  expect(wrapper).toMatchSnapshot('Step wrapper');
-  wrapper.setProps({ hasCLanguageFeature: true });
-  expect(wrapper).toMatchSnapshot('Step wrapper with C');
-  expect(renderStepContent(wrapper)).toMatchSnapshot('initial content');
-});
-
-it('should render correctly for Maven', () => {
-  const wrapper = shallowRender();
-  selectBuildTool(wrapper, BuildTools.Maven);
-  expect(wrapper.find(Step).props().renderForm()).toMatchSnapshot();
-});
-
-it('should render correctly for Gradle', () => {
-  const wrapper = shallowRender();
-  selectBuildTool(wrapper, BuildTools.Gradle);
-  expect(renderStepContent(wrapper)).toMatchSnapshot();
-});
-
-it('should render correctly for .NET', () => {
-  const wrapper = shallowRender();
-  selectBuildTool(wrapper, BuildTools.DotNet);
-  expect(renderStepContent(wrapper)).toMatchSnapshot();
-});
-
-it('should render correctly for Other', () => {
-  const wrapper = shallowRender();
-  selectBuildTool(wrapper, BuildTools.Other);
-  expect(renderStepContent(wrapper)).toMatchSnapshot();
-});
-
-function selectBuildTool(wrapper: ShallowWrapper<JenkinsfileStepProps>, tool: BuildTools) {
-  const content = new ShallowWrapper(renderStepContent(wrapper) as JSX.Element);
-  content.find(RenderOptions).prop('onCheck')(tool);
-}
-
-function shallowRender(props: Partial<JenkinsfileStepProps> = {}) {
-  return shallow<JenkinsfileStepProps>(
-    <JenkinsfileStep
-      baseUrl="nice_url"
-      component={mockComponent()}
-      hasCLanguageFeature={false}
-      finished={false}
-      onDone={jest.fn()}
-      onOpen={jest.fn()}
-      open={true}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/MultiBranchPipelineStep-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/MultiBranchPipelineStep-test.tsx
deleted file mode 100644 (file)
index 3bd020a..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import {
-  mockAlmSettingsInstance,
-  mockProjectBitbucketBindingResponse,
-  mockProjectBitbucketCloudBindingResponse,
-  mockProjectGithubBindingResponse,
-  mockProjectGitLabBindingResponse,
-} from '../../../../helpers/mocks/alm-settings';
-import { AlmKeys } from '../../../../types/alm-settings';
-import { renderStepContent } from '../../test-utils';
-import MultiBranchPipelineStep, { MultiBranchPipelineStepProps } from '../MultiBranchPipelineStep';
-
-it('should render correctly', () => {
-  const wrapper = shallowRender();
-  expect(wrapper).toMatchSnapshot('Step wrapper');
-  expect(renderStepContent(wrapper)).toMatchSnapshot('content for bitbucket');
-  expect(renderStepContent(shallowRender({ projectBinding: undefined }))).toMatchSnapshot(
-    'content for bitbucket, no binding'
-  );
-  expect(
-    renderStepContent(
-      shallowRender({
-        alm: AlmKeys.BitbucketCloud,
-        almBinding: mockAlmSettingsInstance({ url: 'https://bitbucket.org/workspaceId/' }),
-        projectBinding: mockProjectBitbucketCloudBindingResponse(),
-      })
-    )
-  ).toMatchSnapshot('content for bitbucket cloud');
-  expect(
-    renderStepContent(
-      shallowRender({
-        alm: AlmKeys.BitbucketCloud,
-        projectBinding: undefined,
-      })
-    )
-  ).toMatchSnapshot('content for bitbucket cloud, no binding');
-  expect(
-    renderStepContent(
-      shallowRender({
-        alm: AlmKeys.GitHub,
-        almBinding: mockAlmSettingsInstance({ url: 'https://api.github.com/' }),
-        projectBinding: mockProjectGithubBindingResponse(),
-      })
-    )
-  ).toMatchSnapshot('content for github');
-  expect(
-    renderStepContent(
-      shallowRender({
-        alm: AlmKeys.GitHub,
-      })
-    )
-  ).toMatchSnapshot('content for github, no binding');
-  expect(
-    renderStepContent(
-      shallowRender({ alm: AlmKeys.GitLab, projectBinding: mockProjectGitLabBindingResponse() })
-    )
-  ).toMatchSnapshot('content for gitlab');
-});
-
-function shallowRender(props: Partial<MultiBranchPipelineStepProps> = {}) {
-  return shallow<MultiBranchPipelineStepProps>(
-    <MultiBranchPipelineStep
-      alm={AlmKeys.BitbucketServer}
-      finished={false}
-      onDone={jest.fn()}
-      onOpen={jest.fn()}
-      open={true}
-      projectBinding={mockProjectBitbucketBindingResponse()}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/PipelineStep-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/PipelineStep-test.tsx
deleted file mode 100644 (file)
index 75132b4..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { AlmKeys } from '../../../../types/alm-settings';
-import { renderStepContent } from '../../test-utils';
-import PipelineStep, { PipelineStepProps } from '../PipelineStep';
-
-it('should render correctly', () => {
-  const wrapper = shallowRender();
-  expect(wrapper).toMatchSnapshot('Step wrapper');
-  expect(renderStepContent(wrapper)).toMatchSnapshot('content');
-  expect(renderStepContent(shallowRender({ alm: AlmKeys.GitLab }))).toMatchSnapshot(
-    'gitlab content'
-  );
-});
-
-function shallowRender(props: Partial<PipelineStepProps> = {}) {
-  return shallow<PipelineStepProps>(
-    <PipelineStep
-      alm={AlmKeys.GitHub}
-      finished={false}
-      onDone={jest.fn()}
-      onOpen={jest.fn()}
-      open={true}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/PreRequisitesStep-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/PreRequisitesStep-test.tsx
deleted file mode 100644 (file)
index 28df445..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { AlmKeys } from '../../../../types/alm-settings';
-import { renderStepContent } from '../../test-utils';
-import PreRequisitesStep, { PreRequisitesStepProps } from '../PreRequisitesStep';
-
-it('should render correctly', () => {
-  const wrapper = shallowRender();
-  expect(wrapper).toMatchSnapshot('Step wrapper');
-  expect(renderStepContent(wrapper)).toMatchSnapshot('content');
-
-  expect(renderStepContent(shallowRender({ branchesEnabled: false }))).toMatchSnapshot(
-    'content for branches disabled'
-  );
-  expect(
-    renderStepContent(shallowRender({ alm: AlmKeys.GitLab, branchesEnabled: false }))
-  ).toMatchSnapshot('content for branches disabled, gitlab');
-});
-
-function shallowRender(props: Partial<PreRequisitesStepProps> = {}) {
-  return shallow<PreRequisitesStepProps>(
-    <PreRequisitesStep
-      alm={AlmKeys.BitbucketServer}
-      branchesEnabled={true}
-      finished={false}
-      onDone={jest.fn()}
-      onOpen={jest.fn()}
-      open={false}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/SelectAlmStep-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/SelectAlmStep-test.tsx
deleted file mode 100644 (file)
index 1a63bc7..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { AlmKeys } from '../../../../types/alm-settings';
-import Step from '../../components/Step';
-import SelectAlmStep, { SelectAlmStepProps } from '../SelectAlmStep';
-
-jest.mock('../../../../helpers/l10n', () => ({
-  hasMessage: (_a: string, k: string, _b: string) => k === AlmKeys.BitbucketCloud,
-  translate: (...k: string[]) => k.join('.'),
-}));
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot('default');
-  expect(shallowRender().find(Step).props().renderForm()).toMatchSnapshot('form, default');
-  expect(shallowRender({ alm: AlmKeys.Azure }).find(Step).props().renderForm()).toMatchSnapshot(
-    'form, with alm'
-  );
-  expect(shallowRender().find(Step).props().renderResult!()).toBeUndefined();
-  expect(
-    shallowRender({ alm: AlmKeys.BitbucketCloud }).find(Step).props().renderResult!()
-  ).toMatchSnapshot('result, with alm');
-});
-
-function shallowRender(props: Partial<SelectAlmStepProps> = {}) {
-  return shallow<SelectAlmStepProps>(
-    <SelectAlmStep onCheck={jest.fn()} onOpen={jest.fn()} open={true} {...props} />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/WebhookStep-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/WebhookStep-test.tsx
deleted file mode 100644 (file)
index 20c94c9..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import {
-  mockAlmSettingsInstance,
-  mockProjectAlmBindingResponse,
-  mockProjectBitbucketBindingResponse,
-  mockProjectBitbucketCloudBindingResponse,
-  mockProjectGithubBindingResponse,
-} from '../../../../helpers/mocks/alm-settings';
-import { AlmKeys } from '../../../../types/alm-settings';
-import { renderStepContent } from '../../test-utils';
-import WebhookStep, { WebhookStepProps } from '../WebhookStep';
-
-it.each([
-  [AlmKeys.Azure, mockProjectAlmBindingResponse({ alm: AlmKeys.Azure })],
-  [AlmKeys.BitbucketCloud, mockProjectBitbucketCloudBindingResponse()],
-  [AlmKeys.BitbucketServer, mockProjectBitbucketBindingResponse()],
-  [AlmKeys.GitHub, mockProjectGithubBindingResponse()],
-  [AlmKeys.GitLab, mockProjectAlmBindingResponse({ alm: AlmKeys.GitLab })],
-])('should render correctly for %s', (alm, projectBinding) => {
-  const wrapper = shallowRender({ alm, projectBinding });
-  expect(wrapper).toMatchSnapshot('wrapper');
-  expect(renderStepContent(wrapper)).toMatchSnapshot('content');
-});
-
-function shallowRender(props: Partial<WebhookStepProps> = {}) {
-  return shallow<WebhookStepProps>(
-    <WebhookStep
-      alm={AlmKeys.BitbucketServer}
-      almBinding={mockAlmSettingsInstance()}
-      branchesEnabled={true}
-      finished={false}
-      onDone={jest.fn()}
-      onOpen={jest.fn()}
-      open={false}
-      projectBinding={mockProjectBitbucketBindingResponse()}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/WebhookStepBitbucket-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/WebhookStepBitbucket-test.tsx
deleted file mode 100644 (file)
index 33c6eb6..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import {
-  mockAlmSettingsInstance,
-  mockProjectBitbucketBindingResponse,
-  mockProjectBitbucketCloudBindingResponse,
-} from '../../../../helpers/mocks/alm-settings';
-import { AlmKeys } from '../../../../types/alm-settings';
-import WebhookStepBitbucket, { WebhookStepBitbucketProps } from '../WebhookStepBitbucket';
-
-it.each([
-  [
-    AlmKeys.BitbucketServer,
-    mockProjectBitbucketBindingResponse(),
-    mockAlmSettingsInstance({ url: 'http://bbs.enterprise.com' }),
-  ],
-  [
-    AlmKeys.BitbucketCloud,
-    mockProjectBitbucketCloudBindingResponse(),
-    mockAlmSettingsInstance({ url: 'http://bitbucket.org/workspace/' }),
-  ],
-])('should render correctly for %s', (alm, projectBinding, almBinding) => {
-  expect(shallowRender({ alm, projectBinding, almBinding })).toMatchSnapshot();
-  expect(shallowRender({ alm, projectBinding, almBinding: undefined })).toMatchSnapshot(
-    'with no alm binding'
-  );
-  expect(
-    shallowRender({ alm, projectBinding, almBinding, branchesEnabled: false })
-  ).toMatchSnapshot('with branches disabled');
-});
-
-function shallowRender(props: Partial<WebhookStepBitbucketProps> = {}) {
-  return shallow<WebhookStepBitbucketProps>(
-    <WebhookStepBitbucket
-      alm={AlmKeys.BitbucketServer}
-      branchesEnabled={true}
-      projectBinding={mockProjectBitbucketBindingResponse()}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/WebhookStepGitLab-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/WebhookStepGitLab-test.tsx
deleted file mode 100644 (file)
index 774b77c..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import WebhookStepGitLab, { WebhookStepGitLabProps } from '../WebhookStepGitLab';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot('default');
-  expect(shallowRender({ branchesEnabled: false })).toMatchSnapshot('with branches disabled');
-});
-
-function shallowRender(props: Partial<WebhookStepGitLabProps> = {}) {
-  return shallow<WebhookStepGitLabProps>(<WebhookStepGitLab branchesEnabled={true} {...props} />);
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/WebhookStepGithub-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/WebhookStepGithub-test.tsx
deleted file mode 100644 (file)
index 48e426c..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import {
-  mockAlmSettingsInstance,
-  mockProjectGithubBindingResponse,
-} from '../../../../helpers/mocks/alm-settings';
-import WebhookStepGithub, { WebhookStepGithubProps } from '../WebhookStepGithub';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-  expect(shallowRender({ almBinding: undefined })).toMatchSnapshot('with no alm binding');
-  expect(shallowRender({ branchesEnabled: false })).toMatchSnapshot('with branches disabled');
-});
-
-function shallowRender(props: Partial<WebhookStepGithubProps> = {}) {
-  return shallow<WebhookStepGithubProps>(
-    <WebhookStepGithub
-      almBinding={mockAlmSettingsInstance({ url: 'http://github.enterprise.com/api/v3' })}
-      branchesEnabled={true}
-      projectBinding={mockProjectGithubBindingResponse()}
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/JenkinsTutorial-it.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/JenkinsTutorial-it.tsx.snap
new file mode 100644 (file)
index 0000000..f4f1480
--- /dev/null
@@ -0,0 +1,777 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`bitbucket: can select devops platform and complete all the steps with copying code snippets: build.gradle file 1`] = `
+"plugins {
+  id "org.sonarqube" version "3.5.0.2730"
+}
+
+sonar {
+  properties {
+    property "sonar.projectKey", "my-project"
+    property "sonar.projectName", "MyProject"
+  }
+}"
+`;
+
+exports[`bitbucket: can select devops platform and complete all the steps with copying code snippets: cfamily linux jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('Download Build Wrapper') {
+    sh "mkdir -p .sonar"
+    sh "curl -sSLo build-wrapper-linux-x86.zip http://localhost:9000/static/cpp/build-wrapper-linux-x86.zip"
+    sh "unzip -o build-wrapper-linux-x86.zip -d .sonar"
+  }
+  stage('Build') {
+    sh ".sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command>"
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner';
+    withSonarQubeEnv() {
+      sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output"
+    }
+  }
+}"
+`;
+
+exports[`bitbucket: can select devops platform and complete all the steps with copying code snippets: cfamily macos jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('Download Build Wrapper') {
+    sh '''
+      mkdir -p .sonar
+      curl -sSLo build-wrapper-macosx-x86.zip http://localhost:9000/static/cpp/build-wrapper-macosx-x86.zip
+      unzip -o build-wrapper-macosx-x86.zip -d .sonar
+    '''
+  }
+  stage('Build') {
+    sh '''
+      .sonar/build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir bw-output <your clean build command>
+    '''
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner';
+    withSonarQubeEnv() {
+      sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output"
+    }
+  }
+}"
+`;
+
+exports[`bitbucket: can select devops platform and complete all the steps with copying code snippets: cfamily windows jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('Download Build Wrapper') {
+    powershell '''
+      $path = "$HOME/.sonar/build-wrapper-win-x86.zip"
+      rm build-wrapper-win-x86 -Recurse -Force -ErrorAction SilentlyContinue
+      rm $path -Force -ErrorAction SilentlyContinue
+      mkdir $HOME/.sonar
+      [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
+      (New-Object System.Net.WebClient).DownloadFile(http://localhost:9000/static/cpp/build-wrapper-win-x86.zip", $path)
+      Add-Type -AssemblyName System.IO.Compression.FileSystem
+      [System.IO.Compression.ZipFile]::ExtractToDirectory($path, "$HOME/.sonar")
+    '''
+  }
+  stage('Build') {
+    powershell '''
+      $env:Path += ";$HOME/.sonar/build-wrapper-win-x86"
+      build-wrapper-win-x86-64 --out-dir bw-output <your clean build command>
+    '''
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner';
+    withSonarQubeEnv() {
+      powershell "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output"
+    }
+  }
+}"
+`;
+
+exports[`bitbucket: can select devops platform and complete all the steps with copying code snippets: gradle jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    withSonarQubeEnv() {
+      sh "./gradlew sonar"
+    }
+  }
+}"
+`;
+
+exports[`bitbucket: can select devops platform and complete all the steps with copying code snippets: jenkins url 1`] = `"***JENKINS_SERVER_URL***/bitbucket-scmsource-hook/notify?server_url=***BITBUCKET_URL***"`;
+
+exports[`bitbucket: can select devops platform and complete all the steps with copying code snippets: linux dotnet core jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner for MSBuild'
+    withSonarQubeEnv() {
+      sh "dotnet \${scannerHome}/SonarScanner.MSBuild.dll begin /k:\\"my-project\\""
+      sh "dotnet build"
+      sh "dotnet \${scannerHome}/SonarScanner.MSBuild.dll end"
+    }
+  }
+}
+"
+`;
+
+exports[`bitbucket: can select devops platform and complete all the steps with copying code snippets: maven jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    def mvn = tool 'Default Maven';
+    withSonarQubeEnv() {
+      sh "\${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'"
+    }
+  }
+}"
+`;
+
+exports[`bitbucket: can select devops platform and complete all the steps with copying code snippets: other build tools jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner';
+    withSonarQubeEnv() {
+      sh "\${scannerHome}/bin/sonar-scanner"
+    }
+  }
+}"
+`;
+
+exports[`bitbucket: can select devops platform and complete all the steps with copying code snippets: other build tools sonar-project.properties code 1`] = `"sonar.projectKey=my-project"`;
+
+exports[`bitbucket: can select devops platform and complete all the steps with copying code snippets: ref spec 1`] = `"+refs/heads/*:refs/remotes/@{remote}/*"`;
+
+exports[`bitbucket: can select devops platform and complete all the steps with copying code snippets: sonar-project.properties code 1`] = `"sonar.projectKey=my-project"`;
+
+exports[`bitbucket: can select devops platform and complete all the steps with copying code snippets: windows dotnet core jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner for MSBuild'
+    withSonarQubeEnv() {
+      bat "dotnet \${scannerHome}\\\\SonarScanner.MSBuild.dll begin /k:\\"my-project\\""
+      bat "dotnet build"
+      bat "dotnet \${scannerHome}\\\\SonarScanner.MSBuild.dll end"
+    }
+  }
+}
+"
+`;
+
+exports[`bitbucket: can select devops platform and complete all the steps with copying code snippets: windows dotnet framework jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    def msbuildHome = tool 'Default MSBuild'
+    def scannerHome = tool 'SonarScanner for MSBuild'
+    withSonarQubeEnv() {
+      bat "\\"\${scannerHome}\\\\SonarScanner.MSBuild.exe\\" begin /k:\\"my-project\\""
+      bat "\\"\${msbuildHome}\\\\MSBuild.exe\\" /t:Rebuild"
+      bat "\\"\${scannerHome}\\\\SonarScanner.MSBuild.exe\\" end"
+    }
+  }
+}
+"
+`;
+
+exports[`bitbucketcloud: can select devops platform and complete all the steps with copying code snippets: build.gradle file 1`] = `
+"plugins {
+  id "org.sonarqube" version "3.5.0.2730"
+}
+
+sonar {
+  properties {
+    property "sonar.projectKey", "my-project"
+    property "sonar.projectName", "MyProject"
+  }
+}"
+`;
+
+exports[`bitbucketcloud: can select devops platform and complete all the steps with copying code snippets: cfamily linux jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('Download Build Wrapper') {
+    sh "mkdir -p .sonar"
+    sh "curl -sSLo build-wrapper-linux-x86.zip http://localhost:9000/static/cpp/build-wrapper-linux-x86.zip"
+    sh "unzip -o build-wrapper-linux-x86.zip -d .sonar"
+  }
+  stage('Build') {
+    sh ".sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command>"
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner';
+    withSonarQubeEnv() {
+      sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output"
+    }
+  }
+}"
+`;
+
+exports[`bitbucketcloud: can select devops platform and complete all the steps with copying code snippets: cfamily macos jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('Download Build Wrapper') {
+    sh '''
+      mkdir -p .sonar
+      curl -sSLo build-wrapper-macosx-x86.zip http://localhost:9000/static/cpp/build-wrapper-macosx-x86.zip
+      unzip -o build-wrapper-macosx-x86.zip -d .sonar
+    '''
+  }
+  stage('Build') {
+    sh '''
+      .sonar/build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir bw-output <your clean build command>
+    '''
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner';
+    withSonarQubeEnv() {
+      sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output"
+    }
+  }
+}"
+`;
+
+exports[`bitbucketcloud: can select devops platform and complete all the steps with copying code snippets: cfamily windows jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('Download Build Wrapper') {
+    powershell '''
+      $path = "$HOME/.sonar/build-wrapper-win-x86.zip"
+      rm build-wrapper-win-x86 -Recurse -Force -ErrorAction SilentlyContinue
+      rm $path -Force -ErrorAction SilentlyContinue
+      mkdir $HOME/.sonar
+      [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
+      (New-Object System.Net.WebClient).DownloadFile(http://localhost:9000/static/cpp/build-wrapper-win-x86.zip", $path)
+      Add-Type -AssemblyName System.IO.Compression.FileSystem
+      [System.IO.Compression.ZipFile]::ExtractToDirectory($path, "$HOME/.sonar")
+    '''
+  }
+  stage('Build') {
+    powershell '''
+      $env:Path += ";$HOME/.sonar/build-wrapper-win-x86"
+      build-wrapper-win-x86-64 --out-dir bw-output <your clean build command>
+    '''
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner';
+    withSonarQubeEnv() {
+      powershell "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output"
+    }
+  }
+}"
+`;
+
+exports[`bitbucketcloud: can select devops platform and complete all the steps with copying code snippets: gradle jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    withSonarQubeEnv() {
+      sh "./gradlew sonar"
+    }
+  }
+}"
+`;
+
+exports[`bitbucketcloud: can select devops platform and complete all the steps with copying code snippets: jenkins url 1`] = `"***JENKINS_SERVER_URL***/bitbucket-scmsource-hook/notify"`;
+
+exports[`bitbucketcloud: can select devops platform and complete all the steps with copying code snippets: linux dotnet core jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner for MSBuild'
+    withSonarQubeEnv() {
+      sh "dotnet \${scannerHome}/SonarScanner.MSBuild.dll begin /k:\\"my-project\\""
+      sh "dotnet build"
+      sh "dotnet \${scannerHome}/SonarScanner.MSBuild.dll end"
+    }
+  }
+}
+"
+`;
+
+exports[`bitbucketcloud: can select devops platform and complete all the steps with copying code snippets: maven jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    def mvn = tool 'Default Maven';
+    withSonarQubeEnv() {
+      sh "\${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'"
+    }
+  }
+}"
+`;
+
+exports[`bitbucketcloud: can select devops platform and complete all the steps with copying code snippets: other build tools jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner';
+    withSonarQubeEnv() {
+      sh "\${scannerHome}/bin/sonar-scanner"
+    }
+  }
+}"
+`;
+
+exports[`bitbucketcloud: can select devops platform and complete all the steps with copying code snippets: other build tools sonar-project.properties code 1`] = `"sonar.projectKey=my-project"`;
+
+exports[`bitbucketcloud: can select devops platform and complete all the steps with copying code snippets: ref spec 1`] = `"+refs/heads/*:refs/remotes/@{remote}/*"`;
+
+exports[`bitbucketcloud: can select devops platform and complete all the steps with copying code snippets: sonar-project.properties code 1`] = `"sonar.projectKey=my-project"`;
+
+exports[`bitbucketcloud: can select devops platform and complete all the steps with copying code snippets: windows dotnet core jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner for MSBuild'
+    withSonarQubeEnv() {
+      bat "dotnet \${scannerHome}\\\\SonarScanner.MSBuild.dll begin /k:\\"my-project\\""
+      bat "dotnet build"
+      bat "dotnet \${scannerHome}\\\\SonarScanner.MSBuild.dll end"
+    }
+  }
+}
+"
+`;
+
+exports[`bitbucketcloud: can select devops platform and complete all the steps with copying code snippets: windows dotnet framework jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    def msbuildHome = tool 'Default MSBuild'
+    def scannerHome = tool 'SonarScanner for MSBuild'
+    withSonarQubeEnv() {
+      bat "\\"\${scannerHome}\\\\SonarScanner.MSBuild.exe\\" begin /k:\\"my-project\\""
+      bat "\\"\${msbuildHome}\\\\MSBuild.exe\\" /t:Rebuild"
+      bat "\\"\${scannerHome}\\\\SonarScanner.MSBuild.exe\\" end"
+    }
+  }
+}
+"
+`;
+
+exports[`github: can select devops platform and complete all the steps with copying code snippets: build.gradle file 1`] = `
+"plugins {
+  id "org.sonarqube" version "3.5.0.2730"
+}
+
+sonar {
+  properties {
+    property "sonar.projectKey", "my-project"
+    property "sonar.projectName", "MyProject"
+  }
+}"
+`;
+
+exports[`github: can select devops platform and complete all the steps with copying code snippets: cfamily linux jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('Download Build Wrapper') {
+    sh "mkdir -p .sonar"
+    sh "curl -sSLo build-wrapper-linux-x86.zip http://localhost:9000/static/cpp/build-wrapper-linux-x86.zip"
+    sh "unzip -o build-wrapper-linux-x86.zip -d .sonar"
+  }
+  stage('Build') {
+    sh ".sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command>"
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner';
+    withSonarQubeEnv() {
+      sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output"
+    }
+  }
+}"
+`;
+
+exports[`github: can select devops platform and complete all the steps with copying code snippets: cfamily macos jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('Download Build Wrapper') {
+    sh '''
+      mkdir -p .sonar
+      curl -sSLo build-wrapper-macosx-x86.zip http://localhost:9000/static/cpp/build-wrapper-macosx-x86.zip
+      unzip -o build-wrapper-macosx-x86.zip -d .sonar
+    '''
+  }
+  stage('Build') {
+    sh '''
+      .sonar/build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir bw-output <your clean build command>
+    '''
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner';
+    withSonarQubeEnv() {
+      sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output"
+    }
+  }
+}"
+`;
+
+exports[`github: can select devops platform and complete all the steps with copying code snippets: cfamily windows jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('Download Build Wrapper') {
+    powershell '''
+      $path = "$HOME/.sonar/build-wrapper-win-x86.zip"
+      rm build-wrapper-win-x86 -Recurse -Force -ErrorAction SilentlyContinue
+      rm $path -Force -ErrorAction SilentlyContinue
+      mkdir $HOME/.sonar
+      [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
+      (New-Object System.Net.WebClient).DownloadFile(http://localhost:9000/static/cpp/build-wrapper-win-x86.zip", $path)
+      Add-Type -AssemblyName System.IO.Compression.FileSystem
+      [System.IO.Compression.ZipFile]::ExtractToDirectory($path, "$HOME/.sonar")
+    '''
+  }
+  stage('Build') {
+    powershell '''
+      $env:Path += ";$HOME/.sonar/build-wrapper-win-x86"
+      build-wrapper-win-x86-64 --out-dir bw-output <your clean build command>
+    '''
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner';
+    withSonarQubeEnv() {
+      powershell "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output"
+    }
+  }
+}"
+`;
+
+exports[`github: can select devops platform and complete all the steps with copying code snippets: gradle jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    withSonarQubeEnv() {
+      sh "./gradlew sonar"
+    }
+  }
+}"
+`;
+
+exports[`github: can select devops platform and complete all the steps with copying code snippets: jenkins url 1`] = `"***JENKINS_SERVER_URL***/github-webhook/"`;
+
+exports[`github: can select devops platform and complete all the steps with copying code snippets: linux dotnet core jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner for MSBuild'
+    withSonarQubeEnv() {
+      sh "dotnet \${scannerHome}/SonarScanner.MSBuild.dll begin /k:\\"my-project\\""
+      sh "dotnet build"
+      sh "dotnet \${scannerHome}/SonarScanner.MSBuild.dll end"
+    }
+  }
+}
+"
+`;
+
+exports[`github: can select devops platform and complete all the steps with copying code snippets: maven jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    def mvn = tool 'Default Maven';
+    withSonarQubeEnv() {
+      sh "\${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'"
+    }
+  }
+}"
+`;
+
+exports[`github: can select devops platform and complete all the steps with copying code snippets: other build tools jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner';
+    withSonarQubeEnv() {
+      sh "\${scannerHome}/bin/sonar-scanner"
+    }
+  }
+}"
+`;
+
+exports[`github: can select devops platform and complete all the steps with copying code snippets: other build tools sonar-project.properties code 1`] = `"sonar.projectKey=my-project"`;
+
+exports[`github: can select devops platform and complete all the steps with copying code snippets: ref spec 1`] = `"+refs/heads/*:refs/remotes/@{remote}/*"`;
+
+exports[`github: can select devops platform and complete all the steps with copying code snippets: sonar-project.properties code 1`] = `"sonar.projectKey=my-project"`;
+
+exports[`github: can select devops platform and complete all the steps with copying code snippets: windows dotnet core jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner for MSBuild'
+    withSonarQubeEnv() {
+      bat "dotnet \${scannerHome}\\\\SonarScanner.MSBuild.dll begin /k:\\"my-project\\""
+      bat "dotnet build"
+      bat "dotnet \${scannerHome}\\\\SonarScanner.MSBuild.dll end"
+    }
+  }
+}
+"
+`;
+
+exports[`github: can select devops platform and complete all the steps with copying code snippets: windows dotnet framework jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    def msbuildHome = tool 'Default MSBuild'
+    def scannerHome = tool 'SonarScanner for MSBuild'
+    withSonarQubeEnv() {
+      bat "\\"\${scannerHome}\\\\SonarScanner.MSBuild.exe\\" begin /k:\\"my-project\\""
+      bat "\\"\${msbuildHome}\\\\MSBuild.exe\\" /t:Rebuild"
+      bat "\\"\${scannerHome}\\\\SonarScanner.MSBuild.exe\\" end"
+    }
+  }
+}
+"
+`;
+
+exports[`gitlab: can select devops platform and complete all the steps with copying code snippets: build.gradle file 1`] = `
+"plugins {
+  id "org.sonarqube" version "3.5.0.2730"
+}
+
+sonar {
+  properties {
+    property "sonar.projectKey", "my-project"
+    property "sonar.projectName", "MyProject"
+  }
+}"
+`;
+
+exports[`gitlab: can select devops platform and complete all the steps with copying code snippets: cfamily linux jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('Download Build Wrapper') {
+    sh "mkdir -p .sonar"
+    sh "curl -sSLo build-wrapper-linux-x86.zip http://localhost:9000/static/cpp/build-wrapper-linux-x86.zip"
+    sh "unzip -o build-wrapper-linux-x86.zip -d .sonar"
+  }
+  stage('Build') {
+    sh ".sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command>"
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner';
+    withSonarQubeEnv() {
+      sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output"
+    }
+  }
+}"
+`;
+
+exports[`gitlab: can select devops platform and complete all the steps with copying code snippets: cfamily macos jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('Download Build Wrapper') {
+    sh '''
+      mkdir -p .sonar
+      curl -sSLo build-wrapper-macosx-x86.zip http://localhost:9000/static/cpp/build-wrapper-macosx-x86.zip
+      unzip -o build-wrapper-macosx-x86.zip -d .sonar
+    '''
+  }
+  stage('Build') {
+    sh '''
+      .sonar/build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir bw-output <your clean build command>
+    '''
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner';
+    withSonarQubeEnv() {
+      sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output"
+    }
+  }
+}"
+`;
+
+exports[`gitlab: can select devops platform and complete all the steps with copying code snippets: cfamily windows jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('Download Build Wrapper') {
+    powershell '''
+      $path = "$HOME/.sonar/build-wrapper-win-x86.zip"
+      rm build-wrapper-win-x86 -Recurse -Force -ErrorAction SilentlyContinue
+      rm $path -Force -ErrorAction SilentlyContinue
+      mkdir $HOME/.sonar
+      [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
+      (New-Object System.Net.WebClient).DownloadFile(http://localhost:9000/static/cpp/build-wrapper-win-x86.zip", $path)
+      Add-Type -AssemblyName System.IO.Compression.FileSystem
+      [System.IO.Compression.ZipFile]::ExtractToDirectory($path, "$HOME/.sonar")
+    '''
+  }
+  stage('Build') {
+    powershell '''
+      $env:Path += ";$HOME/.sonar/build-wrapper-win-x86"
+      build-wrapper-win-x86-64 --out-dir bw-output <your clean build command>
+    '''
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner';
+    withSonarQubeEnv() {
+      powershell "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output"
+    }
+  }
+}"
+`;
+
+exports[`gitlab: can select devops platform and complete all the steps with copying code snippets: gradle jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    withSonarQubeEnv() {
+      sh "./gradlew sonar"
+    }
+  }
+}"
+`;
+
+exports[`gitlab: can select devops platform and complete all the steps with copying code snippets: jenkins url 1`] = `"***JENKINS_SERVER_URL***/gitlab-webhook/post"`;
+
+exports[`gitlab: can select devops platform and complete all the steps with copying code snippets: linux dotnet core jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner for MSBuild'
+    withSonarQubeEnv() {
+      sh "dotnet \${scannerHome}/SonarScanner.MSBuild.dll begin /k:\\"my-project\\""
+      sh "dotnet build"
+      sh "dotnet \${scannerHome}/SonarScanner.MSBuild.dll end"
+    }
+  }
+}
+"
+`;
+
+exports[`gitlab: can select devops platform and complete all the steps with copying code snippets: maven jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    def mvn = tool 'Default Maven';
+    withSonarQubeEnv() {
+      sh "\${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'"
+    }
+  }
+}"
+`;
+
+exports[`gitlab: can select devops platform and complete all the steps with copying code snippets: other build tools jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner';
+    withSonarQubeEnv() {
+      sh "\${scannerHome}/bin/sonar-scanner"
+    }
+  }
+}"
+`;
+
+exports[`gitlab: can select devops platform and complete all the steps with copying code snippets: other build tools sonar-project.properties code 1`] = `"sonar.projectKey=my-project"`;
+
+exports[`gitlab: can select devops platform and complete all the steps with copying code snippets: ref spec 1`] = `"+refs/heads/*:refs/remotes/@{remote}/*"`;
+
+exports[`gitlab: can select devops platform and complete all the steps with copying code snippets: sonar-project.properties code 1`] = `"sonar.projectKey=my-project"`;
+
+exports[`gitlab: can select devops platform and complete all the steps with copying code snippets: windows dotnet core jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    def scannerHome = tool 'SonarScanner for MSBuild'
+    withSonarQubeEnv() {
+      bat "dotnet \${scannerHome}\\\\SonarScanner.MSBuild.dll begin /k:\\"my-project\\""
+      bat "dotnet build"
+      bat "dotnet \${scannerHome}\\\\SonarScanner.MSBuild.dll end"
+    }
+  }
+}
+"
+`;
+
+exports[`gitlab: can select devops platform and complete all the steps with copying code snippets: windows dotnet framework jenkinsfile 1`] = `
+"node {
+  stage('SCM') {
+    checkout scm
+  }
+  stage('SonarQube Analysis') {
+    def msbuildHome = tool 'Default MSBuild'
+    def scannerHome = tool 'SonarScanner for MSBuild'
+    withSonarQubeEnv() {
+      bat "\\"\${scannerHome}\\\\SonarScanner.MSBuild.exe\\" begin /k:\\"my-project\\""
+      bat "\\"\${msbuildHome}\\\\MSBuild.exe\\" /t:Rebuild"
+      bat "\\"\${scannerHome}\\\\SonarScanner.MSBuild.exe\\" end"
+    }
+  }
+}
+"
+`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/JenkinsTutorial-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/JenkinsTutorial-test.tsx.snap
deleted file mode 100644 (file)
index d86ca3f..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly: branches not enabled 1`] = `
-<Fragment>
-  <div
-    className="page-header big-spacer-bottom"
-  >
-    <h2
-      className="page-title"
-    >
-      onboarding.tutorial.with.jenkins.title
-    </h2>
-  </div>
-  <PreRequisitesStep
-    alm="bitbucket"
-    branchesEnabled={false}
-    finished={false}
-    onDone={[Function]}
-    onOpen={[Function]}
-    open={true}
-  />
-  <PipelineStep
-    alm="bitbucket"
-    finished={false}
-    onDone={[Function]}
-    onOpen={[Function]}
-    open={false}
-  />
-  <WebhookStep
-    alm="bitbucket"
-    branchesEnabled={false}
-    finished={false}
-    onDone={[Function]}
-    onOpen={[Function]}
-    open={false}
-    projectBinding={
-      {
-        "alm": "bitbucket",
-        "key": "foo",
-        "monorepo": true,
-        "repository": "PROJECT_KEY",
-        "slug": "repo-slug",
-      }
-    }
-  />
-  <withCLanguageFeature(JenkinsfileStep)
-    baseUrl=""
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-    finished={false}
-    onDone={[Function]}
-    onOpen={[Function]}
-    open={false}
-  />
-  <AllSetStep
-    alm="bitbucket"
-    open={false}
-    stepNumber={4}
-    willRefreshAutomatically={true}
-  />
-</Fragment>
-`;
-
-exports[`should render correctly: default 1`] = `
-<Fragment>
-  <div
-    className="page-header big-spacer-bottom"
-  >
-    <h2
-      className="page-title"
-    >
-      onboarding.tutorial.with.jenkins.title
-    </h2>
-  </div>
-  <PreRequisitesStep
-    alm="bitbucket"
-    branchesEnabled={true}
-    finished={false}
-    onDone={[Function]}
-    onOpen={[Function]}
-    open={true}
-  />
-  <MultiBranchPipelineStep
-    alm="bitbucket"
-    finished={false}
-    onDone={[Function]}
-    onOpen={[Function]}
-    open={false}
-    projectBinding={
-      {
-        "alm": "bitbucket",
-        "key": "foo",
-        "monorepo": true,
-        "repository": "PROJECT_KEY",
-        "slug": "repo-slug",
-      }
-    }
-  />
-  <WebhookStep
-    alm="bitbucket"
-    branchesEnabled={true}
-    finished={false}
-    onDone={[Function]}
-    onOpen={[Function]}
-    open={false}
-    projectBinding={
-      {
-        "alm": "bitbucket",
-        "key": "foo",
-        "monorepo": true,
-        "repository": "PROJECT_KEY",
-        "slug": "repo-slug",
-      }
-    }
-  />
-  <withCLanguageFeature(JenkinsfileStep)
-    baseUrl=""
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-    finished={false}
-    onDone={[Function]}
-    onOpen={[Function]}
-    open={false}
-  />
-  <AllSetStep
-    alm="bitbucket"
-    open={false}
-    stepNumber={4}
-    willRefreshAutomatically={true}
-  />
-</Fragment>
-`;
-
-exports[`should render correctly: no project binding 1`] = `
-<Fragment>
-  <div
-    className="page-header big-spacer-bottom"
-  >
-    <h2
-      className="page-title"
-    >
-      onboarding.tutorial.with.jenkins.title
-    </h2>
-  </div>
-  <SelectAlmStep
-    onCheck={[Function]}
-    onOpen={[Function]}
-    open={true}
-  />
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/JenkinsfileStep-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/JenkinsfileStep-test.tsx.snap
deleted file mode 100644 (file)
index 1dba24a..0000000
+++ /dev/null
@@ -1,267 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly for .NET 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <ol
-    className="list-styled"
-  >
-    <li>
-      onboarding.build
-      <RenderOptions
-        checked="dotnet"
-        label="onboarding.build"
-        onCheck={[Function]}
-        optionLabelKey="onboarding.build"
-        options={
-          [
-            "maven",
-            "gradle",
-            "dotnet",
-            "other",
-          ]
-        }
-      />
-    </li>
-    <DotNet
-      baseUrl="nice_url"
-      component={
-        {
-          "breadcrumbs": [],
-          "key": "my-project",
-          "name": "MyProject",
-          "qualifier": "TRK",
-          "qualityGate": {
-            "isDefault": true,
-            "key": "30",
-            "name": "Sonar way",
-          },
-          "qualityProfiles": [
-            {
-              "deleted": false,
-              "key": "my-qp",
-              "language": "ts",
-              "name": "Sonar way",
-            },
-          ],
-          "tags": [],
-        }
-      }
-      onDone={[MockFunction]}
-    />
-  </ol>
-</div>
-`;
-
-exports[`should render correctly for Gradle 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <ol
-    className="list-styled"
-  >
-    <li>
-      onboarding.build
-      <RenderOptions
-        checked="gradle"
-        label="onboarding.build"
-        onCheck={[Function]}
-        optionLabelKey="onboarding.build"
-        options={
-          [
-            "maven",
-            "gradle",
-            "dotnet",
-            "other",
-          ]
-        }
-      />
-    </li>
-    <Gradle
-      baseUrl="nice_url"
-      component={
-        {
-          "breadcrumbs": [],
-          "key": "my-project",
-          "name": "MyProject",
-          "qualifier": "TRK",
-          "qualityGate": {
-            "isDefault": true,
-            "key": "30",
-            "name": "Sonar way",
-          },
-          "qualityProfiles": [
-            {
-              "deleted": false,
-              "key": "my-qp",
-              "language": "ts",
-              "name": "Sonar way",
-            },
-          ],
-          "tags": [],
-        }
-      }
-      onDone={[MockFunction]}
-    />
-  </ol>
-</div>
-`;
-
-exports[`should render correctly for Maven 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <ol
-    className="list-styled"
-  >
-    <li>
-      onboarding.build
-      <RenderOptions
-        checked="maven"
-        label="onboarding.build"
-        onCheck={[Function]}
-        optionLabelKey="onboarding.build"
-        options={
-          [
-            "maven",
-            "gradle",
-            "dotnet",
-            "other",
-          ]
-        }
-      />
-    </li>
-    <Maven
-      baseUrl="nice_url"
-      component={
-        {
-          "breadcrumbs": [],
-          "key": "my-project",
-          "name": "MyProject",
-          "qualifier": "TRK",
-          "qualityGate": {
-            "isDefault": true,
-            "key": "30",
-            "name": "Sonar way",
-          },
-          "qualityProfiles": [
-            {
-              "deleted": false,
-              "key": "my-qp",
-              "language": "ts",
-              "name": "Sonar way",
-            },
-          ],
-          "tags": [],
-        }
-      }
-      onDone={[MockFunction]}
-    />
-  </ol>
-</div>
-`;
-
-exports[`should render correctly for Other 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <ol
-    className="list-styled"
-  >
-    <li>
-      onboarding.build
-      <RenderOptions
-        checked="other"
-        label="onboarding.build"
-        onCheck={[Function]}
-        optionLabelKey="onboarding.build"
-        options={
-          [
-            "maven",
-            "gradle",
-            "dotnet",
-            "other",
-          ]
-        }
-      />
-    </li>
-    <Other
-      baseUrl="nice_url"
-      component={
-        {
-          "breadcrumbs": [],
-          "key": "my-project",
-          "name": "MyProject",
-          "qualifier": "TRK",
-          "qualityGate": {
-            "isDefault": true,
-            "key": "30",
-            "name": "Sonar way",
-          },
-          "qualityProfiles": [
-            {
-              "deleted": false,
-              "key": "my-qp",
-              "language": "ts",
-              "name": "Sonar way",
-            },
-          ],
-          "tags": [],
-        }
-      }
-      onDone={[MockFunction]}
-    />
-  </ol>
-</div>
-`;
-
-exports[`should render correctly: Step wrapper 1`] = `
-<Step
-  finished={false}
-  onOpen={[MockFunction]}
-  open={true}
-  renderForm={[Function]}
-  stepNumber={3}
-  stepTitle="onboarding.tutorial.with.jenkins.jenkinsfile.title"
-/>
-`;
-
-exports[`should render correctly: Step wrapper with C 1`] = `
-<Step
-  finished={false}
-  onOpen={[MockFunction]}
-  open={true}
-  renderForm={[Function]}
-  stepNumber={3}
-  stepTitle="onboarding.tutorial.with.jenkins.jenkinsfile.title"
-/>
-`;
-
-exports[`should render correctly: initial content 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <ol
-    className="list-styled"
-  >
-    <li>
-      onboarding.build
-      <RenderOptions
-        label="onboarding.build"
-        onCheck={[Function]}
-        optionLabelKey="onboarding.build"
-        options={
-          [
-            "maven",
-            "gradle",
-            "dotnet",
-            "cfamily",
-            "other",
-          ]
-        }
-      />
-    </li>
-  </ol>
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/MultiBranchPipelineStep-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/MultiBranchPipelineStep-test.tsx.snap
deleted file mode 100644 (file)
index 233913f..0000000
+++ /dev/null
@@ -1,1161 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly: Step wrapper 1`] = `
-<Step
-  finished={false}
-  onOpen={[MockFunction]}
-  open={true}
-  renderForm={[Function]}
-  stepNumber={1}
-  stepTitle="onboarding.tutorial.with.jenkins.multi_branch_pipeline.title"
-/>
-`;
-
-exports[`should render correctly: content for bitbucket 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <p
-    className="big-spacer-bottom"
-  >
-    onboarding.tutorial.with.jenkins.multi_branch_pipeline.intro
-  </p>
-  <ol
-    className="list-styled"
-  >
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "new_item",
-            "type",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step1"
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "tab",
-            "source",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.bitbucket"
-      />
-      <ul
-        className="list-styled list-alpha"
-      >
-        <React.Fragment>
-          <li>
-            <LabelActionPair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.bitbucket.server"
-            />
-          </li>
-          <li>
-            <LabelActionPair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.bitbucket.creds"
-            />
-          </li>
-          <li>
-            <LabelValuePair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.bitbucket.owner"
-              value="PROJECT_KEY"
-            />
-          </li>
-          <li>
-            <LabelValuePair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.bitbucket.repo"
-              value="repo-slug"
-            />
-          </li>
-        </React.Fragment>
-        <li>
-          <strong>
-            onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.label
-            :
-          </strong>
-          <ol
-            className="list-styled list-roman little-spacer-top abs-width-600"
-          >
-            <li>
-              <LabelActionPair
-                translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.branches_prs"
-              />
-            </li>
-            <li>
-              <LabelActionPair
-                translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.discover_prs"
-              />
-            </li>
-            <li>
-              <strong>
-                onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.label
-                :
-              </strong>
-              <ul
-                className="list-styled little-spacer-top"
-              >
-                <li>
-                  <SentenceWithHighlights
-                    highlightKeys={
-                      [
-                        "add",
-                        "ref_spec",
-                      ]
-                    }
-                    translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.add_behaviour"
-                  />
-                </li>
-                <li>
-                  <SentenceWithHighlights
-                    highlightKeys={
-                      [
-                        "ref_spec",
-                      ]
-                    }
-                    translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.set_pr_ref_specs"
-                  />
-                  <CodeSnippet
-                    isOneLine={true}
-                    snippet="+refs/heads/*:refs/remotes/@{remote}/*"
-                  />
-                </li>
-              </ul>
-            </li>
-          </ol>
-        </li>
-      </ul>
-      <p
-        className="big-spacer-left padder-left"
-      >
-        onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.leave_defaults
-      </p>
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "tab",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3"
-      />
-      <ul
-        className="list-styled list-alpha"
-      >
-        <li>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3.mode"
-          />
-        </li>
-        <li>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3.script_path"
-          />
-        </li>
-      </ul>
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "save",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step4"
-      />
-    </li>
-  </ol>
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    continue
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
-</div>
-`;
-
-exports[`should render correctly: content for bitbucket cloud 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <p
-    className="big-spacer-bottom"
-  >
-    onboarding.tutorial.with.jenkins.multi_branch_pipeline.intro
-  </p>
-  <ol
-    className="list-styled"
-  >
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "new_item",
-            "type",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step1"
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "tab",
-            "source",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.bitbucketcloud"
-      />
-      <ul
-        className="list-styled list-alpha"
-      >
-        <React.Fragment>
-          <li>
-            <LabelActionPair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.bitbucketcloud.server"
-            />
-          </li>
-          <li>
-            <LabelActionPair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.bitbucketcloud.creds"
-            />
-          </li>
-          <li>
-            <LabelValuePair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.bitbucketcloud.owner"
-              value="workspaceId"
-            />
-          </li>
-          <li>
-            <LabelValuePair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.bitbucketcloud.repo"
-              value="repo-slug"
-            />
-          </li>
-        </React.Fragment>
-        <li>
-          <strong>
-            onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.label
-            :
-          </strong>
-          <ol
-            className="list-styled list-roman little-spacer-top abs-width-600"
-          >
-            <li>
-              <LabelActionPair
-                translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.branches_prs"
-              />
-            </li>
-            <li>
-              <LabelActionPair
-                translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.discover_prs"
-              />
-            </li>
-            <li>
-              <strong>
-                onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.label
-                :
-              </strong>
-              <ul
-                className="list-styled little-spacer-top"
-              >
-                <li>
-                  <SentenceWithHighlights
-                    highlightKeys={
-                      [
-                        "add",
-                        "ref_spec",
-                      ]
-                    }
-                    translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.add_behaviour"
-                  />
-                </li>
-                <li>
-                  <SentenceWithHighlights
-                    highlightKeys={
-                      [
-                        "ref_spec",
-                      ]
-                    }
-                    translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.set_pr_ref_specs"
-                  />
-                  <CodeSnippet
-                    isOneLine={true}
-                    snippet="+refs/heads/*:refs/remotes/@{remote}/*"
-                  />
-                </li>
-              </ul>
-            </li>
-          </ol>
-        </li>
-      </ul>
-      <p
-        className="big-spacer-left padder-left"
-      >
-        onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.leave_defaults
-      </p>
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "tab",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3"
-      />
-      <ul
-        className="list-styled list-alpha"
-      >
-        <li>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3.mode"
-          />
-        </li>
-        <li>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3.script_path"
-          />
-        </li>
-      </ul>
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "save",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step4"
-      />
-    </li>
-  </ol>
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    continue
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
-</div>
-`;
-
-exports[`should render correctly: content for bitbucket cloud, no binding 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <p
-    className="big-spacer-bottom"
-  >
-    onboarding.tutorial.with.jenkins.multi_branch_pipeline.intro
-  </p>
-  <ol
-    className="list-styled"
-  >
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "new_item",
-            "type",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step1"
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "tab",
-            "source",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.bitbucketcloud"
-      />
-      <ul
-        className="list-styled list-alpha"
-      >
-        <React.Fragment>
-          <li>
-            <LabelActionPair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.bitbucketcloud.server"
-            />
-          </li>
-          <li>
-            <LabelActionPair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.bitbucketcloud.creds"
-            />
-          </li>
-          <li>
-            <LabelActionPair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.bitbucketcloud.owner"
-            />
-          </li>
-          <li>
-            <LabelActionPair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.bitbucketcloud.repo"
-            />
-          </li>
-        </React.Fragment>
-        <li>
-          <strong>
-            onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.label
-            :
-          </strong>
-          <ol
-            className="list-styled list-roman little-spacer-top abs-width-600"
-          >
-            <li>
-              <LabelActionPair
-                translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.branches_prs"
-              />
-            </li>
-            <li>
-              <LabelActionPair
-                translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.discover_prs"
-              />
-            </li>
-            <li>
-              <strong>
-                onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.label
-                :
-              </strong>
-              <ul
-                className="list-styled little-spacer-top"
-              >
-                <li>
-                  <SentenceWithHighlights
-                    highlightKeys={
-                      [
-                        "add",
-                        "ref_spec",
-                      ]
-                    }
-                    translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.add_behaviour"
-                  />
-                </li>
-                <li>
-                  <SentenceWithHighlights
-                    highlightKeys={
-                      [
-                        "ref_spec",
-                      ]
-                    }
-                    translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.set_pr_ref_specs"
-                  />
-                  <CodeSnippet
-                    isOneLine={true}
-                    snippet="+refs/heads/*:refs/remotes/@{remote}/*"
-                  />
-                </li>
-              </ul>
-            </li>
-          </ol>
-        </li>
-      </ul>
-      <p
-        className="big-spacer-left padder-left"
-      >
-        onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.leave_defaults
-      </p>
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "tab",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3"
-      />
-      <ul
-        className="list-styled list-alpha"
-      >
-        <li>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3.mode"
-          />
-        </li>
-        <li>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3.script_path"
-          />
-        </li>
-      </ul>
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "save",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step4"
-      />
-    </li>
-  </ol>
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    continue
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
-</div>
-`;
-
-exports[`should render correctly: content for bitbucket, no binding 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <p
-    className="big-spacer-bottom"
-  >
-    onboarding.tutorial.with.jenkins.multi_branch_pipeline.intro
-  </p>
-  <ol
-    className="list-styled"
-  >
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "new_item",
-            "type",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step1"
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "tab",
-            "source",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.bitbucket"
-      />
-      <ul
-        className="list-styled list-alpha"
-      >
-        <React.Fragment>
-          <li>
-            <LabelActionPair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.bitbucket.server"
-            />
-          </li>
-          <li>
-            <LabelActionPair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.bitbucket.creds"
-            />
-          </li>
-          <li>
-            <LabelActionPair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.bitbucket.owner"
-            />
-          </li>
-          <li>
-            <LabelActionPair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.bitbucket.repo"
-            />
-          </li>
-        </React.Fragment>
-        <li>
-          <strong>
-            onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.label
-            :
-          </strong>
-          <ol
-            className="list-styled list-roman little-spacer-top abs-width-600"
-          >
-            <li>
-              <LabelActionPair
-                translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.branches_prs"
-              />
-            </li>
-            <li>
-              <LabelActionPair
-                translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.discover_prs"
-              />
-            </li>
-            <li>
-              <strong>
-                onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.label
-                :
-              </strong>
-              <ul
-                className="list-styled little-spacer-top"
-              >
-                <li>
-                  <SentenceWithHighlights
-                    highlightKeys={
-                      [
-                        "add",
-                        "ref_spec",
-                      ]
-                    }
-                    translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.add_behaviour"
-                  />
-                </li>
-                <li>
-                  <SentenceWithHighlights
-                    highlightKeys={
-                      [
-                        "ref_spec",
-                      ]
-                    }
-                    translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.set_pr_ref_specs"
-                  />
-                  <CodeSnippet
-                    isOneLine={true}
-                    snippet="+refs/heads/*:refs/remotes/@{remote}/*"
-                  />
-                </li>
-              </ul>
-            </li>
-          </ol>
-        </li>
-      </ul>
-      <p
-        className="big-spacer-left padder-left"
-      >
-        onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.leave_defaults
-      </p>
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "tab",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3"
-      />
-      <ul
-        className="list-styled list-alpha"
-      >
-        <li>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3.mode"
-          />
-        </li>
-        <li>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3.script_path"
-          />
-        </li>
-      </ul>
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "save",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step4"
-      />
-    </li>
-  </ol>
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    continue
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
-</div>
-`;
-
-exports[`should render correctly: content for github 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <p
-    className="big-spacer-bottom"
-  >
-    onboarding.tutorial.with.jenkins.multi_branch_pipeline.intro
-  </p>
-  <ol
-    className="list-styled"
-  >
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "new_item",
-            "type",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step1"
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "tab",
-            "source",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.github"
-      />
-      <ul
-        className="list-styled list-alpha"
-      >
-        <React.Fragment>
-          <li>
-            <LabelActionPair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.github.creds"
-            />
-          </li>
-          <li>
-            <LabelValuePair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.github.repo_url"
-              value="https://github.com/PROJECT_KEY"
-            />
-          </li>
-        </React.Fragment>
-        <li>
-          <strong>
-            onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.label
-            :
-          </strong>
-          <ol
-            className="list-styled list-roman little-spacer-top abs-width-600"
-          >
-            <li>
-              <LabelActionPair
-                translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.branches_prs"
-              />
-            </li>
-            <li>
-              <LabelActionPair
-                translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.discover_prs"
-              />
-            </li>
-            <li>
-              <strong>
-                onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.label
-                :
-              </strong>
-              <ul
-                className="list-styled little-spacer-top"
-              >
-                <li>
-                  <SentenceWithHighlights
-                    highlightKeys={
-                      [
-                        "add",
-                        "ref_spec",
-                      ]
-                    }
-                    translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.add_behaviour"
-                  />
-                </li>
-                <li>
-                  <SentenceWithHighlights
-                    highlightKeys={
-                      [
-                        "ref_spec",
-                      ]
-                    }
-                    translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.set_pr_ref_specs"
-                  />
-                  <CodeSnippet
-                    isOneLine={true}
-                    snippet="+refs/heads/*:refs/remotes/@{remote}/*"
-                  />
-                </li>
-              </ul>
-            </li>
-          </ol>
-        </li>
-      </ul>
-      <p
-        className="big-spacer-left padder-left"
-      >
-        onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.leave_defaults
-      </p>
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "tab",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3"
-      />
-      <ul
-        className="list-styled list-alpha"
-      >
-        <li>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3.mode"
-          />
-        </li>
-        <li>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3.script_path"
-          />
-        </li>
-      </ul>
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "save",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step4"
-      />
-    </li>
-  </ol>
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    continue
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
-</div>
-`;
-
-exports[`should render correctly: content for github, no binding 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <p
-    className="big-spacer-bottom"
-  >
-    onboarding.tutorial.with.jenkins.multi_branch_pipeline.intro
-  </p>
-  <ol
-    className="list-styled"
-  >
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "new_item",
-            "type",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step1"
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "tab",
-            "source",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.github"
-      />
-      <ul
-        className="list-styled list-alpha"
-      >
-        <React.Fragment>
-          <li>
-            <LabelActionPair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.github.creds"
-            />
-          </li>
-          <li>
-            <LabelActionPair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.github.repo_url"
-            />
-          </li>
-        </React.Fragment>
-        <li>
-          <strong>
-            onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.label
-            :
-          </strong>
-          <ol
-            className="list-styled list-roman little-spacer-top abs-width-600"
-          >
-            <li>
-              <LabelActionPair
-                translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.branches_prs"
-              />
-            </li>
-            <li>
-              <LabelActionPair
-                translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.discover_prs"
-              />
-            </li>
-            <li>
-              <strong>
-                onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.label
-                :
-              </strong>
-              <ul
-                className="list-styled little-spacer-top"
-              >
-                <li>
-                  <SentenceWithHighlights
-                    highlightKeys={
-                      [
-                        "add",
-                        "ref_spec",
-                      ]
-                    }
-                    translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.add_behaviour"
-                  />
-                </li>
-                <li>
-                  <SentenceWithHighlights
-                    highlightKeys={
-                      [
-                        "ref_spec",
-                      ]
-                    }
-                    translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.set_pr_ref_specs"
-                  />
-                  <CodeSnippet
-                    isOneLine={true}
-                    snippet="+refs/heads/*:refs/remotes/@{remote}/*"
-                  />
-                </li>
-              </ul>
-            </li>
-          </ol>
-        </li>
-      </ul>
-      <p
-        className="big-spacer-left padder-left"
-      >
-        onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.leave_defaults
-      </p>
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "tab",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3"
-      />
-      <ul
-        className="list-styled list-alpha"
-      >
-        <li>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3.mode"
-          />
-        </li>
-        <li>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3.script_path"
-          />
-        </li>
-      </ul>
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "save",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step4"
-      />
-    </li>
-  </ol>
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    continue
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
-</div>
-`;
-
-exports[`should render correctly: content for gitlab 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <p
-    className="big-spacer-bottom"
-  >
-    onboarding.tutorial.with.jenkins.multi_branch_pipeline.intro
-  </p>
-  <ol
-    className="list-styled"
-  >
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "new_item",
-            "type",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step1"
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "tab",
-            "source",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.gitlab"
-      />
-      <ul
-        className="list-styled list-alpha"
-      >
-        <React.Fragment>
-          <li>
-            <LabelActionPair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.gitlab.creds"
-            />
-          </li>
-          <li>
-            <LabelActionPair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.gitlab.owner"
-            />
-          </li>
-          <li>
-            <LabelActionPair
-              translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.gitlab.repo"
-            />
-          </li>
-        </React.Fragment>
-        <li>
-          <strong>
-            onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.label
-            :
-          </strong>
-          <ol
-            className="list-styled list-roman little-spacer-top abs-width-600"
-          >
-            <li>
-              <LabelActionPair
-                translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.branches_mrs"
-              />
-            </li>
-            <li>
-              <LabelActionPair
-                translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.discover_mrs"
-              />
-            </li>
-            <li>
-              <strong>
-                onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.label
-                :
-              </strong>
-              <ul
-                className="list-styled little-spacer-top"
-              >
-                <li>
-                  <SentenceWithHighlights
-                    highlightKeys={
-                      [
-                        "add",
-                        "ref_spec",
-                      ]
-                    }
-                    translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.add_behaviour"
-                  />
-                </li>
-                <li>
-                  <SentenceWithHighlights
-                    highlightKeys={
-                      [
-                        "ref_spec",
-                      ]
-                    }
-                    translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.behaviors.ref_specs.set_mr_ref_specs"
-                  />
-                  <CodeSnippet
-                    isOneLine={true}
-                    snippet="+refs/heads/*:refs/remotes/@{remote}/*"
-                  />
-                </li>
-              </ul>
-            </li>
-          </ol>
-        </li>
-      </ul>
-      <p
-        className="big-spacer-left padder-left"
-      >
-        onboarding.tutorial.with.jenkins.multi_branch_pipeline.step2.leave_defaults
-      </p>
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "tab",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3"
-      />
-      <ul
-        className="list-styled list-alpha"
-      >
-        <li>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3.mode"
-          />
-        </li>
-        <li>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step3.script_path"
-          />
-        </li>
-      </ul>
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "save",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.multi_branch_pipeline.step4"
-      />
-    </li>
-  </ol>
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    continue
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/PipelineStep-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/PipelineStep-test.tsx.snap
deleted file mode 100644 (file)
index 659205b..0000000
+++ /dev/null
@@ -1,234 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly: Step wrapper 1`] = `
-<Step
-  finished={false}
-  onOpen={[MockFunction]}
-  open={true}
-  renderForm={[Function]}
-  stepNumber={1}
-  stepTitle="onboarding.tutorial.with.jenkins.pipeline.title"
-/>
-`;
-
-exports[`should render correctly: content 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <p
-    className="big-spacer-bottom"
-  >
-    onboarding.tutorial.with.jenkins.pipeline.intro
-  </p>
-  <ol
-    className="list-styled"
-  >
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "new_item",
-            "type",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.pipeline.step1"
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "tab",
-            "option",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.pipeline.step2"
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "tab",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.pipeline.step3"
-      />
-      <ul
-        className="list-styled"
-      >
-        <li>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.pipeline.step3.definition"
-          />
-        </li>
-        <li>
-          <SentenceWithHighlights
-            highlightKeys={
-              [
-                "label",
-                "branches_to_build",
-              ]
-            }
-            translationKey="onboarding.tutorial.with.jenkins.pipeline.step3.scm"
-          />
-        </li>
-        <li>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.pipeline.step3.script_path"
-          />
-        </li>
-      </ul>
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "save",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.pipeline.step4"
-      />
-    </li>
-  </ol>
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    continue
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
-</div>
-`;
-
-exports[`should render correctly: gitlab content 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <p
-    className="big-spacer-bottom"
-  >
-    onboarding.tutorial.with.jenkins.pipeline.intro
-  </p>
-  <ol
-    className="list-styled"
-  >
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "new_item",
-            "type",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.pipeline.step1"
-      />
-    </li>
-    <li>
-      <React.Fragment>
-        <SentenceWithHighlights
-          highlightKeys={
-            [
-              "tab",
-              "option",
-            ]
-          }
-          translationKey="onboarding.tutorial.with.jenkins.pipeline.gitlab.step2.trigger"
-        />
-        <ul
-          className="list-styled"
-        >
-          <li>
-            <SentenceWithHighlights
-              highlightKeys={
-                [
-                  "triggers",
-                  "push_events",
-                ]
-              }
-              translationKey="onboarding.tutorial.with.jenkins.pipeline.gitlab.step2.pick_triggers"
-            />
-          </li>
-          <li>
-            <SentenceWithHighlights
-              highlightKeys={
-                [
-                  "advanced",
-                ]
-              }
-              translationKey="onboarding.tutorial.with.jenkins.pipeline.gitlab.step2.click_advanced"
-            />
-          </li>
-          <li>
-            <SentenceWithHighlights
-              highlightKeys={
-                [
-                  "secret_token",
-                  "generate",
-                ]
-              }
-              translationKey="onboarding.tutorial.with.jenkins.pipeline.gitlab.step2.secret_token"
-            />
-          </li>
-        </ul>
-      </React.Fragment>
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "tab",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.pipeline.step3"
-      />
-      <ul
-        className="list-styled"
-      >
-        <li>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.pipeline.step3.definition"
-          />
-        </li>
-        <li>
-          <SentenceWithHighlights
-            highlightKeys={
-              [
-                "label",
-                "branches_to_build",
-              ]
-            }
-            translationKey="onboarding.tutorial.with.jenkins.pipeline.step3.scm"
-          />
-        </li>
-        <li>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.pipeline.step3.script_path"
-          />
-        </li>
-      </ul>
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "save",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.pipeline.step4"
-      />
-    </li>
-  </ol>
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    continue
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/PreRequisitesStep-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/PreRequisitesStep-test.tsx.snap
deleted file mode 100644 (file)
index 1e17f87..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly: Step wrapper 1`] = `
-<Step
-  finished={false}
-  onOpen={[MockFunction]}
-  open={false}
-  renderForm={[Function]}
-  stepTitle="onboarding.tutorial.with.jenkins.prereqs.title"
-/>
-`;
-
-exports[`should render correctly: content 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <Alert
-    className="big-spacer-bottom"
-    variant="warning"
-  >
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "installed",
-          "configured",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.prereqs.intro"
-    />
-  </Alert>
-  <ul
-    className="list-styled big-spacer-bottom"
-  >
-    <li>
-      onboarding.tutorial.with.jenkins.prereqs.plugins.branch_source.bitbucket
-    </li>
-    <li>
-      onboarding.tutorial.with.jenkins.prereqs.plugins.sonar_scanner
-    </li>
-  </ul>
-  <p
-    className="big-spacer-bottom"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.jenkins.prereqs.step_by_step_guide"
-      id="onboarding.tutorial.with.jenkins.prereqs.step_by_step_guide"
-      values={
-        {
-          "link": <withAppStateContext(DocLink)
-            to="/analyzing-source-code/ci-integration/jenkins-integration/"
-          >
-            onboarding.tutorial.with.jenkins.prereqs.step_by_step_guide.link
-          </withAppStateContext(DocLink)>,
-        }
-      }
-    />
-  </p>
-  <p
-    className="big-spacer-bottom"
-  >
-    onboarding.tutorial.with.jenkins.prereqs.following_are_recommendations
-  </p>
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    onboarding.tutorial.with.jenkins.prereqs.done
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
-</div>
-`;
-
-exports[`should render correctly: content for branches disabled 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <Alert
-    className="big-spacer-bottom"
-    variant="warning"
-  >
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "installed",
-          "configured",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.prereqs.intro"
-    />
-  </Alert>
-  <ul
-    className="list-styled big-spacer-bottom"
-  >
-    <li>
-      onboarding.tutorial.with.jenkins.prereqs.plugins.sonar_scanner
-    </li>
-  </ul>
-  <p
-    className="big-spacer-bottom"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.jenkins.prereqs.step_by_step_guide"
-      id="onboarding.tutorial.with.jenkins.prereqs.step_by_step_guide"
-      values={
-        {
-          "link": <withAppStateContext(DocLink)
-            to="/analyzing-source-code/ci-integration/jenkins-integration/"
-          >
-            onboarding.tutorial.with.jenkins.prereqs.step_by_step_guide.link
-          </withAppStateContext(DocLink)>,
-        }
-      }
-    />
-  </p>
-  <p
-    className="big-spacer-bottom"
-  >
-    onboarding.tutorial.with.jenkins.prereqs.following_are_recommendations
-  </p>
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    onboarding.tutorial.with.jenkins.prereqs.done
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
-</div>
-`;
-
-exports[`should render correctly: content for branches disabled, gitlab 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <Alert
-    className="big-spacer-bottom"
-    variant="warning"
-  >
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "installed",
-          "configured",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.prereqs.intro"
-    />
-  </Alert>
-  <ul
-    className="list-styled big-spacer-bottom"
-  >
-    <li>
-      onboarding.tutorial.with.jenkins.prereqs.plugins.gitlab_plugin
-    </li>
-    <li>
-      onboarding.tutorial.with.jenkins.prereqs.plugins.sonar_scanner
-    </li>
-  </ul>
-  <p
-    className="big-spacer-bottom"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.jenkins.prereqs.step_by_step_guide"
-      id="onboarding.tutorial.with.jenkins.prereqs.step_by_step_guide"
-      values={
-        {
-          "link": <withAppStateContext(DocLink)
-            to="/analyzing-source-code/ci-integration/jenkins-integration/"
-          >
-            onboarding.tutorial.with.jenkins.prereqs.step_by_step_guide.link
-          </withAppStateContext(DocLink)>,
-        }
-      }
-    />
-  </p>
-  <p
-    className="big-spacer-bottom"
-  >
-    onboarding.tutorial.with.jenkins.prereqs.following_are_recommendations
-  </p>
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    onboarding.tutorial.with.jenkins.prereqs.done
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/SelectAlmStep-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/SelectAlmStep-test.tsx.snap
deleted file mode 100644 (file)
index fb76d73..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly: default 1`] = `
-<Step
-  finished={true}
-  onOpen={[MockFunction]}
-  open={true}
-  renderForm={[Function]}
-  renderResult={[Function]}
-  stepTitle="onboarding.tutorial.with.jenkins.alm_selection.title"
-/>
-`;
-
-exports[`should render correctly: form, default 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <ButtonToggle
-    label="onboarding.tutorial.with.jenkins.alm_selection.title"
-    onCheck={[MockFunction]}
-    options={
-      [
-        {
-          "label": "alm.bitbucketcloud.long",
-          "value": "bitbucketcloud",
-        },
-        {
-          "label": "alm.bitbucket",
-          "value": "bitbucket",
-        },
-        {
-          "label": "alm.github",
-          "value": "github",
-        },
-        {
-          "label": "alm.gitlab",
-          "value": "gitlab",
-        },
-      ]
-    }
-  />
-</div>
-`;
-
-exports[`should render correctly: form, with alm 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <ButtonToggle
-    label="onboarding.tutorial.with.jenkins.alm_selection.title"
-    onCheck={[MockFunction]}
-    options={
-      [
-        {
-          "label": "alm.bitbucketcloud.long",
-          "value": "bitbucketcloud",
-        },
-        {
-          "label": "alm.bitbucket",
-          "value": "bitbucket",
-        },
-        {
-          "label": "alm.github",
-          "value": "github",
-        },
-        {
-          "label": "alm.gitlab",
-          "value": "gitlab",
-        },
-      ]
-    }
-    value="azure"
-  />
-</div>
-`;
-
-exports[`should render correctly: result, with alm 1`] = `
-<div
-  className="boxed-group-actions display-flex-center"
->
-  <AlertSuccessIcon
-    className="spacer-right"
-  />
-  alm.bitbucketcloud.long
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/WebhookStep-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/WebhookStep-test.tsx.snap
deleted file mode 100644 (file)
index b342803..0000000
+++ /dev/null
@@ -1,297 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly for azure: content 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <p
-    className="big-spacer-bottom"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.jenkins.webhook.intro.sentence"
-      id="onboarding.tutorial.with.jenkins.webhook.intro.sentence"
-      values={
-        {
-          "link": <ButtonLink
-            onClick={[MockFunction]}
-          >
-            onboarding.tutorial.with.jenkins.webhook.intro.link
-          </ButtonLink>,
-        }
-      }
-    />
-  </p>
-  <ol
-    className="list-styled"
-  />
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    continue
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
-</div>
-`;
-
-exports[`should render correctly for azure: wrapper 1`] = `
-<Step
-  finished={false}
-  onOpen={[MockFunction]}
-  open={false}
-  renderForm={[Function]}
-  stepNumber={2}
-  stepTitle="onboarding.tutorial.with.jenkins.webhook.azure.title"
-/>
-`;
-
-exports[`should render correctly for bitbucket: content 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <p
-    className="big-spacer-bottom"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.jenkins.webhook.intro.sentence"
-      id="onboarding.tutorial.with.jenkins.webhook.intro.sentence"
-      values={
-        {
-          "link": <ButtonLink
-            onClick={[MockFunction]}
-          >
-            onboarding.tutorial.with.jenkins.webhook.intro.link
-          </ButtonLink>,
-        }
-      }
-    />
-  </p>
-  <ol
-    className="list-styled"
-  >
-    <WebhookStepBitbucket
-      alm="bitbucket"
-      almBinding={
-        {
-          "alm": "github",
-          "key": "key",
-        }
-      }
-      branchesEnabled={true}
-      projectBinding={
-        {
-          "alm": "bitbucket",
-          "key": "foo",
-          "monorepo": true,
-          "repository": "PROJECT_KEY",
-          "slug": "repo-slug",
-        }
-      }
-    />
-  </ol>
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    continue
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
-</div>
-`;
-
-exports[`should render correctly for bitbucket: wrapper 1`] = `
-<Step
-  finished={false}
-  onOpen={[MockFunction]}
-  open={false}
-  renderForm={[Function]}
-  stepNumber={2}
-  stepTitle="onboarding.tutorial.with.jenkins.webhook.bitbucket.title"
-/>
-`;
-
-exports[`should render correctly for bitbucketcloud: content 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <p
-    className="big-spacer-bottom"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.jenkins.webhook.intro.sentence"
-      id="onboarding.tutorial.with.jenkins.webhook.intro.sentence"
-      values={
-        {
-          "link": <ButtonLink
-            onClick={[MockFunction]}
-          >
-            onboarding.tutorial.with.jenkins.webhook.intro.link
-          </ButtonLink>,
-        }
-      }
-    />
-  </p>
-  <ol
-    className="list-styled"
-  >
-    <WebhookStepBitbucket
-      alm="bitbucketcloud"
-      almBinding={
-        {
-          "alm": "github",
-          "key": "key",
-        }
-      }
-      branchesEnabled={true}
-      projectBinding={
-        {
-          "alm": "bitbucketcloud",
-          "key": "foo",
-          "monorepo": true,
-          "repository": "repo-slug",
-        }
-      }
-    />
-  </ol>
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    continue
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
-</div>
-`;
-
-exports[`should render correctly for bitbucketcloud: wrapper 1`] = `
-<Step
-  finished={false}
-  onOpen={[MockFunction]}
-  open={false}
-  renderForm={[Function]}
-  stepNumber={2}
-  stepTitle="onboarding.tutorial.with.jenkins.webhook.bitbucketcloud.title"
-/>
-`;
-
-exports[`should render correctly for github: content 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <p
-    className="big-spacer-bottom"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.jenkins.webhook.intro.sentence"
-      id="onboarding.tutorial.with.jenkins.webhook.intro.sentence"
-      values={
-        {
-          "link": <ButtonLink
-            onClick={[MockFunction]}
-          >
-            onboarding.tutorial.with.jenkins.webhook.intro.link
-          </ButtonLink>,
-        }
-      }
-    />
-  </p>
-  <ol
-    className="list-styled"
-  >
-    <WebhookStepGithub
-      almBinding={
-        {
-          "alm": "github",
-          "key": "key",
-        }
-      }
-      branchesEnabled={true}
-      projectBinding={
-        {
-          "alm": "github",
-          "key": "foo",
-          "monorepo": true,
-          "repository": "PROJECT_KEY",
-        }
-      }
-    />
-  </ol>
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    continue
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
-</div>
-`;
-
-exports[`should render correctly for github: wrapper 1`] = `
-<Step
-  finished={false}
-  onOpen={[MockFunction]}
-  open={false}
-  renderForm={[Function]}
-  stepNumber={2}
-  stepTitle="onboarding.tutorial.with.jenkins.webhook.github.title"
-/>
-`;
-
-exports[`should render correctly for gitlab: content 1`] = `
-<div
-  className="boxed-group-inner"
->
-  <p
-    className="big-spacer-bottom"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.jenkins.webhook.intro.sentence"
-      id="onboarding.tutorial.with.jenkins.webhook.intro.sentence"
-      values={
-        {
-          "link": <ButtonLink
-            onClick={[MockFunction]}
-          >
-            onboarding.tutorial.with.jenkins.webhook.intro.link
-          </ButtonLink>,
-        }
-      }
-    />
-  </p>
-  <ol
-    className="list-styled"
-  >
-    <WebhookStepGitLab
-      branchesEnabled={true}
-    />
-  </ol>
-  <Button
-    className="big-spacer-top"
-    onClick={[MockFunction]}
-  >
-    continue
-    <ChevronRightIcon
-      size={13}
-    />
-  </Button>
-</div>
-`;
-
-exports[`should render correctly for gitlab: wrapper 1`] = `
-<Step
-  finished={false}
-  onOpen={[MockFunction]}
-  open={false}
-  renderForm={[Function]}
-  stepNumber={2}
-  stepTitle="onboarding.tutorial.with.jenkins.webhook.gitlab.title"
-/>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/WebhookStepBitbucket-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/WebhookStepBitbucket-test.tsx.snap
deleted file mode 100644 (file)
index b33311f..0000000
+++ /dev/null
@@ -1,460 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly for bitbucket 1`] = `
-<Fragment>
-  <li>
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      id="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      values={
-        {
-          "link": <ForwardRef(Link)
-            target="_blank"
-            to="http://bbs.enterprise.com/plugins/servlet/webhooks/projects/PROJECT_KEY/repos/repo-slug/create"
-          >
-            onboarding.tutorial.with.jenkins.webhook.bitbucket.step1.link
-          </ForwardRef(Link)>,
-        }
-      }
-    />
-    <ul
-      className="list-styled list-alpha"
-    >
-      <li>
-        <LabelActionPair
-          translationKey="onboarding.tutorial.with.jenkins.webhook.step1.name"
-        />
-      </li>
-      <li
-        className="abs-width-600"
-      >
-        <p>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucket.step1.url"
-          />
-        </p>
-        <CodeSnippet
-          isOneLine={true}
-          snippet="***JENKINS_SERVER_URL***/bitbucket-scmsource-hook/notify?server_url=http://bbs.enterprise.com"
-        />
-        <Alert
-          variant="info"
-        >
-          onboarding.tutorial.with.jenkins.webhook.bitbucket.step1.url.warning
-        </Alert>
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "events",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucket.step2"
-    />
-    <ul
-      className="list-styled list-alpha"
-    >
-      <li>
-        <LabelActionPair
-          translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucket.step2.repo"
-        />
-      </li>
-      <li>
-        <LabelActionPair
-          translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucket.step2.pr"
-        />
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "create",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucket.step3"
-    />
-  </li>
-</Fragment>
-`;
-
-exports[`should render correctly for bitbucket: with branches disabled 1`] = `
-<Fragment>
-  <li>
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      id="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      values={
-        {
-          "link": <ForwardRef(Link)
-            target="_blank"
-            to="http://bbs.enterprise.com/plugins/servlet/webhooks/projects/PROJECT_KEY/repos/repo-slug/create"
-          >
-            onboarding.tutorial.with.jenkins.webhook.bitbucket.step1.link
-          </ForwardRef(Link)>,
-        }
-      }
-    />
-    <ul
-      className="list-styled list-alpha"
-    >
-      <li>
-        <LabelActionPair
-          translationKey="onboarding.tutorial.with.jenkins.webhook.step1.name"
-        />
-      </li>
-      <li
-        className="abs-width-600"
-      >
-        <p>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucket.step1.url"
-          />
-        </p>
-        <CodeSnippet
-          isOneLine={true}
-          snippet="***JENKINS_SERVER_URL***/job/***JENKINS_JOB_NAME***/build?token=***JENKINS_BUILD_TRIGGER_TOKEN***"
-        />
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "events",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucket.step2"
-    />
-    <ul
-      className="list-styled list-alpha"
-    >
-      <li>
-        <LabelActionPair
-          translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucket.step2.repo"
-        />
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "create",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucket.step3"
-    />
-  </li>
-</Fragment>
-`;
-
-exports[`should render correctly for bitbucket: with no alm binding 1`] = `
-<Fragment>
-  <li>
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      id="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      values={
-        {
-          "link": <strong>
-            onboarding.tutorial.with.jenkins.webhook.bitbucket.step1.link
-          </strong>,
-        }
-      }
-    />
-    <ul
-      className="list-styled list-alpha"
-    >
-      <li>
-        <LabelActionPair
-          translationKey="onboarding.tutorial.with.jenkins.webhook.step1.name"
-        />
-      </li>
-      <li
-        className="abs-width-600"
-      >
-        <p>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucket.step1.url"
-          />
-        </p>
-        <CodeSnippet
-          isOneLine={true}
-          snippet="***JENKINS_SERVER_URL***/bitbucket-scmsource-hook/notify?server_url=***BITBUCKET_URL***"
-        />
-        <Alert
-          variant="info"
-        >
-          onboarding.tutorial.with.jenkins.webhook.bitbucket.step1.url.warning
-        </Alert>
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "events",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucket.step2"
-    />
-    <ul
-      className="list-styled list-alpha"
-    >
-      <li>
-        <LabelActionPair
-          translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucket.step2.repo"
-        />
-      </li>
-      <li>
-        <LabelActionPair
-          translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucket.step2.pr"
-        />
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "create",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucket.step3"
-    />
-  </li>
-</Fragment>
-`;
-
-exports[`should render correctly for bitbucketcloud 1`] = `
-<Fragment>
-  <li>
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      id="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      values={
-        {
-          "link": <ForwardRef(Link)
-            target="_blank"
-            to="http://bitbucket.org/workspace/repo-slug/admin/addon/admin/bitbucket-webhooks/bb-webhooks-repo-admin"
-          >
-            onboarding.tutorial.with.jenkins.webhook.bitbucketcloud.step1.link
-          </ForwardRef(Link)>,
-        }
-      }
-    />
-    <ul
-      className="list-styled list-alpha"
-    >
-      <li>
-        <LabelActionPair
-          translationKey="onboarding.tutorial.with.jenkins.webhook.step1.name"
-        />
-      </li>
-      <li
-        className="abs-width-600"
-      >
-        <p>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucket.step1.url"
-          />
-        </p>
-        <CodeSnippet
-          isOneLine={true}
-          snippet="***JENKINS_SERVER_URL***/bitbucket-scmsource-hook/notify"
-        />
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "triggers",
-          "option",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucketcloud.step2"
-    />
-    <ul
-      className="list-styled list-alpha"
-    >
-      <li>
-        <LabelActionPair
-          translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucketcloud.step2.repo"
-        />
-      </li>
-      <li>
-        <LabelActionPair
-          translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucketcloud.step2.pr"
-        />
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "save",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucketcloud.step3"
-    />
-  </li>
-</Fragment>
-`;
-
-exports[`should render correctly for bitbucketcloud: with branches disabled 1`] = `
-<Fragment>
-  <li>
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      id="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      values={
-        {
-          "link": <ForwardRef(Link)
-            target="_blank"
-            to="http://bitbucket.org/workspace/repo-slug/admin/addon/admin/bitbucket-webhooks/bb-webhooks-repo-admin"
-          >
-            onboarding.tutorial.with.jenkins.webhook.bitbucketcloud.step1.link
-          </ForwardRef(Link)>,
-        }
-      }
-    />
-    <ul
-      className="list-styled list-alpha"
-    >
-      <li>
-        <LabelActionPair
-          translationKey="onboarding.tutorial.with.jenkins.webhook.step1.name"
-        />
-      </li>
-      <li
-        className="abs-width-600"
-      >
-        <p>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucket.step1.url"
-          />
-        </p>
-        <CodeSnippet
-          isOneLine={true}
-          snippet="***JENKINS_SERVER_URL***/job/***JENKINS_JOB_NAME***/build?token=***JENKINS_BUILD_TRIGGER_TOKEN***"
-        />
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "triggers",
-          "option",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucketcloud.step2"
-    />
-    <ul
-      className="list-styled list-alpha"
-    >
-      <li>
-        <LabelActionPair
-          translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucketcloud.step2.repo"
-        />
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "save",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucketcloud.step3"
-    />
-  </li>
-</Fragment>
-`;
-
-exports[`should render correctly for bitbucketcloud: with no alm binding 1`] = `
-<Fragment>
-  <li>
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      id="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      values={
-        {
-          "link": <strong>
-            onboarding.tutorial.with.jenkins.webhook.bitbucketcloud.step1.link
-          </strong>,
-        }
-      }
-    />
-    <ul
-      className="list-styled list-alpha"
-    >
-      <li>
-        <LabelActionPair
-          translationKey="onboarding.tutorial.with.jenkins.webhook.step1.name"
-        />
-      </li>
-      <li
-        className="abs-width-600"
-      >
-        <p>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucket.step1.url"
-          />
-        </p>
-        <CodeSnippet
-          isOneLine={true}
-          snippet="***JENKINS_SERVER_URL***/bitbucket-scmsource-hook/notify"
-        />
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "triggers",
-          "option",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucketcloud.step2"
-    />
-    <ul
-      className="list-styled list-alpha"
-    >
-      <li>
-        <LabelActionPair
-          translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucketcloud.step2.repo"
-        />
-      </li>
-      <li>
-        <LabelActionPair
-          translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucketcloud.step2.pr"
-        />
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "save",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.bitbucketcloud.step3"
-    />
-  </li>
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/WebhookStepGitLab-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/WebhookStepGitLab-test.tsx.snap
deleted file mode 100644 (file)
index a52bf39..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly: default 1`] = `
-<Fragment>
-  <li>
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      id="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      values={
-        {
-          "link": "onboarding.tutorial.with.jenkins.webhook.gitlab.step1.link",
-        }
-      }
-    />
-    <ul
-      className="list-styled"
-    >
-      <li
-        className="abs-width-600"
-      >
-        <p>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.webhook.gitlab.step1.url_with_branches"
-          />
-        </p>
-        <CodeSnippet
-          isOneLine={true}
-          snippet="***JENKINS_SERVER_URL***/gitlab-webhook/post"
-        />
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "trigger",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.gitlab.step2"
-    />
-    <ul
-      className="list-styled"
-    >
-      <li>
-        <strong>
-          onboarding.tutorial.with.jenkins.webhook.gitlab.step2.repo
-        </strong>
-      </li>
-      <li>
-        <strong>
-          onboarding.tutorial.with.jenkins.webhook.gitlab.step2.mr
-        </strong>
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "add_webhook",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.gitlab.step3"
-    />
-  </li>
-</Fragment>
-`;
-
-exports[`should render correctly: with branches disabled 1`] = `
-<Fragment>
-  <li>
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      id="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      values={
-        {
-          "link": "onboarding.tutorial.with.jenkins.webhook.gitlab.step1.link",
-        }
-      }
-    />
-    <ul
-      className="list-styled"
-    >
-      <li>
-        <LabelActionPair
-          translationKey="onboarding.tutorial.with.jenkins.webhook.gitlab.step1.url_no_branches"
-        />
-      </li>
-      <li>
-        <LabelActionPair
-          translationKey="onboarding.tutorial.with.jenkins.webhook.gitlab.step1.secret_token"
-        />
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "trigger",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.gitlab.step2"
-    />
-    <ul
-      className="list-styled"
-    >
-      <li>
-        <strong>
-          onboarding.tutorial.with.jenkins.webhook.gitlab.step2.repo
-        </strong>
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "add_webhook",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.gitlab.step3"
-    />
-  </li>
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/WebhookStepGithub-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/WebhookStepGithub-test.tsx.snap
deleted file mode 100644 (file)
index a8ee7b0..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<Fragment>
-  <li>
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      id="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      values={
-        {
-          "link": <ForwardRef(Link)
-            target="_blank"
-            to="http://github.enterprise.com/PROJECT_KEY/settings/hooks"
-          >
-            onboarding.tutorial.with.jenkins.webhook.github.step1.link
-          </ForwardRef(Link)>,
-        }
-      }
-    />
-    <ul
-      className="list-styled"
-    >
-      <li
-        className="abs-width-600"
-      >
-        <p>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.webhook.github.step1.url"
-          />
-        </p>
-        <CodeSnippet
-          isOneLine={true}
-          snippet="***JENKINS_SERVER_URL***/github-webhook/"
-        />
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "events",
-          "option",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.github.step2"
-    />
-    <ul
-      className="list-styled"
-    >
-      <li>
-        <strong>
-          onboarding.tutorial.with.jenkins.webhook.github.step2.repo
-        </strong>
-      </li>
-      <li>
-        <strong>
-          onboarding.tutorial.with.jenkins.webhook.github.step2.pr
-        </strong>
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "add_webhook",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.github.step3"
-    />
-  </li>
-</Fragment>
-`;
-
-exports[`should render correctly: with branches disabled 1`] = `
-<Fragment>
-  <li>
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      id="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      values={
-        {
-          "link": <ForwardRef(Link)
-            target="_blank"
-            to="http://github.enterprise.com/PROJECT_KEY/settings/hooks"
-          >
-            onboarding.tutorial.with.jenkins.webhook.github.step1.link
-          </ForwardRef(Link)>,
-        }
-      }
-    />
-    <ul
-      className="list-styled"
-    >
-      <li
-        className="abs-width-600"
-      >
-        <p>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.webhook.github.step1.url"
-          />
-        </p>
-        <CodeSnippet
-          isOneLine={true}
-          snippet="***JENKINS_SERVER_URL***/job/***JENKINS_JOB_NAME***/build?token=***JENKINS_BUILD_TRIGGER_TOKEN***"
-        />
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "events",
-          "option",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.github.step2"
-    />
-    <ul
-      className="list-styled"
-    >
-      <li>
-        <strong>
-          onboarding.tutorial.with.jenkins.webhook.github.step2.repo
-        </strong>
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "add_webhook",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.github.step3"
-    />
-  </li>
-</Fragment>
-`;
-
-exports[`should render correctly: with no alm binding 1`] = `
-<Fragment>
-  <li>
-    <FormattedMessage
-      defaultMessage="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      id="onboarding.tutorial.with.jenkins.webhook.step1.sentence"
-      values={
-        {
-          "link": <strong>
-            onboarding.tutorial.with.jenkins.webhook.github.step1.link
-          </strong>,
-        }
-      }
-    />
-    <ul
-      className="list-styled"
-    >
-      <li
-        className="abs-width-600"
-      >
-        <p>
-          <LabelActionPair
-            translationKey="onboarding.tutorial.with.jenkins.webhook.github.step1.url"
-          />
-        </p>
-        <CodeSnippet
-          isOneLine={true}
-          snippet="***JENKINS_SERVER_URL***/github-webhook/"
-        />
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "events",
-          "option",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.github.step2"
-    />
-    <ul
-      className="list-styled"
-    >
-      <li>
-        <strong>
-          onboarding.tutorial.with.jenkins.webhook.github.step2.repo
-        </strong>
-      </li>
-      <li>
-        <strong>
-          onboarding.tutorial.with.jenkins.webhook.github.step2.pr
-        </strong>
-      </li>
-    </ul>
-  </li>
-  <li>
-    <SentenceWithHighlights
-      highlightKeys={
-        [
-          "add_webhook",
-        ]
-      }
-      translationKey="onboarding.tutorial.with.jenkins.webhook.github.step3"
-    />
-  </li>
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/CFamilly-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/CFamilly-test.tsx
deleted file mode 100644 (file)
index d0a9f82..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import RenderOptions from '../../../components/RenderOptions';
-import { OSs } from '../../../types';
-import { LanguageProps } from '../../JenkinsfileStep';
-import CFamilly from '../CFamilly';
-
-it('should render correctly for', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-it.each([[OSs.Linux], [OSs.MacOS], [OSs.Windows]])('should render correctly for %s', (os) => {
-  const wrapper = shallowRender();
-  wrapper.find(RenderOptions).simulate('check', os);
-  expect(wrapper).toMatchSnapshot(os);
-});
-
-function shallowRender(props: Partial<LanguageProps> = {}) {
-  return shallow<LanguageProps>(
-    <CFamilly onDone={jest.fn()} component={mockComponent()} baseUrl="nice_url_sample" {...props} />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/CreateJenkinsfileBulletPoint-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/CreateJenkinsfileBulletPoint-test.tsx
deleted file mode 100644 (file)
index b12c790..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import CreateJenkinsfileBulletPoint, {
-  CreateJenkinsfileBulletPointProps,
-} from '../CreateJenkinsfileBulletPoint';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot('default');
-  expect(shallowRender({ alertTranslationKeyPart: 'baz' })).toMatchSnapshot('with alert');
-});
-
-function shallowRender(props: Partial<CreateJenkinsfileBulletPointProps> = {}) {
-  return shallow<CreateJenkinsfileBulletPointProps>(
-    <CreateJenkinsfileBulletPoint snippet="foo { bar() }" {...props} />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/DotNet-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/DotNet-test.tsx
deleted file mode 100644 (file)
index b6de1d7..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import { LanguageProps } from '../../JenkinsfileStep';
-import DotNet from '../DotNet';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-function shallowRender(props: Partial<LanguageProps> = {}) {
-  return shallow<LanguageProps>(
-    <DotNet onDone={jest.fn()} component={mockComponent()} baseUrl="" {...props} />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/DotNetCore-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/DotNetCore-test.tsx
deleted file mode 100644 (file)
index 65a1ad6..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import { OSs } from '../../../types';
-import { DotNetCoreFrameworkProps } from '../DotNet';
-import DotNetCore from '../DotNetCore';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot('win');
-  expect(shallowRender({ os: OSs.Linux })).toMatchSnapshot('linux');
-});
-
-function shallowRender(props: Partial<DotNetCoreFrameworkProps> = {}) {
-  return shallow<DotNetCoreFrameworkProps>(
-    <DotNetCore component={mockComponent()} os={OSs.Windows} {...props} />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/DotNetFramework-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/DotNetFramework-test.tsx
deleted file mode 100644 (file)
index ab089d7..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import { OSs } from '../../../types';
-import { DotNetCoreFrameworkProps } from '../DotNet';
-import DotNetFramework from '../DotNetFramework';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-function shallowRender(props: Partial<DotNetCoreFrameworkProps> = {}) {
-  return shallow<DotNetCoreFrameworkProps>(
-    <DotNetFramework component={mockComponent()} os={OSs.Windows} {...props} />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/DotNetPrereqsMSBuild-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/DotNetPrereqsMSBuild-test.tsx
deleted file mode 100644 (file)
index 2de66d8..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import DotNetPrereqsMSBuild from '../DotNetPrereqsMSBuild';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-function shallowRender() {
-  return shallow(<DotNetPrereqsMSBuild />);
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/DotNetPrereqsScanner-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/DotNetPrereqsScanner-test.tsx
deleted file mode 100644 (file)
index 3ef5141..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import DotNetPrereqsScanner from '../DotNetPrereqsScanner';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-function shallowRender() {
-  return shallow(<DotNetPrereqsScanner />);
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/Gradle-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/Gradle-test.tsx
deleted file mode 100644 (file)
index 916de79..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import { LanguageProps } from '../../JenkinsfileStep';
-import Gradle from '../Gradle';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-function shallowRender(props: Partial<LanguageProps> = {}) {
-  return shallow<LanguageProps>(
-    <Gradle onDone={jest.fn()} component={mockComponent()} baseUrl="" {...props} />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/Maven-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/Maven-test.tsx
deleted file mode 100644 (file)
index bb073b3..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import { LanguageProps } from '../../JenkinsfileStep';
-import Maven from '../Maven';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-function shallowRender(props: Partial<LanguageProps> = {}) {
-  return shallow<LanguageProps>(
-    <Maven onDone={jest.fn()} component={mockComponent()} baseUrl="" {...props} />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/Other-test.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/Other-test.tsx
deleted file mode 100644 (file)
index 9448fe5..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import { LanguageProps } from '../../JenkinsfileStep';
-import Other from '../Other';
-
-it('should render correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-function shallowRender(props: Partial<LanguageProps> = {}) {
-  return shallow<LanguageProps>(
-    <Other onDone={jest.fn()} component={mockComponent()} baseUrl="" {...props} />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/CFamilly-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/CFamilly-test.tsx.snap
deleted file mode 100644 (file)
index 485d34f..0000000
+++ /dev/null
@@ -1,298 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly for 1`] = `
-<Fragment>
-  <DefaultProjectKey
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <li
-    className="abs-width-600"
-  >
-    onboarding.build.other.os
-    <RenderOptions
-      label="onboarding.build.other.os"
-      onCheck={[Function]}
-      optionLabelKey="onboarding.build.other.os"
-      options={
-        [
-          "linux",
-          "win",
-          "mac",
-        ]
-      }
-    />
-  </li>
-</Fragment>
-`;
-
-exports[`should render correctly for linux: linux 1`] = `
-<Fragment>
-  <DefaultProjectKey
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <li
-    className="abs-width-600"
-  >
-    onboarding.build.other.os
-    <RenderOptions
-      checked="linux"
-      label="onboarding.build.other.os"
-      onCheck={[Function]}
-      optionLabelKey="onboarding.build.other.os"
-      options={
-        [
-          "linux",
-          "win",
-          "mac",
-        ]
-      }
-    />
-    <GithubCFamilyExampleRepositories
-      ci="jenkins"
-      className="big-spacer-top big-spacer-bottom"
-      os="linux"
-    />
-  </li>
-  <CreateJenkinsfileBulletPoint
-    alertTranslationKeyPart="onboarding.tutorial.with.jenkins.jenkinsfile.other.step3"
-    snippet="node {
-  stage('SCM') {
-    checkout scm
-  }
-  stage('Download Build Wrapper') {
-    sh "mkdir -p .sonar"
-    sh "curl -sSLo build-wrapper-linux-x86.zip nice_url_sample/static/cpp/build-wrapper-linux-x86.zip"
-    sh "unzip -o build-wrapper-linux-x86.zip -d .sonar"
-  }
-  stage('Build') {
-    sh ".sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command>"
-  }
-  stage('SonarQube Analysis') {
-    def scannerHome = tool 'SonarScanner';
-    withSonarQubeEnv() {
-      sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output"
-    }
-  }
-}"
-  >
-    <CompilationInfo />
-  </CreateJenkinsfileBulletPoint>
-  <FinishButton
-    onClick={[MockFunction]}
-  />
-</Fragment>
-`;
-
-exports[`should render correctly for mac: mac 1`] = `
-<Fragment>
-  <DefaultProjectKey
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <li
-    className="abs-width-600"
-  >
-    onboarding.build.other.os
-    <RenderOptions
-      checked="mac"
-      label="onboarding.build.other.os"
-      onCheck={[Function]}
-      optionLabelKey="onboarding.build.other.os"
-      options={
-        [
-          "linux",
-          "win",
-          "mac",
-        ]
-      }
-    />
-    <GithubCFamilyExampleRepositories
-      ci="jenkins"
-      className="big-spacer-top big-spacer-bottom"
-      os="mac"
-    />
-  </li>
-  <CreateJenkinsfileBulletPoint
-    alertTranslationKeyPart="onboarding.tutorial.with.jenkins.jenkinsfile.other.step3"
-    snippet="node {
-  stage('SCM') {
-    checkout scm
-  }
-  stage('Download Build Wrapper') {
-    sh '''
-      mkdir -p .sonar
-      curl -sSLo build-wrapper-macosx-x86.zip nice_url_sample/static/cpp/build-wrapper-macosx-x86.zip
-      unzip -o build-wrapper-macosx-x86.zip -d .sonar
-    '''
-  }
-  stage('Build') {
-    sh '''
-      .sonar/build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir bw-output <your clean build command>
-    '''
-  }
-  stage('SonarQube Analysis') {
-    def scannerHome = tool 'SonarScanner';
-    withSonarQubeEnv() {
-      sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output"
-    }
-  }
-}"
-  >
-    <CompilationInfo />
-  </CreateJenkinsfileBulletPoint>
-  <FinishButton
-    onClick={[MockFunction]}
-  />
-</Fragment>
-`;
-
-exports[`should render correctly for win: win 1`] = `
-<Fragment>
-  <DefaultProjectKey
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <li
-    className="abs-width-600"
-  >
-    onboarding.build.other.os
-    <RenderOptions
-      checked="win"
-      label="onboarding.build.other.os"
-      onCheck={[Function]}
-      optionLabelKey="onboarding.build.other.os"
-      options={
-        [
-          "linux",
-          "win",
-          "mac",
-        ]
-      }
-    />
-    <GithubCFamilyExampleRepositories
-      ci="jenkins"
-      className="big-spacer-top big-spacer-bottom"
-      os="win"
-    />
-  </li>
-  <CreateJenkinsfileBulletPoint
-    alertTranslationKeyPart="onboarding.tutorial.with.jenkins.jenkinsfile.other.step3"
-    snippet="node {
-  stage('SCM') {
-    checkout scm
-  }
-  stage('Download Build Wrapper') {
-    powershell '''
-      $path = "$HOME/.sonar/build-wrapper-win-x86.zip"
-      rm build-wrapper-win-x86 -Recurse -Force -ErrorAction SilentlyContinue
-      rm $path -Force -ErrorAction SilentlyContinue
-      mkdir $HOME/.sonar
-      [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
-      (New-Object System.Net.WebClient).DownloadFile(nice_url_sample/static/cpp/build-wrapper-win-x86.zip", $path)
-      Add-Type -AssemblyName System.IO.Compression.FileSystem
-      [System.IO.Compression.ZipFile]::ExtractToDirectory($path, "$HOME/.sonar")
-    '''
-  }
-  stage('Build') {
-    powershell '''
-      $env:Path += ";$HOME/.sonar/build-wrapper-win-x86"
-      build-wrapper-win-x86-64 --out-dir bw-output <your clean build command>
-    '''
-  }
-  stage('SonarQube Analysis') {
-    def scannerHome = tool 'SonarScanner';
-    withSonarQubeEnv() {
-      powershell "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output"
-    }
-  }
-}"
-  >
-    <CompilationInfo />
-  </CreateJenkinsfileBulletPoint>
-  <FinishButton
-    onClick={[MockFunction]}
-  />
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/CreateJenkinsfileBulletPoint-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/CreateJenkinsfileBulletPoint-test.tsx.snap
deleted file mode 100644 (file)
index d2a3aef..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly: default 1`] = `
-<li
-  className="abs-width-600"
->
-  <SentenceWithFilename
-    filename="Jenkinsfile"
-    translationKey="onboarding.tutorial.with.jenkins.jenkinsfile.jenkinsfile_step"
-  />
-  <CodeSnippet
-    snippet="foo { bar() }"
-  />
-</li>
-`;
-
-exports[`should render correctly: with alert 1`] = `
-<li
-  className="abs-width-600"
->
-  <SentenceWithFilename
-    filename="Jenkinsfile"
-    translationKey="onboarding.tutorial.with.jenkins.jenkinsfile.jenkinsfile_step"
-  />
-  <Alert
-    className="spacer-top"
-    variant="info"
-  >
-    <div
-      className="text-middle"
-    >
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "default",
-            "in_jenkins",
-          ]
-        }
-        translationKey="baz.replace"
-      />
-      <HelpTooltip
-        className="little-spacer-left"
-        overlay={
-          <React.Fragment>
-            <p
-              className="spacer-bottom"
-            >
-              <SentenceWithHighlights
-                highlightKeys={
-                  [
-                    "path",
-                  ]
-                }
-                translationKey="baz.help1"
-              />
-            </p>
-            <p>
-              <SentenceWithHighlights
-                highlightKeys={
-                  [
-                    "path",
-                    "name",
-                  ]
-                }
-                translationKey="baz.help2"
-              />
-            </p>
-          </React.Fragment>
-        }
-      />
-    </div>
-  </Alert>
-  <CodeSnippet
-    snippet="foo { bar() }"
-  />
-</li>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/DotNet-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/DotNet-test.tsx.snap
deleted file mode 100644 (file)
index ab0aff4..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<Fragment>
-  <li>
-    onboarding.tutorial.with.jenkins.jenkinsfile.dotnet.build_agent
-    <RenderOptions
-      label="onboarding.tutorial.with.jenkins.jenkinsfile.dotnet.build_agent"
-      onCheck={[Function]}
-      optionLabelKey="onboarding.build.dotnet"
-      options={
-        [
-          "win_core",
-          "win_msbuild",
-          "linux_core",
-        ]
-      }
-    />
-  </li>
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/DotNetCore-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/DotNetCore-test.tsx.snap
deleted file mode 100644 (file)
index 337c2c5..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly: linux 1`] = `
-<Fragment>
-  <DotNetPrereqsScanner />
-  <li
-    className="abs-width-600"
-  >
-    <SentenceWithFilename
-      filename="Jenkinsfile"
-      translationKey="onboarding.tutorial.with.jenkins.jenkinsfile.jenkinsfile_step"
-    />
-    <CodeSnippet
-      snippet="node {
-  stage('SCM') {
-    checkout scm
-  }
-  stage('SonarQube Analysis') {
-    def scannerHome = tool 'SonarScanner for MSBuild'
-    withSonarQubeEnv() {
-      sh "dotnet \${scannerHome}/SonarScanner.MSBuild.dll begin /k:\\"my-project\\""
-      sh "dotnet build"
-      sh "dotnet \${scannerHome}/SonarScanner.MSBuild.dll end"
-    }
-  }
-}
-"
-    />
-  </li>
-</Fragment>
-`;
-
-exports[`should render correctly: win 1`] = `
-<Fragment>
-  <DotNetPrereqsScanner />
-  <li
-    className="abs-width-600"
-  >
-    <SentenceWithFilename
-      filename="Jenkinsfile"
-      translationKey="onboarding.tutorial.with.jenkins.jenkinsfile.jenkinsfile_step"
-    />
-    <CodeSnippet
-      snippet="node {
-  stage('SCM') {
-    checkout scm
-  }
-  stage('SonarQube Analysis') {
-    def scannerHome = tool 'SonarScanner for MSBuild'
-    withSonarQubeEnv() {
-      bat "dotnet \${scannerHome}\\\\SonarScanner.MSBuild.dll begin /k:\\"my-project\\""
-      bat "dotnet build"
-      bat "dotnet \${scannerHome}\\\\SonarScanner.MSBuild.dll end"
-    }
-  }
-}
-"
-    />
-  </li>
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/DotNetFramework-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/DotNetFramework-test.tsx.snap
deleted file mode 100644 (file)
index 5fc76c1..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<Fragment>
-  <DotNetPrereqsScanner />
-  <DotNetPrereqsMSBuild />
-  <li
-    className="abs-width-600"
-  >
-    <SentenceWithFilename
-      filename="Jenkinsfile"
-      translationKey="onboarding.tutorial.with.jenkins.jenkinsfile.jenkinsfile_step"
-    />
-    <CodeSnippet
-      snippet="node {
-  stage('SCM') {
-    checkout scm
-  }
-  stage('SonarQube Analysis') {
-    def msbuildHome = tool 'Default MSBuild'
-    def scannerHome = tool 'SonarScanner for MSBuild'
-    withSonarQubeEnv() {
-      bat "\\"\${scannerHome}\\\\SonarScanner.MSBuild.exe\\" begin /k:\\"my-project\\""
-      bat "\\"\${msbuildHome}\\\\MSBuild.exe\\" /t:Rebuild"
-      bat "\\"\${scannerHome}\\\\SonarScanner.MSBuild.exe\\" end"
-    }
-  }
-}
-"
-    />
-  </li>
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/DotNetPrereqsMSBuild-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/DotNetPrereqsMSBuild-test.tsx.snap
deleted file mode 100644 (file)
index d1290fa..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<li
-  className="abs-width-600"
->
-  <SentenceWithHighlights
-    highlightKeys={
-      [
-        "default_msbuild",
-      ]
-    }
-    translationKey="onboarding.tutorial.with.jenkins.dotnet.msbuild.prereqs.title"
-  />
-  <Alert
-    className="spacer-top"
-    variant="info"
-  >
-    onboarding.tutorial.with.jenkins.dotnet.msbuild.prereqs.info
-  </Alert>
-  <ol
-    className="list-styled list-roman"
-  >
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "msbuild",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.dotnet.msbuild.prereqs.step1"
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "path",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.dotnet.msbuild.prereqs.step2"
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "msbuild",
-            "add_msbuild",
-            "name",
-            "msbuild_plugin",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.dotnet.msbuild.prereqs.step3"
-      />
-      <code
-        className="rule"
-      >
-        Default MSBuild
-      </code>
-      <ClipboardIconButton
-        copyValue="Default MSBuild"
-      />
-    </li>
-  </ol>
-</li>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/DotNetPrereqsScanner-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/DotNetPrereqsScanner-test.tsx.snap
deleted file mode 100644 (file)
index 50ac585..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<li
-  className="abs-width-600"
->
-  <SentenceWithHighlights
-    highlightKeys={
-      [
-        "default_scanner",
-      ]
-    }
-    translationKey="onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.title"
-  />
-  <Alert
-    className="spacer-top"
-    variant="info"
-  >
-    onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.info
-  </Alert>
-  <ol
-    className="list-styled list-roman"
-  >
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "path",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.step1"
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "default_scanner",
-            "add_scanner_for_msbuild",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.step2"
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "name",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.step3"
-      />
-      <code
-        className="rule"
-      >
-        SonarScanner for MSBuild
-      </code>
-      <ClipboardIconButton
-        copyValue="SonarScanner for MSBuild"
-      />
-    </li>
-    <li>
-      <SentenceWithHighlights
-        highlightKeys={
-          [
-            "install_from",
-          ]
-        }
-        translationKey="onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.step5"
-      />
-    </li>
-  </ol>
-</li>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/Gradle-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/Gradle-test.tsx.snap
deleted file mode 100644 (file)
index b231c34..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<Fragment>
-  <li
-    className="abs-width-600"
-  >
-    <SentenceWithFilename
-      filename="build.gradle"
-      translationKey="onboarding.tutorial.with.jenkins.jenkinsfile.gradle.step2"
-    />
-    <CodeSnippet
-      snippet="plugins {
-  id "org.sonarqube" version "3.5.0.2730"
-}
-
-sonar {
-  properties {
-    property "sonar.projectKey", "my-project"
-    property "sonar.projectName", "MyProject"
-  }
-}"
-    />
-  </li>
-  <CreateJenkinsfileBulletPoint
-    snippet="node {
-  stage('SCM') {
-    checkout scm
-  }
-  stage('SonarQube Analysis') {
-    withSonarQubeEnv() {
-      sh "./gradlew sonar"
-    }
-  }
-}"
-  />
-  <FinishButton
-    onClick={[MockFunction]}
-  />
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/Maven-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/Maven-test.tsx.snap
deleted file mode 100644 (file)
index 185cf0b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<Fragment>
-  <CreateJenkinsfileBulletPoint
-    alertTranslationKeyPart="onboarding.tutorial.with.jenkins.jenkinsfile.maven.step3"
-    snippet="node {
-  stage('SCM') {
-    checkout scm
-  }
-  stage('SonarQube Analysis') {
-    def mvn = tool 'Default Maven';
-    withSonarQubeEnv() {
-      sh "\${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=my-project -Dsonar.projectName='MyProject'"
-    }
-  }
-}"
-  />
-  <FinishButton
-    onClick={[MockFunction]}
-  />
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/Other-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/__tests__/__snapshots__/Other-test.tsx.snap
deleted file mode 100644 (file)
index 3a68d7c..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<Fragment>
-  <DefaultProjectKey
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-  <CreateJenkinsfileBulletPoint
-    alertTranslationKeyPart="onboarding.tutorial.with.jenkins.jenkinsfile.other.step3"
-    snippet="node {
-  stage('SCM') {
-    checkout scm
-  }
-  stage('SonarQube Analysis') {
-    def scannerHome = tool 'SonarScanner';
-    withSonarQubeEnv() {
-      sh "\${scannerHome}/bin/sonar-scanner"
-    }
-  }
-}"
-  />
-  <FinishButton
-    onClick={[MockFunction]}
-  />
-</Fragment>
-`;
index d7c7133c872b3861ba77d269625612f4678927a8..42d50464aae9f54416438bb62d139736e793c462 100644 (file)
@@ -26,7 +26,11 @@ import UserTokensMock from '../../../../api/mocks/UserTokensMock';
 import { mockComponent } from '../../../../helpers/mocks/component';
 import { mockLanguage, mockLoggedInUser } from '../../../../helpers/testMocks';
 import { renderApp, RenderContext } from '../../../../helpers/testReactTestingUtils';
-import { getCopyToClipboardValue, getTutorialBuildButtons } from '../../test-utils';
+import {
+  getCopyToClipboardValue,
+  getTutorialActionButtons,
+  getTutorialBuildButtons,
+} from '../../test-utils';
 import OtherTutorial from '../OtherTutorial';
 
 jest.mock('../../../../api/user-tokens');
@@ -48,11 +52,9 @@ const ui = {
   existingTokenRadio: byRole('radio', { name: 'onboarding.token.use_existing_token' }),
   tokenNameInput: byRole('textbox', { name: 'onboarding.token.name.label' }),
   expiresInSelect: byRole('combobox', { name: '' }),
-  generateTokenButton: byRole('button', { name: 'onboarding.token.generate' }),
-  deleteTokenButton: byRole('button', { name: 'onboarding.token.delete' }),
   tokenValueInput: byRole('textbox', { name: 'onboarding.token.use_existing_token.label' }),
   invalidTokenValueMessage: byText('onboarding.token.invalid_format'),
-  continueButton: byRole('button', { name: 'continue' }),
+  ...getTutorialActionButtons(),
   ...getTutorialBuildButtons(),
 };
 
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/AnalysisCommand-test.tsx b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/AnalysisCommand-test.tsx
deleted file mode 100644 (file)
index 9427ff0..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import { BuildTools, OSs } from '../../../types';
-import AnalysisCommand, { AnalysisCommandProps } from '../AnalysisCommand';
-
-jest.mock('../../../../../helpers/urls', () => ({
-  getHostUrl: () => 'HOST',
-}));
-
-it('renders correctly', () => {
-  expect(shallowRender({ languageConfig: { buildTool: BuildTools.Gradle } })).toMatchSnapshot(
-    'gradle'
-  );
-  expect(shallowRender({ languageConfig: { buildTool: BuildTools.Maven } })).toMatchSnapshot(
-    'maven'
-  );
-  expect(shallowRender({ languageConfig: { buildTool: BuildTools.DotNet } })).toMatchSnapshot(
-    '.NET'
-  );
-  expect(
-    shallowRender({ languageConfig: { buildTool: BuildTools.CFamily, os: OSs.Linux } })
-  ).toMatchSnapshot('CFamily');
-  expect(shallowRender({ languageConfig: { buildTool: BuildTools.CFamily } })).toMatchSnapshot(
-    'Empty CFamily'
-  );
-  expect(
-    shallowRender({ languageConfig: { buildTool: BuildTools.Other, os: OSs.Windows } })
-  ).toMatchSnapshot('other');
-});
-
-function shallowRender(props: Partial<AnalysisCommandProps> = {}) {
-  return shallow<AnalysisCommandProps>(
-    <AnalysisCommand
-      component={mockComponent()}
-      baseUrl="http://example.com"
-      isLocal={true}
-      languageConfig={{}}
-      token="myToken"
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/CLangGCCCommand-test.tsx b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/CLangGCCCommand-test.tsx
deleted file mode 100644 (file)
index 1e0ecfb..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import { OSs } from '../../../types';
-import ClangGCCCommand from '../ClangGCCCommand';
-
-it('should render correctly', () => {
-  expect(
-    shallow(
-      <ClangGCCCommand
-        os={OSs.Linux}
-        baseUrl="http://example.com"
-        isLocal={true}
-        component={mockComponent({ key: 'projectKey' })}
-        token="token"
-      />
-    )
-  ).toMatchSnapshot();
-});
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DotNet-test.tsx b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DotNet-test.tsx
deleted file mode 100644 (file)
index 3228f32..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import DotNet from '../DotNet';
-
-it('should render correctly', () => {
-  expect(
-    shallow(
-      <DotNet baseUrl="host" component={mockComponent({ key: 'projectKey' })} token="token" />
-    )
-  ).toMatchSnapshot();
-});
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DotNetExecute-test.tsx b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DotNetExecute-test.tsx
deleted file mode 100644 (file)
index e22e7c0..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import DotNetExecute from '../DotNetExecute';
-
-it('should render correctly', () => {
-  expect(
-    shallow(<DotNetExecute commands={['command1', 'command2']} component={mockComponent()} />)
-  ).toMatchSnapshot();
-});
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DotNetFramework-test.tsx b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DotNetFramework-test.tsx
deleted file mode 100644 (file)
index 84bac88..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import DotNetFramework from '../DotNetFramework';
-
-it('should render correctly', () => {
-  expect(
-    shallow(
-      <DotNetFramework
-        baseUrl="host"
-        component={mockComponent({ key: 'projectKey' })}
-        token="token"
-      />
-    )
-  ).toMatchSnapshot();
-});
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DotnetCore-test.tsx b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DotnetCore-test.tsx
deleted file mode 100644 (file)
index 432c1fd..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import DotNetCore from '../DotNetCore';
-
-it('should render correctly', () => {
-  expect(
-    shallow(
-      <DotNetCore baseUrl="host" component={mockComponent({ key: 'projectKey' })} token="token" />
-    )
-  ).toMatchSnapshot();
-});
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DownloadBuildWrapper-test.tsx b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DownloadBuildWrapper-test.tsx
deleted file mode 100644 (file)
index 4022b42..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { OSs } from '../../../types';
-import DownloadBuildWrapper, { DownloadBuildWrapperProps } from '../DownloadBuildWrapper';
-
-it.each([OSs.Linux, OSs.Windows, OSs.MacOS])('should render correctly for %p', (os) => {
-  expect(shallowRender({ os, isLocal: false })).toMatchSnapshot('remote');
-  expect(shallowRender({ os })).toMatchSnapshot('local');
-});
-
-function shallowRender(props: Partial<DownloadBuildWrapperProps> = {}) {
-  return shallow<DownloadBuildWrapperProps>(
-    <DownloadBuildWrapper baseUrl="http://example.com" isLocal={true} os={OSs.Linux} {...props} />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DownloadScanner-test.tsx b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/DownloadScanner-test.tsx
deleted file mode 100644 (file)
index 0c14984..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { OSs } from '../../../types';
-import DownloadScanner, { DownloadScannerProps } from '../DownloadScanner';
-
-it.each([OSs.Linux, OSs.Windows, OSs.MacOS])('should render correctly for %p', (os) => {
-  expect(shallowRender({ isLocal: false, os })).toMatchSnapshot('remote');
-  expect(shallowRender({ os })).toMatchSnapshot('local');
-});
-
-function shallowRender(props: Partial<DownloadScannerProps> = {}) {
-  return shallow<DownloadScannerProps>(
-    <DownloadScanner isLocal={true} os={OSs.Linux} token="token" {...props} />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/ExecBuildWrapper-test.tsx b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/ExecBuildWrapper-test.tsx
deleted file mode 100644 (file)
index 9470d9e..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { OSs } from '../../../types';
-import ExecBuildWrapper from '../ExecBuildWrapper';
-
-it.each([OSs.Linux, OSs.Windows, OSs.MacOS])('Shoud renders for %p correctly', (os) => {
-  expect(shallow(<ExecBuildWrapper os={os} />)).toMatchSnapshot();
-});
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/ExecScanner-test.tsx b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/ExecScanner-test.tsx
deleted file mode 100644 (file)
index 3306e6f..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import { OSs } from '../../../types';
-import ExecScanner, { ExecScannerProps } from '../ExecScanner';
-
-it.each([OSs.Linux, OSs.Windows, OSs.MacOS])('should render correctly for %p', (os) => {
-  expect(shallowRender({ os })).toMatchSnapshot();
-});
-
-it('should render correctly for cfamily', () => {
-  expect(shallowRender({ cfamily: true })).toMatchSnapshot();
-});
-
-it('should render correctly for remote execution', () => {
-  expect(shallowRender({ isLocal: false })).toMatchSnapshot();
-});
-
-function shallowRender(props: Partial<ExecScannerProps> = {}) {
-  return shallow<ExecScannerProps>(
-    <ExecScanner
-      baseUrl="host"
-      isLocal={true}
-      os={OSs.Linux}
-      component={mockComponent({ key: 'projectKey' })}
-      token="token"
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/JavaGradle-test.tsx b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/JavaGradle-test.tsx
deleted file mode 100644 (file)
index 794c4e8..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import JavaGradle from '../JavaGradle';
-
-it('renders correctly', () => {
-  expect(
-    shallow(
-      <JavaGradle baseUrl="host" component={mockComponent({ key: 'projectKey' })} token="token" />
-    )
-  ).toMatchSnapshot();
-});
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/JavaMaven-test.tsx b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/JavaMaven-test.tsx
deleted file mode 100644 (file)
index 3e8f5a9..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import JavaMaven from '../JavaMaven';
-
-it('renders correctly', () => {
-  expect(
-    shallow(
-      <JavaMaven baseUrl="host" component={mockComponent({ key: 'projectKey' })} token="token" />
-    )
-  ).toMatchSnapshot();
-});
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/Other-test.tsx b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/Other-test.tsx
deleted file mode 100644 (file)
index f4c12c2..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-import { shallow } from 'enzyme';
-import * as React from 'react';
-import { mockComponent } from '../../../../../helpers/mocks/component';
-import { OSs } from '../../../types';
-import Other, { OtherProps } from '../Other';
-
-it('renders correctly', () => {
-  expect(shallowRender()).toMatchSnapshot();
-});
-
-function shallowRender(props: Partial<OtherProps> = {}) {
-  return shallow<OtherProps>(
-    <Other
-      baseUrl="host"
-      isLocal={true}
-      os={OSs.Linux}
-      component={mockComponent({ key: 'projectKey' })}
-      token="token"
-      {...props}
-    />
-  );
-}
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/AnalysisCommand-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/AnalysisCommand-test.tsx.snap
deleted file mode 100644 (file)
index ca8fa01..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`renders correctly: .NET 1`] = `
-<DotNet
-  baseUrl="http://example.com"
-  component={
-    {
-      "breadcrumbs": [],
-      "key": "my-project",
-      "name": "MyProject",
-      "qualifier": "TRK",
-      "qualityGate": {
-        "isDefault": true,
-        "key": "30",
-        "name": "Sonar way",
-      },
-      "qualityProfiles": [
-        {
-          "deleted": false,
-          "key": "my-qp",
-          "language": "ts",
-          "name": "Sonar way",
-        },
-      ],
-      "tags": [],
-    }
-  }
-  token="myToken"
-/>
-`;
-
-exports[`renders correctly: CFamily 1`] = `
-<ClangGCCCustom
-  baseUrl="http://example.com"
-  component={
-    {
-      "breadcrumbs": [],
-      "key": "my-project",
-      "name": "MyProject",
-      "qualifier": "TRK",
-      "qualityGate": {
-        "isDefault": true,
-        "key": "30",
-        "name": "Sonar way",
-      },
-      "qualityProfiles": [
-        {
-          "deleted": false,
-          "key": "my-qp",
-          "language": "ts",
-          "name": "Sonar way",
-        },
-      ],
-      "tags": [],
-    }
-  }
-  isLocal={true}
-  os="linux"
-  token="myToken"
-/>
-`;
-
-exports[`renders correctly: Empty CFamily 1`] = `""`;
-
-exports[`renders correctly: gradle 1`] = `
-<JavaGradle
-  baseUrl="http://example.com"
-  component={
-    {
-      "breadcrumbs": [],
-      "key": "my-project",
-      "name": "MyProject",
-      "qualifier": "TRK",
-      "qualityGate": {
-        "isDefault": true,
-        "key": "30",
-        "name": "Sonar way",
-      },
-      "qualityProfiles": [
-        {
-          "deleted": false,
-          "key": "my-qp",
-          "language": "ts",
-          "name": "Sonar way",
-        },
-      ],
-      "tags": [],
-    }
-  }
-  token="myToken"
-/>
-`;
-
-exports[`renders correctly: maven 1`] = `
-<JavaMaven
-  baseUrl="http://example.com"
-  component={
-    {
-      "breadcrumbs": [],
-      "key": "my-project",
-      "name": "MyProject",
-      "qualifier": "TRK",
-      "qualityGate": {
-        "isDefault": true,
-        "key": "30",
-        "name": "Sonar way",
-      },
-      "qualityProfiles": [
-        {
-          "deleted": false,
-          "key": "my-qp",
-          "language": "ts",
-          "name": "Sonar way",
-        },
-      ],
-      "tags": [],
-    }
-  }
-  token="myToken"
-/>
-`;
-
-exports[`renders correctly: other 1`] = `
-<Other
-  baseUrl="http://example.com"
-  component={
-    {
-      "breadcrumbs": [],
-      "key": "my-project",
-      "name": "MyProject",
-      "qualifier": "TRK",
-      "qualityGate": {
-        "isDefault": true,
-        "key": "30",
-        "name": "Sonar way",
-      },
-      "qualityProfiles": [
-        {
-          "deleted": false,
-          "key": "my-qp",
-          "language": "ts",
-          "name": "Sonar way",
-        },
-      ],
-      "tags": [],
-    }
-  }
-  isLocal={true}
-  os="win"
-  token="myToken"
-/>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/CLangGCCCommand-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/CLangGCCCommand-test.tsx.snap
deleted file mode 100644 (file)
index a9ac958..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<div>
-  <DownloadBuildWrapper
-    baseUrl="http://example.com"
-    isLocal={true}
-    os="linux"
-  />
-  <DownloadScanner
-    isLocal={true}
-    os="linux"
-    token="token"
-  />
-  <ExecBuildWrapper
-    os="linux"
-  />
-  <CompilationInfo />
-  <ExecScanner
-    baseUrl="http://example.com"
-    cfamily={true}
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "projectKey",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-    isLocal={true}
-    os="linux"
-    token="token"
-  />
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DotNet-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DotNet-test.tsx.snap
deleted file mode 100644 (file)
index 154a186..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<Fragment>
-  <RenderOptions
-    checked="dotnet_core"
-    label="onboarding.build.other.os"
-    onCheck={[Function]}
-    optionLabelKey="onboarding.build.dotnet.variant"
-    options={
-      [
-        "dotnet_core",
-        "dotnet_framework",
-      ]
-    }
-    titleLabelKey="onboarding.build.dotnet.variant"
-  />
-  <DotNetCore
-    baseUrl="host"
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "projectKey",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-    token="token"
-  />
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DotNetExecute-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DotNetExecute-test.tsx.snap
deleted file mode 100644 (file)
index 7f477eb..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<Fragment>
-  <h4
-    className="huge-spacer-top spacer-bottom"
-  >
-    onboarding.analysis.sq_scanner.execute
-  </h4>
-  <InstanceMessage
-    message="onboarding.analysis.msbuild.execute.text"
-  >
-    <Component />
-  </InstanceMessage>
-  <CodeSnippet
-    key="0"
-    snippet="command1"
-  />
-  <CodeSnippet
-    key="1"
-    snippet="command2"
-  />
-  <p
-    className="big-spacer-top markdown"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.analysis.docs"
-      id="onboarding.analysis.docs"
-      values={
-        {
-          "link": <withAppStateContext(DocLink)
-            to="/analyzing-source-code/scanners/sonarscanner-for-dotnet/"
-          >
-            onboarding.analysis.msbuild.docs_link
-          </withAppStateContext(DocLink)>,
-        }
-      }
-    />
-  </p>
-  <DoneNextSteps
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "my-project",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DotNetFramework-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DotNetFramework-test.tsx.snap
deleted file mode 100644 (file)
index 3145cee..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<div>
-  <div>
-    <h4
-      className="spacer-bottom huge-spacer-top"
-    >
-      onboarding.analysis.msbuild.header
-    </h4>
-    <p
-      className="markdown"
-    >
-      <FormattedMessage
-        defaultMessage="onboarding.analysis.msbuild.text"
-        id="onboarding.analysis.msbuild.text"
-        values={
-          {
-            "code": <code>
-              %PATH%
-            </code>,
-            "link": <withAppStateContext(DocLink)
-              to="/analyzing-source-code/scanners/sonarscanner-for-dotnet/"
-            >
-              onboarding.analysis.msbuild.docs_link
-            </withAppStateContext(DocLink)>,
-          }
-        }
-      />
-    </p>
-  </div>
-  <DotNetExecute
-    commands={
-      [
-        "SonarScanner.MSBuild.exe begin /k:"projectKey" /d:sonar.host.url="host" /d:sonar.login="token"",
-        "MsBuild.exe /t:Rebuild",
-        "SonarScanner.MSBuild.exe end /d:sonar.login="token"",
-      ]
-    }
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "projectKey",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DotnetCore-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DotnetCore-test.tsx.snap
deleted file mode 100644 (file)
index a24b6be..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly 1`] = `
-<div>
-  <h4
-    className="huge-spacer-top spacer-bottom"
-  >
-    onboarding.analysis.dotnetcore.global
-  </h4>
-  <p
-    className="big-spacer-top markdown"
-  >
-    onboarding.analysis.dotnetcore.global.text
-  </p>
-  <CodeSnippet
-    snippet="dotnet tool install --global dotnet-sonarscanner"
-  />
-  <Alert
-    className="spacer-top"
-    variant="info"
-  >
-    onboarding.analysis.dotnetcore.global.text.path
-  </Alert>
-  <DotNetExecute
-    commands={
-      [
-        "dotnet sonarscanner begin /k:"projectKey" /d:sonar.host.url="host"  /d:sonar.login="token"",
-        "dotnet build",
-        "dotnet sonarscanner end /d:sonar.login="token"",
-      ]
-    }
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "projectKey",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DownloadBuildWrapper-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DownloadBuildWrapper-test.tsx.snap
deleted file mode 100644 (file)
index 42c9604..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly for "linux": local 1`] = `
-<div
-  className="spacer-bottom"
->
-  <h4
-    className="spacer-bottom"
-  >
-    onboarding.analysis.build_wrapper.header.linux
-  </h4>
-  <p
-    className="spacer-bottom markdown"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.analysis.build_wrapper.text"
-      id="onboarding.analysis.build_wrapper.text"
-      values={
-        {
-          "env_var": <code>
-            PATH
-          </code>,
-        }
-      }
-    />
-  </p>
-  <p>
-    <a
-      className="button"
-      download="build-wrapper-linux-x86.zip"
-      href="/static/cpp/build-wrapper-linux-x86.zip"
-      rel="noopener noreferrer"
-      target="_blank"
-    >
-      download_verb
-    </a>
-  </p>
-</div>
-`;
-
-exports[`should render correctly for "linux": remote 1`] = `
-<div
-  className="spacer-bottom"
->
-  <h4
-    className="spacer-bottom"
-  >
-    onboarding.analysis.build_wrapper.header.linux
-  </h4>
-  <CodeSnippet
-    snippet="curl --create-dirs -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip http://example.com/static/cpp/build-wrapper-linux-x86.zip
-unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
-export PATH=$HOME/.sonar/build-wrapper-linux-x86:$PATH
-"
-  />
-</div>
-`;
-
-exports[`should render correctly for "mac": local 1`] = `
-<div
-  className="spacer-bottom"
->
-  <h4
-    className="spacer-bottom"
-  >
-    onboarding.analysis.build_wrapper.header.mac
-  </h4>
-  <p
-    className="spacer-bottom markdown"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.analysis.build_wrapper.text"
-      id="onboarding.analysis.build_wrapper.text"
-      values={
-        {
-          "env_var": <code>
-            PATH
-          </code>,
-        }
-      }
-    />
-  </p>
-  <p>
-    <a
-      className="button"
-      download="build-wrapper-macosx-x86.zip"
-      href="/static/cpp/build-wrapper-macosx-x86.zip"
-      rel="noopener noreferrer"
-      target="_blank"
-    >
-      download_verb
-    </a>
-  </p>
-</div>
-`;
-
-exports[`should render correctly for "mac": remote 1`] = `
-<div
-  className="spacer-bottom"
->
-  <h4
-    className="spacer-bottom"
-  >
-    onboarding.analysis.build_wrapper.header.mac
-  </h4>
-  <CodeSnippet
-    snippet="curl --create-dirs -sSLo $HOME/.sonar/build-wrapper-macosx-x86.zip http://example.com/static/cpp/build-wrapper-macosx-x86.zip
-unzip -o $HOME/.sonar/build-wrapper-macosx-x86.zip -d $HOME/.sonar/
-export PATH=$HOME/.sonar/build-wrapper-macosx-x86:$PATH
-"
-  />
-</div>
-`;
-
-exports[`should render correctly for "win": local 1`] = `
-<div
-  className="spacer-bottom"
->
-  <h4
-    className="spacer-bottom"
-  >
-    onboarding.analysis.build_wrapper.header.win
-  </h4>
-  <p
-    className="spacer-bottom markdown"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.analysis.build_wrapper.text"
-      id="onboarding.analysis.build_wrapper.text"
-      values={
-        {
-          "env_var": <code>
-            %PATH%
-          </code>,
-        }
-      }
-    />
-  </p>
-  <p>
-    <a
-      className="button"
-      download="build-wrapper-win-x86.zip"
-      href="/static/cpp/build-wrapper-win-x86.zip"
-      rel="noopener noreferrer"
-      target="_blank"
-    >
-      download_verb
-    </a>
-  </p>
-</div>
-`;
-
-exports[`should render correctly for "win": remote 1`] = `
-<div
-  className="spacer-bottom"
->
-  <h4
-    className="spacer-bottom"
-  >
-    onboarding.analysis.build_wrapper.header.win
-  </h4>
-  <CodeSnippet
-    snippet="$env:SONAR_DIRECTORY = [System.IO.Path]::Combine($(get-location).Path,".sonar")
-rm "$env:SONAR_DIRECTORY/build-wrapper-win-x86" -Force -Recurse -ErrorAction SilentlyContinue
-New-Item -path $env:SONAR_DIRECTORY/build-wrapper-win-x86 -type directory
-(New-Object System.Net.WebClient).DownloadFile("http://example.com/static/cpp/build-wrapper-win-x86.zip", "$env:SONAR_DIRECTORY/build-wrapper-win-x86.zip")
-Add-Type -AssemblyName System.IO.Compression.FileSystem
-[System.IO.Compression.ZipFile]::ExtractToDirectory("$env:SONAR_DIRECTORY/build-wrapper-win-x86.zip", "$env:SONAR_DIRECTORY")
-$env:Path += ";$env:SONAR_DIRECTORY/build-wrapper-win-x86"
-"
-  />
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DownloadScanner-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/DownloadScanner-test.tsx.snap
deleted file mode 100644 (file)
index d935a16..0000000
+++ /dev/null
@@ -1,273 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly for "linux": local 1`] = `
-<div>
-  <h4
-    className="spacer-bottom"
-  >
-    onboarding.analysis.sq_scanner.header.linux
-  </h4>
-  <p
-    className="spacer-bottom markdown"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.analysis.sq_scanner.text"
-      id="onboarding.analysis.sq_scanner.text"
-      values={
-        {
-          "dir": <code>
-            bin
-          </code>,
-          "env_var": <code>
-            PATH
-          </code>,
-          "link": <withAppStateContext(DocLink)
-            to="/analyzing-source-code/scanners/sonarscanner/"
-          >
-            onboarding.analysis.sq_scanner.docs_link
-          </withAppStateContext(DocLink)>,
-        }
-      }
-    />
-  </p>
-</div>
-`;
-
-exports[`should render correctly for "linux": remote 1`] = `
-<div>
-  <h4
-    className="spacer-bottom"
-  >
-    onboarding.analysis.sq_scanner.header.linux
-  </h4>
-  <CodeSnippet
-    snippet="export SONAR_SCANNER_VERSION=4.7.0.2747
-export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
-curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
-unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
-export PATH=$SONAR_SCANNER_HOME/bin:$PATH
-export SONAR_SCANNER_OPTS="-server"
-"
-  />
-  <h4
-    className="spacer-bottom big-spacer-top"
-  >
-    onboarding.analysis.sq_scanner.sonar_token_env.header
-  </h4>
-  <ul
-    className="list-styled"
-  >
-    <li
-      className="markdown"
-    >
-      onboarding.analysis.sq_scanner.sonar_token_env.var_name
-      :
-       
-      <code>
-        SONAR_TOKEN
-      </code>
-      <ClipboardButton
-        className="spacer-left"
-        copyValue="SONAR_TOKEN"
-      />
-    </li>
-    <li
-      className="markdown"
-    >
-      onboarding.analysis.sq_scanner.sonar_token_env.var_value
-      :
-       
-      <code>
-        token
-      </code>
-      <ClipboardButton
-        className="spacer-left"
-        copyValue="token"
-      />
-    </li>
-  </ul>
-</div>
-`;
-
-exports[`should render correctly for "mac": local 1`] = `
-<div>
-  <h4
-    className="spacer-bottom"
-  >
-    onboarding.analysis.sq_scanner.header.mac
-  </h4>
-  <p
-    className="spacer-bottom markdown"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.analysis.sq_scanner.text"
-      id="onboarding.analysis.sq_scanner.text"
-      values={
-        {
-          "dir": <code>
-            bin
-          </code>,
-          "env_var": <code>
-            PATH
-          </code>,
-          "link": <withAppStateContext(DocLink)
-            to="/analyzing-source-code/scanners/sonarscanner/"
-          >
-            onboarding.analysis.sq_scanner.docs_link
-          </withAppStateContext(DocLink)>,
-        }
-      }
-    />
-  </p>
-</div>
-`;
-
-exports[`should render correctly for "mac": remote 1`] = `
-<div>
-  <h4
-    className="spacer-bottom"
-  >
-    onboarding.analysis.sq_scanner.header.mac
-  </h4>
-  <CodeSnippet
-    snippet="export SONAR_SCANNER_VERSION=4.7.0.2747
-export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-macosx
-curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-macosx.zip
-unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
-export PATH=$SONAR_SCANNER_HOME/bin:$PATH
-export SONAR_SCANNER_OPTS="-server"
-"
-  />
-  <h4
-    className="spacer-bottom big-spacer-top"
-  >
-    onboarding.analysis.sq_scanner.sonar_token_env.header
-  </h4>
-  <ul
-    className="list-styled"
-  >
-    <li
-      className="markdown"
-    >
-      onboarding.analysis.sq_scanner.sonar_token_env.var_name
-      :
-       
-      <code>
-        SONAR_TOKEN
-      </code>
-      <ClipboardButton
-        className="spacer-left"
-        copyValue="SONAR_TOKEN"
-      />
-    </li>
-    <li
-      className="markdown"
-    >
-      onboarding.analysis.sq_scanner.sonar_token_env.var_value
-      :
-       
-      <code>
-        token
-      </code>
-      <ClipboardButton
-        className="spacer-left"
-        copyValue="token"
-      />
-    </li>
-  </ul>
-</div>
-`;
-
-exports[`should render correctly for "win": local 1`] = `
-<div>
-  <h4
-    className="spacer-bottom"
-  >
-    onboarding.analysis.sq_scanner.header.win
-  </h4>
-  <p
-    className="spacer-bottom markdown"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.analysis.sq_scanner.text"
-      id="onboarding.analysis.sq_scanner.text"
-      values={
-        {
-          "dir": <code>
-            bin
-          </code>,
-          "env_var": <code>
-            %PATH%
-          </code>,
-          "link": <withAppStateContext(DocLink)
-            to="/analyzing-source-code/scanners/sonarscanner/"
-          >
-            onboarding.analysis.sq_scanner.docs_link
-          </withAppStateContext(DocLink)>,
-        }
-      }
-    />
-  </p>
-</div>
-`;
-
-exports[`should render correctly for "win": remote 1`] = `
-<div>
-  <h4
-    className="spacer-bottom"
-  >
-    onboarding.analysis.sq_scanner.header.win
-  </h4>
-  <CodeSnippet
-    snippet="$env:SONAR_SCANNER_VERSION = "4.7.0.2747"
-$env:SONAR_DIRECTORY = [System.IO.Path]::Combine($(get-location).Path,".sonar")
-$env:SONAR_SCANNER_HOME = "$env:SONAR_DIRECTORY/sonar-scanner-$env:SONAR_SCANNER_VERSION-windows"
-rm $env:SONAR_SCANNER_HOME -Force -Recurse -ErrorAction SilentlyContinue
-New-Item -path $env:SONAR_SCANNER_HOME -type directory
-(New-Object System.Net.WebClient).DownloadFile("https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$env:SONAR_SCANNER_VERSION-windows.zip", "$env:SONAR_DIRECTORY/sonar-scanner.zip")
-Add-Type -AssemblyName System.IO.Compression.FileSystem
-[System.IO.Compression.ZipFile]::ExtractToDirectory("$env:SONAR_DIRECTORY/sonar-scanner.zip", "$env:SONAR_DIRECTORY")
-rm ./.sonar/sonar-scanner.zip -Force -ErrorAction SilentlyContinue
-$env:Path += ";$env:SONAR_SCANNER_HOME/bin"
-$env:SONAR_SCANNER_OPTS="-server"
-"
-  />
-  <h4
-    className="spacer-bottom big-spacer-top"
-  >
-    onboarding.analysis.sq_scanner.sonar_token_env.header
-  </h4>
-  <ul
-    className="list-styled"
-  >
-    <li
-      className="markdown"
-    >
-      onboarding.analysis.sq_scanner.sonar_token_env.var_name
-      :
-       
-      <code>
-        SONAR_TOKEN
-      </code>
-      <ClipboardButton
-        className="spacer-left"
-        copyValue="SONAR_TOKEN"
-      />
-    </li>
-    <li
-      className="markdown"
-    >
-      onboarding.analysis.sq_scanner.sonar_token_env.var_value
-      :
-       
-      <code>
-        token
-      </code>
-      <ClipboardButton
-        className="spacer-left"
-        copyValue="token"
-      />
-    </li>
-  </ul>
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/ExecBuildWrapper-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/ExecBuildWrapper-test.tsx.snap
deleted file mode 100644 (file)
index d0b6e25..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`Shoud renders for "linux" correctly 1`] = `
-<Fragment>
-  <h4
-    className="huge-spacer-top spacer-bottom"
-  >
-    onboarding.analysis.build_wrapper.execute
-  </h4>
-  <p
-    className="spacer-bottom markdown"
-  >
-    onboarding.analysis.build_wrapper.execute_text
-  </p>
-  <CodeSnippet
-    snippet="build-wrapper-linux-x86-64 --out-dir bw-output onboarding.analysis.build_wrapper.execute_build_command"
-  />
-  <p
-    className="big-spacer-top markdown"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.analysis.build_wrapper.docs"
-      id="onboarding.analysis.build_wrapper.docs"
-      values={
-        {
-          "link": <withAppStateContext(DocLink)
-            to="/analyzing-source-code/languages/c-family/"
-          >
-            onboarding.analysis.build_wrapper.docs_link
-          </withAppStateContext(DocLink)>,
-        }
-      }
-    />
-  </p>
-</Fragment>
-`;
-
-exports[`Shoud renders for "mac" correctly 1`] = `
-<Fragment>
-  <h4
-    className="huge-spacer-top spacer-bottom"
-  >
-    onboarding.analysis.build_wrapper.execute
-  </h4>
-  <p
-    className="spacer-bottom markdown"
-  >
-    onboarding.analysis.build_wrapper.execute_text
-  </p>
-  <CodeSnippet
-    snippet="build-wrapper-macosx-x86 --out-dir bw-output onboarding.analysis.build_wrapper.execute_build_command"
-  />
-  <p
-    className="big-spacer-top markdown"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.analysis.build_wrapper.docs"
-      id="onboarding.analysis.build_wrapper.docs"
-      values={
-        {
-          "link": <withAppStateContext(DocLink)
-            to="/analyzing-source-code/languages/c-family/"
-          >
-            onboarding.analysis.build_wrapper.docs_link
-          </withAppStateContext(DocLink)>,
-        }
-      }
-    />
-  </p>
-</Fragment>
-`;
-
-exports[`Shoud renders for "win" correctly 1`] = `
-<Fragment>
-  <h4
-    className="huge-spacer-top spacer-bottom"
-  >
-    onboarding.analysis.build_wrapper.execute
-  </h4>
-  <p
-    className="spacer-bottom markdown"
-  >
-    onboarding.analysis.build_wrapper.execute_text
-  </p>
-  <CodeSnippet
-    snippet="build-wrapper-win-x86-64.exe --out-dir bw-output onboarding.analysis.build_wrapper.execute_build_command"
-  />
-  <p
-    className="big-spacer-top markdown"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.analysis.build_wrapper.docs"
-      id="onboarding.analysis.build_wrapper.docs"
-      values={
-        {
-          "link": <withAppStateContext(DocLink)
-            to="/analyzing-source-code/languages/c-family/"
-          >
-            onboarding.analysis.build_wrapper.docs_link
-          </withAppStateContext(DocLink)>,
-        }
-      }
-    />
-  </p>
-</Fragment>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/ExecScanner-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/ExecScanner-test.tsx.snap
deleted file mode 100644 (file)
index a50a09d..0000000
+++ /dev/null
@@ -1,346 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly for "linux" 1`] = `
-<div>
-  <h4
-    className="big-spacer-top spacer-bottom"
-  >
-    onboarding.analysis.sq_scanner.execute
-  </h4>
-  <InstanceMessage
-    message="onboarding.analysis.sq_scanner.execute.text"
-  >
-    <Component />
-  </InstanceMessage>
-  <CodeSnippet
-    isOneLine={false}
-    snippet={
-      [
-        "sonar-scanner",
-        "-Dsonar.projectKey=projectKey",
-        "-Dsonar.sources=.",
-        undefined,
-        "-Dsonar.host.url=host",
-        "-Dsonar.login=token",
-      ]
-    }
-  />
-  <p
-    className="big-spacer-top markdown"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.analysis.sq_scanner.docs"
-      id="onboarding.analysis.sq_scanner.docs"
-      values={
-        {
-          "link": <withAppStateContext(DocLink)
-            to="/analyzing-source-code/scanners/sonarscanner/"
-          >
-            onboarding.analysis.sq_scanner.docs_link
-          </withAppStateContext(DocLink)>,
-        }
-      }
-    />
-  </p>
-  <DoneNextSteps
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "projectKey",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-</div>
-`;
-
-exports[`should render correctly for "mac" 1`] = `
-<div>
-  <h4
-    className="big-spacer-top spacer-bottom"
-  >
-    onboarding.analysis.sq_scanner.execute
-  </h4>
-  <InstanceMessage
-    message="onboarding.analysis.sq_scanner.execute.text"
-  >
-    <Component />
-  </InstanceMessage>
-  <CodeSnippet
-    isOneLine={false}
-    snippet={
-      [
-        "sonar-scanner",
-        "-Dsonar.projectKey=projectKey",
-        "-Dsonar.sources=.",
-        undefined,
-        "-Dsonar.host.url=host",
-        "-Dsonar.login=token",
-      ]
-    }
-  />
-  <p
-    className="big-spacer-top markdown"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.analysis.sq_scanner.docs"
-      id="onboarding.analysis.sq_scanner.docs"
-      values={
-        {
-          "link": <withAppStateContext(DocLink)
-            to="/analyzing-source-code/scanners/sonarscanner/"
-          >
-            onboarding.analysis.sq_scanner.docs_link
-          </withAppStateContext(DocLink)>,
-        }
-      }
-    />
-  </p>
-  <DoneNextSteps
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "projectKey",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-</div>
-`;
-
-exports[`should render correctly for "win" 1`] = `
-<div>
-  <h4
-    className="big-spacer-top spacer-bottom"
-  >
-    onboarding.analysis.sq_scanner.execute
-  </h4>
-  <InstanceMessage
-    message="onboarding.analysis.sq_scanner.execute.text"
-  >
-    <Component />
-  </InstanceMessage>
-  <CodeSnippet
-    isOneLine={true}
-    snippet={
-      [
-        "sonar-scanner.bat",
-        "-D"sonar.projectKey=projectKey"",
-        "-D"sonar.sources=."",
-        undefined,
-        "-D"sonar.host.url=host"",
-        "-D"sonar.login=token"",
-      ]
-    }
-  />
-  <p
-    className="big-spacer-top markdown"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.analysis.sq_scanner.docs"
-      id="onboarding.analysis.sq_scanner.docs"
-      values={
-        {
-          "link": <withAppStateContext(DocLink)
-            to="/analyzing-source-code/scanners/sonarscanner/"
-          >
-            onboarding.analysis.sq_scanner.docs_link
-          </withAppStateContext(DocLink)>,
-        }
-      }
-    />
-  </p>
-  <DoneNextSteps
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "projectKey",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-</div>
-`;
-
-exports[`should render correctly for cfamily 1`] = `
-<div>
-  <h4
-    className="big-spacer-top spacer-bottom"
-  >
-    onboarding.analysis.sq_scanner.execute
-  </h4>
-  <InstanceMessage
-    message="onboarding.analysis.sq_scanner.execute.text"
-  >
-    <Component />
-  </InstanceMessage>
-  <CodeSnippet
-    isOneLine={false}
-    snippet={
-      [
-        "sonar-scanner",
-        "-Dsonar.projectKey=projectKey",
-        "-Dsonar.sources=.",
-        "-Dsonar.cfamily.build-wrapper-output=bw-output",
-        "-Dsonar.host.url=host",
-        "-Dsonar.login=token",
-      ]
-    }
-  />
-  <p
-    className="big-spacer-top markdown"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.analysis.sq_scanner.docs"
-      id="onboarding.analysis.sq_scanner.docs"
-      values={
-        {
-          "link": <withAppStateContext(DocLink)
-            to="/analyzing-source-code/scanners/sonarscanner/"
-          >
-            onboarding.analysis.sq_scanner.docs_link
-          </withAppStateContext(DocLink)>,
-        }
-      }
-    />
-  </p>
-  <DoneNextSteps
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "projectKey",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-</div>
-`;
-
-exports[`should render correctly for remote execution 1`] = `
-<div>
-  <h4
-    className="big-spacer-top spacer-bottom"
-  >
-    onboarding.analysis.sq_scanner.execute
-  </h4>
-  <InstanceMessage
-    message="onboarding.analysis.sq_scanner.execute.text"
-  >
-    <Component />
-  </InstanceMessage>
-  <CodeSnippet
-    isOneLine={false}
-    snippet={
-      [
-        "sonar-scanner",
-        "-Dsonar.projectKey=projectKey",
-        "-Dsonar.sources=.",
-        undefined,
-        "-Dsonar.host.url=host",
-        undefined,
-      ]
-    }
-  />
-  <p
-    className="big-spacer-top markdown"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.analysis.sq_scanner.docs"
-      id="onboarding.analysis.sq_scanner.docs"
-      values={
-        {
-          "link": <withAppStateContext(DocLink)
-            to="/analyzing-source-code/scanners/sonarscanner/"
-          >
-            onboarding.analysis.sq_scanner.docs_link
-          </withAppStateContext(DocLink)>,
-        }
-      }
-    />
-  </p>
-  <DoneNextSteps
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "projectKey",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/JavaGradle-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/JavaGradle-test.tsx.snap
deleted file mode 100644 (file)
index 15ad597..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`renders correctly 1`] = `
-<div>
-  <h4
-    className="spacer-bottom"
-  >
-    onboarding.analysis.java.gradle.header
-  </h4>
-  <InstanceMessage
-    message="onboarding.analysis.java.gradle.text.1"
-  >
-    <Component />
-  </InstanceMessage>
-  <CodeSnippet
-    snippet="plugins {
-  id "org.sonarqube" version "3.5.0.2730"
-}"
-  />
-  <p
-    className="big-spacer-bottom markdown"
-  >
-    <em
-      className="small text-muted"
-    >
-      <FormattedMessage
-        defaultMessage="onboarding.analysis.java.gradle.latest_version"
-        id="onboarding.analysis.java.gradle.latest_version"
-        values={
-          {
-            "link": <withAppStateContext(DocLink)
-              to="/analyzing-source-code/scanners/sonarscanner-for-gradle/"
-            >
-              here
-            </withAppStateContext(DocLink)>,
-          }
-        }
-      />
-    </em>
-  </p>
-  <p
-    className="spacer-top spacer-bottom markdown"
-  >
-    onboarding.analysis.java.gradle.text.2
-  </p>
-  <CodeSnippet
-    snippet={
-      [
-        "./gradlew sonar",
-        "-Dsonar.projectKey=projectKey",
-        "-Dsonar.projectName='MyProject'",
-        "-Dsonar.host.url=host",
-        "-Dsonar.login=token",
-      ]
-    }
-  />
-  <p
-    className="big-spacer-top markdown"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.analysis.docs"
-      id="onboarding.analysis.docs"
-      values={
-        {
-          "link": <withAppStateContext(DocLink)
-            to="/analyzing-source-code/scanners/sonarscanner-for-gradle/"
-          >
-            onboarding.analysis.java.gradle.docs_link
-          </withAppStateContext(DocLink)>,
-        }
-      }
-    />
-  </p>
-  <DoneNextSteps
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "projectKey",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/JavaMaven-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/JavaMaven-test.tsx.snap
deleted file mode 100644 (file)
index 6879729..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`renders correctly 1`] = `
-<div>
-  <h4
-    className="spacer-bottom"
-  >
-    onboarding.analysis.java.maven.header
-  </h4>
-  <p
-    className="spacer-bottom markdown"
-  >
-    <InstanceMessage
-      message="onboarding.analysis.java.maven.text"
-    />
-  </p>
-  <CodeSnippet
-    snippet={
-      [
-        "mvn clean verify sonar:sonar",
-        "-Dsonar.projectKey=projectKey",
-        "-Dsonar.projectName='MyProject'",
-        "-Dsonar.host.url=host",
-        "-Dsonar.login=token",
-      ]
-    }
-  />
-  <p
-    className="big-spacer-top markdown"
-  >
-    <FormattedMessage
-      defaultMessage="onboarding.analysis.docs"
-      id="onboarding.analysis.docs"
-      values={
-        {
-          "link": <withAppStateContext(DocLink)
-            to="/analyzing-source-code/scanners/sonarscanner-for-maven/"
-          >
-            onboarding.analysis.java.maven.docs_link
-          </withAppStateContext(DocLink)>,
-        }
-      }
-    />
-  </p>
-  <DoneNextSteps
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "projectKey",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-  />
-</div>
-`;
diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/Other-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/other/commands/__tests__/__snapshots__/Other-test.tsx.snap
deleted file mode 100644 (file)
index 6af41da..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`renders correctly 1`] = `
-<div>
-  <DownloadScanner
-    isLocal={true}
-    os="linux"
-    token="token"
-  />
-  <ExecScanner
-    baseUrl="host"
-    component={
-      {
-        "breadcrumbs": [],
-        "key": "projectKey",
-        "name": "MyProject",
-        "qualifier": "TRK",
-        "qualityGate": {
-          "isDefault": true,
-          "key": "30",
-          "name": "Sonar way",
-        },
-        "qualityProfiles": [
-          {
-            "deleted": false,
-            "key": "my-qp",
-            "language": "ts",
-            "name": "Sonar way",
-          },
-        ],
-        "tags": [],
-      }
-    }
-    isLocal={true}
-    os="linux"
-    token="token"
-  />
-</div>
-`;
index 5ef1aa0f40719a8d184840dcbbb2db019a37618a..f57a2722b0ded44ec0d7e528451a048a4d43008b 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import { screen } from '@testing-library/react';
-import { ShallowWrapper } from 'enzyme';
-import { byRole } from 'testing-library-selector';
-import Step from './components/Step';
-import { BuildTools, OSs } from './types';
+import { byRole, byText } from 'testing-library-selector';
+import { BuildTools, OSs, TutorialModes } from './types';
 
-export function renderStepContent(wrapper: ShallowWrapper<React.ReactNode>, n = 0) {
-  return wrapper.find(Step).at(n).props().renderForm();
-}
+const CI_TRANSLATE_MAP: Partial<Record<TutorialModes, string>> = {
+  [TutorialModes.BitbucketPipelines]: 'bitbucket_pipelines',
+  [TutorialModes.GitHubActions]: 'github_action',
+  [TutorialModes.GitLabCI]: 'gitlab_ci',
+};
 
 export function getCopyToClipboardValue(i = 0, name = 'copy_to_clipboard') {
   return screen.getAllByRole('button', { name })[i].getAttribute('data-clipboard-text');
 }
 
+export function getCommonNodes(ci: TutorialModes) {
+  return {
+    secretsStepTitle: byRole('heading', {
+      name: `onboarding.tutorial.with.${CI_TRANSLATE_MAP[ci]}.${
+        ci === TutorialModes.GitHubActions ? 'create_secret' : 'variables'
+      }.title`,
+    }),
+    ymlFileStepTitle: byRole('heading', {
+      name: `onboarding.tutorial.with.${CI_TRANSLATE_MAP[ci]}.yaml.title`,
+    }),
+    genTokenDialogButton: byRole('button', {
+      name: 'onboarding.token.generate.long',
+    }),
+    tokenNameInput: byRole('textbox', { name: 'onboarding.token.name.label' }),
+    expiresInSelect: byRole('combobox', { name: '' }),
+    tokenValue: byText('generatedtoken2'),
+    linkToRepo: byRole('link', {
+      name: `onboarding.tutorial.with.${CI_TRANSLATE_MAP[ci]}.${
+        ci === TutorialModes.GitHubActions ? 'secret' : 'variables'
+      }.intro.link`,
+    }),
+    allSetSentence: byText('onboarding.tutorial.ci_outro.all_set.sentence'),
+  };
+}
+
+export function getTutorialActionButtons() {
+  return {
+    continueButton: byRole('button', { name: 'continue' }),
+    generateTokenButton: byRole('button', { name: 'onboarding.token.generate' }),
+    deleteTokenButton: byRole('button', { name: 'onboarding.token.delete' }),
+    finishTutorialButton: byRole('button', { name: 'tutorials.finish' }),
+  };
+}
+
 export function getTutorialBuildButtons() {
   return {
     describeBuildTitle: byRole('heading', { name: 'onboarding.build' }),
@@ -39,9 +73,20 @@ export function getTutorialBuildButtons() {
     dotnetBuildButton: byRole('button', { name: `onboarding.build.${BuildTools.DotNet}` }),
     cFamilyBuildButton: byRole('button', { name: `onboarding.build.${BuildTools.CFamily}` }),
     otherBuildButton: byRole('button', { name: `onboarding.build.${BuildTools.Other}` }),
-    dotnetCoreButton: byRole('button', { name: 'onboarding.build.dotnet.variant.dotnet_core' }),
+    windowsDotnetCoreButton: byRole('button', {
+      name: `onboarding.build.${BuildTools.DotNet}.win_core`,
+    }),
+    windowsDotnetFrameworkButton: byRole('button', {
+      name: `onboarding.build.${BuildTools.DotNet}.win_msbuild`,
+    }),
+    linuxDotnetCoreButton: byRole('button', {
+      name: `onboarding.build.${BuildTools.DotNet}.linux_core`,
+    }),
+    dotnetCoreButton: byRole('button', {
+      name: `onboarding.build.${BuildTools.DotNet}.variant.dotnet_core`,
+    }),
     dotnetFrameworkButton: byRole('button', {
-      name: 'onboarding.build.dotnet.variant.dotnet_framework',
+      name: `onboarding.build.${BuildTools.DotNet}.variant.dotnet_framework`,
     }),
     linuxButton: byRole('button', { name: `onboarding.build.other.os.${OSs.Linux}` }),
     windowsButton: byRole('button', { name: `onboarding.build.other.os.${OSs.Windows}` }),
index c54379d9344ef8c963198b6962538cde64eb6d40..b55aa2e688119c944d373d6c64692e8eb8cb02c3 100644 (file)
@@ -3825,7 +3825,7 @@ onboarding.tutorial.with.yaml.gradle=Update your {gradle} file with the {sq} plu
 
 
 
-onboarding.tutorial.with.bitbucket_pipelines.create_secret.title=Create repository variables
+onboarding.tutorial.with.bitbucket_pipelines.variables.title=Create repository variables
 onboarding.tutorial.with.bitbucket_pipelines.yaml.title=Create your pipelines builds configuration
 onboarding.tutorial.with.bitbucket_pipelines.variables.intro=In your Bitbucket repository, go to {repository_variables} and create two new variables:
 onboarding.tutorial.with.bitbucket_pipelines.variables.intro.link=Repository settings > Repository variables
@@ -3856,26 +3856,26 @@ onboarding.tutorial.with.gitlab_ci.project_key.other.step2=Create a {file} file
 onboarding.tutorial.with.gitlab_ci.project_key.dotnet.step2=Create a {file} file in your repository and paste the following code:
 onboarding.tutorial.with.gitlab_ci.project_key.cfamily.step2=Create a {file} file in your repository and paste the following code:
 
-onboarding.tutorial.with.gitlab_ci.env_variables.title=Add environment variables
-onboarding.tutorial.with.gitlab_ci.env_variables.description.link=Settings > CI/CD > Variables
-onboarding.tutorial.with.gitlab_ci.env_variables.section.title=Define the SonarQube Token environment variable.
-onboarding.tutorial.with.gitlab_ci.env_variables.section.description=In GitLab, go to {link} to add the following variable and make sure it is available for your project:
-onboarding.tutorial.with.gitlab_ci.env_variables.edit.token.tooltip=Use an existing token or generate a new one.
-onboarding.tutorial.with.gitlab_ci.env_variables.step1=Key
-
-onboarding.tutorial.with.gitlab_ci.env_variables.step3=Uncheck the {value} checkbox.
-onboarding.tutorial.with.gitlab_ci.env_variables.step3.value=Protect Variable
-onboarding.tutorial.with.gitlab_ci.env_variables.section.step4=Check the {value} checkbox.
-onboarding.tutorial.with.gitlab_ci.env_variables.section.step4.value=Mask Variable
-onboarding.tutorial.with.gitlab_ci.env_variables.section2.title=Define the SonarQube URL environment variable.
-onboarding.tutorial.with.gitlab_ci.env_variables.section2.description=Still in {link} add a new variable and make sure it is available for your project:
-onboarding.tutorial.with.gitlab_ci.env_variables.section2.step4=Leave the {value} checkbox unchecked.
-onboarding.tutorial.with.gitlab_ci.yml.title=Create or update the configuration file
-onboarding.tutorial.with.gitlab_ci.yml.description=Create or update your {filename} file with the following content.
-onboarding.tutorial.with.gitlab_ci.yml.filename=.gitlab-ci.yml
-onboarding.tutorial.with.gitlab_ci.yml.baseconfig=Note that this is a minimal base configuration to run a SonarQube analysis on your main branch and merge requests.
-onboarding.tutorial.with.gitlab_ci.yml.baseconfig.no_branches=Note that this is a minimal base configuration to run a SonarQube analysis on your main branch.
-onboarding.tutorial.with.gitlab_ci.yml.existing=If you already have a pipeline configured and running, you might want to add the example from this step to your existing yml file.
+onboarding.tutorial.with.gitlab_ci.variables.title=Add environment variables
+onboarding.tutorial.with.gitlab_ci.variables.description.link=Settings > CI/CD > Variables
+onboarding.tutorial.with.gitlab_ci.variables.section.title=Define the SonarQube Token environment variable.
+onboarding.tutorial.with.gitlab_ci.variables.section.description=In GitLab, go to {link} to add the following variable and make sure it is available for your project:
+onboarding.tutorial.with.gitlab_ci.variables.edit.token.tooltip=Use an existing token or generate a new one.
+onboarding.tutorial.with.gitlab_ci.variables.step1=Key
+
+onboarding.tutorial.with.gitlab_ci.variables.step3=Uncheck the {value} checkbox.
+onboarding.tutorial.with.gitlab_ci.variables.step3.value=Protect Variable
+onboarding.tutorial.with.gitlab_ci.variables.section.step4=Check the {value} checkbox.
+onboarding.tutorial.with.gitlab_ci.variables.section.step4.value=Mask Variable
+onboarding.tutorial.with.gitlab_ci.variables.section2.title=Define the SonarQube URL environment variable.
+onboarding.tutorial.with.gitlab_ci.variables.section2.description=Still in {link} add a new variable and make sure it is available for your project:
+onboarding.tutorial.with.gitlab_ci.variables.section2.step4=Leave the {value} checkbox unchecked.
+onboarding.tutorial.with.gitlab_ci.yaml.title=Create or update the configuration file
+onboarding.tutorial.with.gitlab_ci.yaml.description=Create or update your {filename} file with the following content.
+onboarding.tutorial.with.gitlab_ci.yaml.filename=.gitlab-ci.yml
+onboarding.tutorial.with.gitlab_ci.yaml.baseconfig=Note that this is a minimal base configuration to run a SonarQube analysis on your main branch and merge requests.
+onboarding.tutorial.with.gitlab_ci.yaml.baseconfig.no_branches=Note that this is a minimal base configuration to run a SonarQube analysis on your main branch.
+onboarding.tutorial.with.gitlab_ci.yaml.existing=If you already have a pipeline configured and running, you might want to add the example from this step to your existing yml file.
 
 onboarding.tutorial.with.jenkins.title=Analyze your project with Jenkins
 onboarding.tutorial.with.jenkins.alm_selection.title=Select your DevOps platform