From: Wouter Admiraal Date: Tue, 27 Sep 2022 07:31:08 +0000 (+0200) Subject: SONAR-17188 SONAR-17189 Generate a global analysis token when following the Azure... X-Git-Tag: 9.7.0.61563~152 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=570bf526d9488a1a88248f27c1a3beb7457796d3;p=sonarqube.git SONAR-17188 SONAR-17189 Generate a global analysis token when following the Azure DevOps Pipelines tutorial --- diff --git a/server/sonar-web/__mocks__/react-intl.tsx b/server/sonar-web/__mocks__/react-intl.tsx new file mode 100644 index 00000000000..888162e0880 --- /dev/null +++ b/server/sonar-web/__mocks__/react-intl.tsx @@ -0,0 +1,34 @@ +/* + * SonarQube + * Copyright (C) 2009-2022 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 * as React from 'react'; + +module.exports = { + ...jest.requireActual('react-intl'), + FormattedMessage: ({ id, values }: { id: string; values: { [x: string]: React.ReactNode } }) => { + return ( + <> + {id} + {Object.entries(values).map(([key, value]) => ( + {value} + ))} + + ); + } +}; diff --git a/server/sonar-web/src/main/js/api/mocks/UserTokensMock.ts b/server/sonar-web/src/main/js/api/mocks/UserTokensMock.ts index a50e62582ce..9a10d6e29e0 100644 --- a/server/sonar-web/src/main/js/api/mocks/UserTokensMock.ts +++ b/server/sonar-web/src/main/js/api/mocks/UserTokensMock.ts @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { cloneDeep } from 'lodash'; +import { cloneDeep, last } from 'lodash'; import { mockUserToken } from '../../helpers/mocks/token'; import { NewUserToken, TokenType, UserToken } from '../../types/token'; import { generateToken, getTokens, revokeToken } from '../user-tokens'; @@ -100,6 +100,10 @@ export default class UserTokensMock { return cloneDeep(this.tokens); }; + getLastToken = () => { + return last(this.getTokens()); + }; + reset = () => { this.tokens = cloneDeep(defaultTokens); }; diff --git a/server/sonar-web/src/main/js/apps/account/__tests__/Account-it.tsx b/server/sonar-web/src/main/js/apps/account/__tests__/Account-it.tsx index a9bec509b0f..217f18dbbbf 100644 --- a/server/sonar-web/src/main/js/apps/account/__tests__/Account-it.tsx +++ b/server/sonar-web/src/main/js/apps/account/__tests__/Account-it.tsx @@ -306,9 +306,11 @@ describe('security page', () => { ).toBeInTheDocument(); expect(screen.getByRole('button', { name: 'copy_to_clipboard' })).toBeInTheDocument(); - const lastTokenCreated = tokenMock.getTokens().pop(); - expect(lastTokenCreated).toBeDefined(); - expect(screen.getByLabelText('users.new_token').textContent).toBe(lastTokenCreated!.token); + const lastTokenCreated = tokenMock.getLastToken(); + if (lastTokenCreated === undefined) { + throw new Error("Couldn't find the latest generated token."); + } + expect(screen.getByLabelText('users.new_token').textContent).toBe(lastTokenCreated.token); expect(screen.getAllByRole('row')).toHaveLength(4); // 3 tokens + header diff --git a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/__tests__/__snapshots__/AlmSpecificForm-test.tsx.snap b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/__tests__/__snapshots__/AlmSpecificForm-test.tsx.snap index 84d74c3840f..bb8f74738d6 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/__tests__/__snapshots__/AlmSpecificForm-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/settings/components/pullRequestDecorationBinding/__tests__/__snapshots__/AlmSpecificForm-test.tsx.snap @@ -21,7 +21,6 @@ exports[`it should render correctly for azure 1`] = `
@@ -480,7 +471,6 @@ exports[`it should render correctly for github if an instance URL is provided 1`
@@ -574,7 +563,6 @@ exports[`it should render correctly for github if an instance URL is provided 2`
@@ -668,7 +655,6 @@ exports[`it should render correctly for gitlab 1`] = `
- +
+ +
); } diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/ExtensionInstallationStepContent.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/ExtensionInstallationStepContent.tsx index eff9bb3e535..2b6271bc5d8 100644 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/ExtensionInstallationStepContent.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/ExtensionInstallationStepContent.tsx @@ -24,7 +24,7 @@ import Link from '../../common/Link'; export default function ExtensionInstallationStepContent() { return ( - + -
    +
    1. @@ -86,6 +87,7 @@ export default function ServiceEndpointStepContent(props: ServiceEndpointStepPro component={component} currentUser={currentUser} onClose={() => toggleModal(false)} + preferredTokenType={TokenType.Global} /> )} diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/AzurePipelinesTutorial-it.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/AzurePipelinesTutorial-it.tsx new file mode 100644 index 00000000000..365c2e1ea0e --- /dev/null +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/AzurePipelinesTutorial-it.tsx @@ -0,0 +1,284 @@ +/* + * SonarQube + * Copyright (C) 2009-2022 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 { screen, within } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; +import { UserEvent } from '@testing-library/user-event/dist/types/setup'; +import * as React from 'react'; +import UserTokensMock from '../../../../api/mocks/UserTokensMock'; +import { mockComponent } from '../../../../helpers/mocks/component'; +import { mockAppState, mockLanguage, mockLoggedInUser } from '../../../../helpers/testMocks'; +import { renderApp, RenderContext } from '../../../../helpers/testReactTestingUtils'; +import { Permissions } from '../../../../types/permissions'; +import { TokenType } from '../../../../types/token'; +import AzurePipelinesTutorial, { AzurePipelinesTutorialProps } from '../AzurePipelinesTutorial'; + +jest.mock('../../../../api/user-tokens'); + +jest.mock('../../../../api/settings', () => ({ + getAllValues: jest.fn().mockResolvedValue([]) +})); + +let tokenMock: UserTokensMock; + +beforeAll(() => { + tokenMock = new UserTokensMock(); +}); + +afterEach(() => { + tokenMock.reset(); +}); + +it('should render correctly and allow navigating between the different steps', async () => { + renderAzurePipelinesTutorial(); + const user = userEvent.setup(); + + expect( + screen.getByRole('heading', { name: 'onboarding.tutorial.with.azure_pipelines.title' }) + ).toBeInTheDocument(); + + //// Default step. + assertDefaultStepIsCorrectlyRendered(); + + // Continue. + await goToNextStep(user); + + //// Token step. + assertServiceEndpointStepIsCorrectlyRendered(); + + // Generate a token. + await clickButton(user, 'onboarding.token.generate.long'); + const modal = screen.getByRole('dialog'); + await clickButton(user, 'onboarding.token.generate', modal); + const lastToken = tokenMock.getLastToken(); + if (lastToken === undefined) { + throw new Error("Couldn't find the latest generated token."); + } + expect(lastToken.type).toBe(TokenType.Global); + expect(within(modal).getByRole('alert')).toHaveTextContent( + `users.tokens.new_token_created.${lastToken.token}` + ); + await clickButton(user, 'continue', modal); + + // Continue. + await goToNextStep(user); + + //// Analysis step: .NET + await clickButton(user, 'onboarding.build.dotnet'); + assertDotNetStepIsCorrectlyRendered(); + + //// Analysis step: Maven + await clickButton(user, 'onboarding.build.maven'); + assertMavenStepIsCorrectlyRendered(); + + //// Analysis step: Gradle + await clickButton(user, 'onboarding.build.gradle'); + assertGradleStepIsCorrectlyRendered(); + + //// Analysis step: Gradle + await clickButton(user, 'onboarding.build.gradle'); + assertGradleStepIsCorrectlyRendered(); + + //// Analysis step: C Family + await clickButton(user, 'onboarding.build.cfamily'); + + // OS: Linux + await clickButton(user, 'onboarding.build.other.os.linux'); + assertCFamilyLinuxStepIsCorrectlyRendered(); + + // OS: Windows + await clickButton(user, 'onboarding.build.other.os.win'); + assertCFamilyWindowsStepIsCorrectlyRendered(); + + // OS: macOS + await clickButton(user, 'onboarding.build.other.os.mac'); + assertCFamilyMacOSStepIsCorrectlyRendered(); + + //// Analysis step: Other + await clickButton(user, 'onboarding.build.other'); + assertOtherStepIsCorrectlyRendered(); + + //// Finish tutorial + await clickButton(user, 'tutorials.finish'); + assertFinishStepIsCorrectlyRendered(); +}); + +it('allows to navigate back to a previous step', async () => { + renderAzurePipelinesTutorial(); + const user = userEvent.setup(); + + // No clickable steps. + expect( + screen.queryByRole('button', { + name: '1 onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.title' + }) + ).not.toBeInTheDocument(); + + // Go to the next steps. + await goToNextStep(user); + await goToNextStep(user); + + // The first 2 steps become clickable. + expect( + screen.getByRole('button', { + name: '1 onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.title' + }) + ).toBeInTheDocument(); + expect( + screen.getByRole('button', { + name: '2 onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.title' + }) + ).toBeInTheDocument(); + + // Navigate back to the first step. + await clickButton(user, '1 onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.title'); + + // No more clickable steps. + expect( + screen.queryByRole('button', { + name: '1 onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.title' + }) + ).not.toBeInTheDocument(); +}); + +it('should not offer CFamily analysis if the language is not available', async () => { + renderAzurePipelinesTutorial(undefined, { languages: {} }); + const user = userEvent.setup(); + + // Go to the analysis step. + await goToNextStep(user); + await goToNextStep(user); + + expect(screen.getByRole('button', { name: 'onboarding.build.dotnet' })).toBeInTheDocument(); + expect( + screen.queryByRole('button', { name: 'onboarding.build.cfamily' }) + ).not.toBeInTheDocument(); +}); + +function renderAzurePipelinesTutorial( + props: Partial = {}, + { + appState = mockAppState({ branchesEnabled: true }), + languages = { c: mockLanguage({ key: 'c' }) } + }: RenderContext = {} +) { + return renderApp( + '/', + , + { appState, languages } + ); +} + +async function clickButton(user: UserEvent, name: string, context?: HTMLElement) { + if (context) { + await user.click(within(context).getByRole('button', { name })); + } else { + await user.click(screen.getByRole('button', { name })); + } +} + +async function goToNextStep(user: UserEvent) { + await clickButton(user, 'continue'); +} + +function assertDefaultStepIsCorrectlyRendered() { + expect( + screen.getByRole('heading', { + name: 'onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.title' + }) + ).toBeInTheDocument(); + expect(screen.getByTestId('azure-tutorial__extension')).toMatchSnapshot('extension step'); +} + +function assertServiceEndpointStepIsCorrectlyRendered() { + expect( + screen.getByRole('heading', { + name: 'onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.title' + }) + ).toBeInTheDocument(); + expect(screen.getByTestId('azure-tutorial__service-endpoint')).toMatchSnapshot( + 'service endpoint step' + ); + expect(screen.getByRole('button', { name: 'copy_to_clipboard' })).toBeInTheDocument(); + expect( + screen.getByRole('button', { name: 'onboarding.token.generate.long' }) + ).toBeInTheDocument(); +} + +function assertDotNetStepIsCorrectlyRendered() { + expect( + screen.getByRole('heading', { + name: 'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.title' + }) + ).toBeInTheDocument(); + + expect(screen.getByTestId('azure-tutorial__analysis-command')).toMatchSnapshot('dotnet step'); + expect(screen.getByRole('button', { name: 'copy_to_clipboard' })).toBeInTheDocument(); +} + +function assertMavenStepIsCorrectlyRendered() { + expect(screen.getByTestId('azure-tutorial__analysis-command')).toMatchSnapshot('maven step'); + expect(screen.getByRole('button', { name: 'copy_to_clipboard' })).toBeInTheDocument(); +} + +function assertGradleStepIsCorrectlyRendered() { + expect(screen.getByTestId('azure-tutorial__analysis-command')).toMatchSnapshot('gradle step'); + expect(screen.getByRole('button', { name: 'copy_to_clipboard' })).toBeInTheDocument(); +} + +function assertCFamilyLinuxStepIsCorrectlyRendered() { + expect(screen.getByTestId('azure-tutorial__analysis-command')).toMatchSnapshot( + 'cfamily linux step' + ); + expect(screen.getAllByRole('button', { name: 'copy_to_clipboard' })).toHaveLength(4); +} + +function assertCFamilyWindowsStepIsCorrectlyRendered() { + expect(screen.getByTestId('azure-tutorial__analysis-command')).toMatchSnapshot( + 'cfamily windows step' + ); + expect(screen.getAllByRole('button', { name: 'copy_to_clipboard' })).toHaveLength(4); +} + +function assertCFamilyMacOSStepIsCorrectlyRendered() { + expect(screen.getByTestId('azure-tutorial__analysis-command')).toMatchSnapshot( + 'cfamily macos step' + ); + expect(screen.getAllByRole('button', { name: 'copy_to_clipboard' })).toHaveLength(4); +} + +function assertOtherStepIsCorrectlyRendered() { + expect(screen.getByTestId('azure-tutorial__analysis-command')).toMatchSnapshot('other step'); + expect(screen.getByRole('button', { name: 'copy_to_clipboard' })).toBeInTheDocument(); +} + +function assertFinishStepIsCorrectlyRendered() { + expect( + screen.getByRole('heading', { + name: 'onboarding.tutorial.ci_outro.all_set.title' + }) + ).toBeInTheDocument(); + expect(screen.getByTestId('azure-tutorial__all-set')).toMatchSnapshot('all set step'); +} diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/AzurePipelinesTutorial-test.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/AzurePipelinesTutorial-test.tsx deleted file mode 100644 index 495db2d5789..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/AzurePipelinesTutorial-test.tsx +++ /dev/null @@ -1,97 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2022 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 { Button } from '../../../../components/controls/buttons'; -import { mockComponent } from '../../../../helpers/mocks/component'; -import { mockLoggedInUser } from '../../../../helpers/testMocks'; -import { click } from '../../../../helpers/testUtils'; -import Step from '../../components/Step'; -import AzurePipelinesTutorial, { AzurePipelinesTutorialProps } from '../AzurePipelinesTutorial'; - -it('should render correctly', () => { - const wrapper = shallowRender(); - expect(wrapper).toMatchSnapshot(); - - wrapper.find(Step).forEach(step => { - expect(step.dive()).toMatchSnapshot(); - }); -}); - -it('should display the next step when one is finished', () => { - const wrapper = shallowRender(); - expect( - wrapper - .find(Step) - .filterWhere(elt => elt.props().open === true) - .props().stepNumber - ).toBe(1); - - click( - wrapper - .find(Step) - .first() - .dive() - .find(Button) - ); - - expect( - wrapper - .find(Step) - .filterWhere(elt => elt.props().open === true) - .props().stepNumber - ).toBe(2); -}); - -it('should open a step when user click on it', () => { - const wrapper = shallowRender(); - expect( - wrapper - .find(Step) - .filterWhere(elt => elt.props().open === true) - .props().stepNumber - ).toBe(1); - - ( - wrapper - .find(Step) - .filterWhere(elt => elt.props().stepNumber === 3) - .props().onOpen ?? (() => {}) - )(); - - expect( - wrapper - .find(Step) - .filterWhere(elt => elt.props().open === true) - .props().stepNumber - ).toBe(3); -}); - -function shallowRender(props: Partial = {}) { - return shallow( - - ); -} diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/BranchAnalysisStepContent-test.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/BranchAnalysisStepContent-test.tsx deleted file mode 100644 index 551ab130cdc..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/BranchAnalysisStepContent-test.tsx +++ /dev/null @@ -1,54 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2022 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 { BuildTools } from '../../types'; -import { BranchAnalysisStepContent, BranchesAnalysisStepProps } from '../BranchAnalysisStepContent'; - -it('should render correctly', () => { - expect(shallowRender()).toMatchSnapshot(); - expect(shallowRender({ languages: {} })).toMatchSnapshot('without C'); -}); - -it.each([BuildTools.DotNet, BuildTools.Gradle, BuildTools.Maven, BuildTools.Other])( - 'should render correctly', - (buildTech: BuildTools) => { - const wrapper = shallowRender(); - wrapper - .find(RenderOptions) - .props() - .onCheck(buildTech); - - expect(wrapper).toMatchSnapshot(buildTech); - } -); - -function shallowRender(props: Partial = {}) { - return shallow( - - ); -} diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/ExtensionInstallationStepContent-test.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/ExtensionInstallationStepContent-test.tsx deleted file mode 100644 index 06a39f15e0b..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/ExtensionInstallationStepContent-test.tsx +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2022 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 ExtensionInstallationStepContent from '../ExtensionInstallationStepContent'; - -it('should render correctly', () => { - const wrapper = shallowRender(); - expect(wrapper).toMatchSnapshot(); -}); - -function shallowRender() { - return shallow(); -} diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/JavaToolInstallation-test.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/JavaToolInstallation-test.tsx deleted file mode 100644 index c10228d24f9..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/JavaToolInstallation-test.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2022 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 JavaToolInstallation from '../JavaToolInstallation'; - -it('should render correctly', () => { - expect(shallowRender()).toMatchSnapshot(); -}); - -function shallowRender() { - return shallow(); -} diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/ServiceEndpointStepContent-test.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/ServiceEndpointStepContent-test.tsx deleted file mode 100644 index ba0b4bb1124..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/ServiceEndpointStepContent-test.tsx +++ /dev/null @@ -1,56 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2022 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 { Button } from '../../../../components/controls/buttons'; -import { mockComponent } from '../../../../helpers/mocks/component'; -import { mockLoggedInUser } from '../../../../helpers/testMocks'; -import { click } from '../../../../helpers/testUtils'; -import EditTokenModal from '../../components/EditTokenModal'; -import ServiceEndpointStepContent from '../ServiceEndpointStepContent'; - -it('should render correctly', () => { - const wrapper = shallowRender(); - expect(wrapper).toMatchSnapshot(); -}); - -it('should render open/close the token modal when asked to', () => { - const wrapper = shallowRender(); - expect(wrapper.exists(EditTokenModal)).toBe(false); - - click(wrapper.find(Button)); - expect(wrapper.exists(EditTokenModal)).toBe(true); - - wrapper - .find(EditTokenModal) - .props() - .onClose(); - expect(wrapper.exists(EditTokenModal)).toBe(false); -}); - -function shallowRender() { - return shallow( - - ); -} diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/AzurePipelinesTutorial-it.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/AzurePipelinesTutorial-it.tsx.snap new file mode 100644 index 00000000000..8d91963a5b3 --- /dev/null +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/AzurePipelinesTutorial-it.tsx.snap @@ -0,0 +1,3340 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly and allow navigating between the different steps: all set step 1`] = ` +
      +
      +

      + onboarding.tutorial.ci_outro.all_set.sentence + + onboarding.tutorial.ci_outro.all_set.sentence.all_set + +

      +
      +
      + +
      +
      +

      + + onboarding.tutorial.ci_outro.commit + +

      +

      + onboarding.tutorial.ci_outro.commit.why.azure +

      +
      +
      +
      +
      + +
      +
      +

      + + onboarding.tutorial.ci_outro.refresh + +

      +

      + onboarding.tutorial.ci_outro.refresh.why +

      +
      +
      +
      +
      + + onboarding.tutorial.ci_outro.waiting_for_fist_analysis +
      +
      +`; + +exports[`should render correctly and allow navigating between the different steps: cfamily linux step 1`] = ` +.emotion-2 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; +} + +.emotion-1 { + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + overflow: auto; + text-align: left; + padding: 8px calc(2 * 8px); +} + +.emotion-3 { + border: 1px solid; + border-radius: 2px; + margin-bottom: 8px; + border-color: #b1dff3; + background-color: #d9edf7; + color: #0e516f; + display: block; +} + +.emotion-3:empty { + display: none; +} + +.emotion-3 a, +.emotion-3 .button-link { + border-color: #236a97; +} + +.emotion-0 { + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + -webkit-justify-content: center; + justify-content: center; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + width: calc(4 * 8px); + border-right: 1px solid; + border-color: #b1dff3; +} + +
      + + onboarding.tutorial.with.azure_pipelines.os + +
      +
        +
      • + +
      • +
      • + +
      • +
      • + +
      • +
      +
      +
      + +

      + onboarding.tutorial.cfamily.examples_repositories_description +

      +
      +
      +
      +
      + + + +
      +
      + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info.doc_link + +
      +
      +
      +
        +
      1. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build_wrapper.ccpp.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.pipeline + +
      2. +
          +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build_wrapper.ccpp.script.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build_wrapper.ccpp.nix.sentence.task + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build_wrapper.ccpp.nix.sentence.inline + +
          +
          +            curl 'http://localhost/static/cpp/build-wrapper-linux-x86.zip' --output build-wrapper.zip
          +unzip build-wrapper.zip
          +          
          + +
          +
        • +
        +
      3. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.ccpp.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.task + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.before + +
      4. +
          +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.endpoint.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.endpoint.sentence.endpoint + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.section + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.values.cfamily + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.manual.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.manual.sentence.mode + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.key.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.key.sentence.project_key + + + my-project + + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare_additional.ccpp + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare_additional.ccpp.advanced + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare_additional.ccpp.additional + + + sonar.cfamily.build-wrapper-output=bw-output + + +
        • +
        +
      5. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build.ccpp.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build.ccpp.sentence.task + +
      6. + +
      7. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.ccpp.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.sentence.task + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.sentence.after + +
      8. +
      9. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.sentence.task + +
        +
        +
        + + + +
        +
        + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.info.sentence1 +
        +
        +
        +
      10. +
      11. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence.tab + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence.continuous_integration + +
      12. +
        + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection.link + +
      +
      +`; + +exports[`should render correctly and allow navigating between the different steps: cfamily macos step 1`] = ` +.emotion-2 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; +} + +.emotion-1 { + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + overflow: auto; + text-align: left; + padding: 8px calc(2 * 8px); +} + +.emotion-3 { + border: 1px solid; + border-radius: 2px; + margin-bottom: 8px; + border-color: #b1dff3; + background-color: #d9edf7; + color: #0e516f; + display: block; +} + +.emotion-3:empty { + display: none; +} + +.emotion-3 a, +.emotion-3 .button-link { + border-color: #236a97; +} + +.emotion-0 { + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + -webkit-justify-content: center; + justify-content: center; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + width: calc(4 * 8px); + border-right: 1px solid; + border-color: #b1dff3; +} + +
      + + onboarding.tutorial.with.azure_pipelines.os + +
      +
        +
      • + +
      • +
      • + +
      • +
      • + +
      • +
      +
      +
      + +

      + onboarding.tutorial.cfamily.examples_repositories_description +

      +
      +
      +
      +
      + + + +
      +
      + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info.doc_link + +
      +
      +
      +
        +
      1. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build_wrapper.ccpp.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.pipeline + +
      2. +
          +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build_wrapper.ccpp.script.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build_wrapper.ccpp.nix.sentence.task + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build_wrapper.ccpp.nix.sentence.inline + +
          +
          +            curl 'http://localhost/static/cpp/build-wrapper-macosx-x86.zip' --output build-wrapper.zip
          +unzip build-wrapper.zip
          +          
          + +
          +
        • +
        +
      3. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.ccpp.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.task + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.before + +
      4. +
          +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.endpoint.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.endpoint.sentence.endpoint + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.section + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.values.cfamily + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.manual.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.manual.sentence.mode + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.key.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.key.sentence.project_key + + + my-project + + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare_additional.ccpp + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare_additional.ccpp.advanced + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare_additional.ccpp.additional + + + sonar.cfamily.build-wrapper-output=bw-output + + +
        • +
        +
      5. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build.ccpp.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build.ccpp.sentence.task + +
      6. + +
      7. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.ccpp.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.sentence.task + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.sentence.after + +
      8. +
      9. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.sentence.task + +
        +
        +
        + + + +
        +
        + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.info.sentence1 +
        +
        +
        +
      10. +
      11. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence.tab + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence.continuous_integration + +
      12. +
        + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection.link + +
      +
      +`; + +exports[`should render correctly and allow navigating between the different steps: cfamily windows step 1`] = ` +.emotion-2 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; +} + +.emotion-1 { + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + overflow: auto; + text-align: left; + padding: 8px calc(2 * 8px); +} + +.emotion-3 { + border: 1px solid; + border-radius: 2px; + margin-bottom: 8px; + border-color: #b1dff3; + background-color: #d9edf7; + color: #0e516f; + display: block; +} + +.emotion-3:empty { + display: none; +} + +.emotion-3 a, +.emotion-3 .button-link { + border-color: #236a97; +} + +.emotion-0 { + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + -webkit-justify-content: center; + justify-content: center; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + width: calc(4 * 8px); + border-right: 1px solid; + border-color: #b1dff3; +} + +
      + + onboarding.tutorial.with.azure_pipelines.os + +
      +
        +
      • + +
      • +
      • + +
      • +
      • + +
      • +
      +
      +
      + +

      + onboarding.tutorial.cfamily.examples_repositories_description +

      +
      +
      +
      +
      + + + +
      +
      + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info.doc_link + +
      +
      +
      +
        +
      1. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build_wrapper.ccpp.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.pipeline + +
      2. +
          +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build_wrapper.ccpp.script.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build_wrapper.ccpp.win.sentence.task + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build_wrapper.ccpp.win.sentence.inline + +
          +
          +            Invoke-WebRequest -Uri 'http://localhost/static/cpp/build-wrapper-win-x86.zip' -OutFile 'build-wrapper.zip'
          +Expand-Archive -Path 'build-wrapper.zip' -DestinationPath '.'
          +          
          + +
          +
        • +
        +
      3. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.ccpp.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.task + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.before + +
      4. +
          +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.endpoint.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.endpoint.sentence.endpoint + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.section + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.values.cfamily + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.manual.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.manual.sentence.mode + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.key.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.key.sentence.project_key + + + my-project + + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare_additional.ccpp + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare_additional.ccpp.advanced + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare_additional.ccpp.additional + + + sonar.cfamily.build-wrapper-output=bw-output + + +
        • +
        +
      5. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build.ccpp.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build.ccpp.sentence.task + +
      6. + +
      7. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.ccpp.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.sentence.task + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.sentence.after + +
      8. +
      9. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.sentence.task + +
        +
        +
        + + + +
        +
        + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.info.sentence1 +
        +
        +
        +
      10. +
      11. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence.tab + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence.continuous_integration + +
      12. +
        + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection.link + +
      +
      +`; + +exports[`should render correctly and allow navigating between the different steps: dotnet step 1`] = ` +.emotion-2 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; +} + +.emotion-1 { + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + overflow: auto; + text-align: left; + padding: 8px calc(2 * 8px); +} + +.emotion-3 { + border: 1px solid; + border-radius: 2px; + margin-bottom: 8px; + border-color: #b1dff3; + background-color: #d9edf7; + color: #0e516f; + display: block; +} + +.emotion-3:empty { + display: none; +} + +.emotion-3 a, +.emotion-3 .button-link { + border-color: #236a97; +} + +.emotion-0 { + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + -webkit-justify-content: center; + justify-content: center; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + width: calc(4 * 8px); + border-right: 1px solid; + border-color: #b1dff3; +} + +
      +
      +
      +
      + + + +
      +
      + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info.doc_link + +
      +
      +
      +
        +
      1. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.pipeline + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.task + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.before + +
      2. +
          +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.endpoint.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.endpoint.sentence.endpoint + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.section + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.values.dotnet + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.key.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.key.sentence.project_key + + + my-project + + +
        • +
        +
      3. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.sentence.task + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.sentence.after + +
      4. +
      5. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.sentence.task + +
        +
        +
        + + + +
        +
        + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.info.sentence1 +
        +
        +
        +
      6. +
      7. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence.tab + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence.continuous_integration + +
      8. +
        + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection.link + +
      +
      +`; + +exports[`should render correctly and allow navigating between the different steps: extension step 1`] = ` + + onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.sentence + + + + + onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.sentence.link + + + onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.sentence.button + + +`; + +exports[`should render correctly and allow navigating between the different steps: gradle step 1`] = ` +.emotion-2 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; +} + +.emotion-1 { + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + overflow: auto; + text-align: left; + padding: 8px calc(2 * 8px); +} + +.emotion-3 { + border: 1px solid; + border-radius: 2px; + margin-bottom: 8px; + border-color: #b1dff3; + background-color: #d9edf7; + color: #0e516f; + display: block; +} + +.emotion-3:empty { + display: none; +} + +.emotion-3 a, +.emotion-3 .button-link { + border-color: #236a97; +} + +.emotion-0 { + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + -webkit-justify-content: center; + justify-content: center; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + width: calc(4 * 8px); + border-right: 1px solid; + border-color: #b1dff3; +} + +
      +
      +
      +
      + + + +
      +
      + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info.doc_link + +
      +
      +
      +
        +
      1. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.pipeline + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.task + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.before + +
      2. +
          +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.endpoint.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.endpoint.sentence.endpoint + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.section + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.values.gradle + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.advanced_properties.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.advanced_properties.sentence.section + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.advanced_properties.sentence.properties + + : +
          +
          +            # Additional properties that will be passed to the scanner,
          +# Put one key=value per line, example:
          +# sonar.exclusions=**/*.bin
          +sonar.projectKey=my-project
          +          
          + +
          +
        • +
        +
      3. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.title +
          +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_version + + + 11 + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.or_higher +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_architecture + + + x64 + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_source + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.pre-installed + +
        • +
        +
      4. +
      5. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.onboarding.build.gradle +
      6. +
          +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.settings.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.settings.sentence.section + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.settings.sentence.option + +
        • +
        +
      7. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.sentence.task + +
        +
        +
        + + + +
        +
        + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.info.sentence1 +
        +
        +
        +
      8. +
      9. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence.tab + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence.continuous_integration + +
      10. +
        + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection.link + +
      +
      +`; + +exports[`should render correctly and allow navigating between the different steps: gradle step 2`] = ` +.emotion-2 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; +} + +.emotion-1 { + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + overflow: auto; + text-align: left; + padding: 8px calc(2 * 8px); +} + +.emotion-3 { + border: 1px solid; + border-radius: 2px; + margin-bottom: 8px; + border-color: #b1dff3; + background-color: #d9edf7; + color: #0e516f; + display: block; +} + +.emotion-3:empty { + display: none; +} + +.emotion-3 a, +.emotion-3 .button-link { + border-color: #236a97; +} + +.emotion-0 { + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + -webkit-justify-content: center; + justify-content: center; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + width: calc(4 * 8px); + border-right: 1px solid; + border-color: #b1dff3; +} + +
      +
      +
      +
      + + + +
      +
      + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info.doc_link + +
      +
      +
      +
        +
      1. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.pipeline + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.task + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.before + +
      2. +
          +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.endpoint.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.endpoint.sentence.endpoint + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.section + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.values.gradle + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.advanced_properties.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.advanced_properties.sentence.section + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.advanced_properties.sentence.properties + + : +
          +
          +            # Additional properties that will be passed to the scanner,
          +# Put one key=value per line, example:
          +# sonar.exclusions=**/*.bin
          +sonar.projectKey=my-project
          +          
          + +
          +
        • +
        +
      3. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.title +
          +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_version + + + 11 + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.or_higher +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_architecture + + + x64 + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_source + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.pre-installed + +
        • +
        +
      4. +
      5. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.onboarding.build.gradle +
      6. +
          +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.settings.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.settings.sentence.section + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.settings.sentence.option + +
        • +
        +
      7. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.sentence.task + +
        +
        +
        + + + +
        +
        + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.info.sentence1 +
        +
        +
        +
      8. +
      9. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence.tab + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence.continuous_integration + +
      10. +
        + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection.link + +
      +
      +`; + +exports[`should render correctly and allow navigating between the different steps: maven step 1`] = ` +.emotion-2 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; +} + +.emotion-1 { + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + overflow: auto; + text-align: left; + padding: 8px calc(2 * 8px); +} + +.emotion-3 { + border: 1px solid; + border-radius: 2px; + margin-bottom: 8px; + border-color: #b1dff3; + background-color: #d9edf7; + color: #0e516f; + display: block; +} + +.emotion-3:empty { + display: none; +} + +.emotion-3 a, +.emotion-3 .button-link { + border-color: #236a97; +} + +.emotion-0 { + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + -webkit-justify-content: center; + justify-content: center; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + width: calc(4 * 8px); + border-right: 1px solid; + border-color: #b1dff3; +} + +
      +
      +
      +
      + + + +
      +
      + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info.doc_link + +
      +
      +
      +
        +
      1. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.pipeline + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.task + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.before + +
      2. +
          +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.endpoint.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.endpoint.sentence.endpoint + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.section + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.values.gradle + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.advanced_properties.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.advanced_properties.sentence.section + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.advanced_properties.sentence.properties + + : +
          +
          +            # Additional properties that will be passed to the scanner,
          +# Put one key=value per line, example:
          +# sonar.exclusions=**/*.bin
          +sonar.projectKey=my-project
          +          
          + +
          +
        • +
        +
      3. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.title +
          +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_version + + + 11 + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.or_higher +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_architecture + + + x64 + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_source + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.pre-installed + +
        • +
        +
      4. +
      5. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.onboarding.build.maven +
      6. +
          +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.settings.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.settings.sentence.section + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.settings.sentence.option + +
        • +
        +
      7. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.sentence.task + +
        +
        +
        + + + +
        +
        + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.info.sentence1 +
        +
        +
        +
      8. +
      9. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence.tab + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence.continuous_integration + +
      10. +
        + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection.link + +
      +
      +`; + +exports[`should render correctly and allow navigating between the different steps: other step 1`] = ` +.emotion-2 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; + align-items: stretch; +} + +.emotion-1 { + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + overflow: auto; + text-align: left; + padding: 8px calc(2 * 8px); +} + +.emotion-3 { + border: 1px solid; + border-radius: 2px; + margin-bottom: 8px; + border-color: #b1dff3; + background-color: #d9edf7; + color: #0e516f; + display: block; +} + +.emotion-3:empty { + display: none; +} + +.emotion-3 a, +.emotion-3 .button-link { + border-color: #236a97; +} + +.emotion-0 { + -webkit-flex: 0 0 auto; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + -webkit-justify-content: center; + justify-content: center; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + width: calc(4 * 8px); + border-right: 1px solid; + border-color: #b1dff3; +} + +
      +
      +
      +
      + + + +
      +
      + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info.doc_link + +
      +
      +
      +
        +
      1. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.pipeline + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.task + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.sentence.before + +
      2. +
          +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.endpoint.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.endpoint.sentence.endpoint + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.section + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.values.other + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.manual.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.manual.sentence.mode + +
        • +
        • + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.key.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.key.sentence.project_key + + + my-project + + +
        • +
        +
      3. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.sentence.task + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.sentence.after + +
      4. +
      5. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.sentence.task + +
        +
        +
        + + + +
        +
        + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.info.sentence1 +
        +
        +
        +
      6. +
      7. + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence.tab + + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.sentence.continuous_integration + +
      8. +
        + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection.link + +
      +
      +`; + +exports[`should render correctly and allow navigating between the different steps: service endpoint step 1`] = ` +
        +
      1. + onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.step1.sentence + + onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.step1.sentence.menu + +
      2. +
      3. + onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.step2.sentence + + onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.step2.sentence.type + +
      4. +
      5. + onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.step3.sentence + + http://localhost:9000 + + +
      6. +
      7. + + onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.step4.sentence + : + + +
      8. +
      9. + onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.step5.sentence +
      10. +
      11. + onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.step6.sentence +
      12. +
      +`; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/AzurePipelinesTutorial-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/AzurePipelinesTutorial-test.tsx.snap deleted file mode 100644 index c180cb824f8..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/AzurePipelinesTutorial-test.tsx.snap +++ /dev/null @@ -1,216 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly 1`] = ` - -
      -

      - onboarding.tutorial.with.azure_pipelines.title -

      -
      - - - - -
      -`; - -exports[`should render correctly 2`] = ` -
      -
      - 1 -
      -
      -

      - onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.title -

      -
      -
      -
      -
      - -
      - -
      -
      -
      -`; - -exports[`should render correctly 3`] = ` -
      -
      - 2 -
      -
      -

      - onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.title -

      -
      -
      -
      -
      -
      - -
      - -
      -
      -
      -`; - -exports[`should render correctly 4`] = ` -
      -
      - 3 -
      -
      -

      - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.title -

      -
      -
      -
      -
      -
      - -
      -
      -
      -
      -`; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/BranchAnalysisStepContent-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/BranchAnalysisStepContent-test.tsx.snap deleted file mode 100644 index 1baea0c61c8..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/BranchAnalysisStepContent-test.tsx.snap +++ /dev/null @@ -1,164 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly 1`] = ` - - - onboarding.build - - - - -`; - -exports[`should render correctly: dotnet 1`] = ` - - - onboarding.build - - - - -`; - -exports[`should render correctly: gradle 1`] = ` - - - onboarding.build - - - - -`; - -exports[`should render correctly: maven 1`] = ` - - - onboarding.build - - - - -`; - -exports[`should render correctly: other 1`] = ` - - - onboarding.build - - - - -`; - -exports[`should render correctly: without C 1`] = ` - - - onboarding.build - - - - -`; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/ExtensionInstallationStepContent-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/ExtensionInstallationStepContent-test.tsx.snap deleted file mode 100644 index e8b50f4347e..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/ExtensionInstallationStepContent-test.tsx.snap +++ /dev/null @@ -1,23 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly 1`] = ` - - - onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.sentence.button - , - "link": - onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.sentence.link - , - } - } - /> - -`; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/JavaToolInstallation-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/JavaToolInstallation-test.tsx.snap deleted file mode 100644 index fc744643409..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/JavaToolInstallation-test.tsx.snap +++ /dev/null @@ -1,61 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly 1`] = ` -
    2. - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.title -
        -
      • - - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_version - , - "value": - 11 - , - } - } - /> - - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.or_higher -
      • -
      • - - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_architecture - , - "value": - x64 - , - } - } - /> -
      • -
      • - - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_source - , - "value": - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.pre-installed - , - } - } - /> -
      • -
      -
    3. -`; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/ServiceEndpointStepContent-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/ServiceEndpointStepContent-test.tsx.snap deleted file mode 100644 index 468ec3df83c..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/ServiceEndpointStepContent-test.tsx.snap +++ /dev/null @@ -1,66 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly 1`] = ` - -
        -
      1. - -
      2. -
      3. - -
      4. -
      5. - , - "url": - http://localhost:9000 - , - } - } - /> -
      6. -
      7. - - onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.step4.sentence - : - - -
      8. -
      9. - onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.step5.sentence -
      10. -
      11. - onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.step6.sentence -
      12. -
      -
      -`; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/AlertClassicEditor-test.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/AlertClassicEditor-test.tsx deleted file mode 100644 index 1ad0bbb25e7..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/AlertClassicEditor-test.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2022 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 AlertClassicEditor from '../AlertClassicEditor'; - -it('should render correctly', () => { - expect(shallowRender()).toMatchSnapshot(); -}); - -function shallowRender() { - return shallow(); -} diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/AnalysisCommand-test.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/AnalysisCommand-test.tsx deleted file mode 100644 index fcf77e3f093..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/AnalysisCommand-test.tsx +++ /dev/null @@ -1,40 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2022 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 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 = {}) { - return shallow( - - ); -} diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/ClangGCC-test.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/ClangGCC-test.tsx deleted file mode 100644 index 7f839891498..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/ClangGCC-test.tsx +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2022 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 from '../../../components/RenderOptions'; -import { OSs } from '../../../types'; -import ClangGCC, { ClangGCCProps } from '../ClangGCC'; - -it.each([OSs.Linux, OSs.Windows, OSs.MacOS])('should render correctly for %p', buildTool => { - const wrapper = shallowRender(); - - wrapper.find(RenderOptions).simulate('check', buildTool); - expect(wrapper).toMatchSnapshot(); -}); - -function shallowRender(props: Partial = {}) { - return shallow( - - ); -} diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/DotNet-test.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/DotNet-test.tsx deleted file mode 100644 index 38353ae9c89..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/DotNet-test.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2022 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 DotNet, { DotNetProps } from '../DotNet'; - -it('should render correctly', () => { - expect(shallowRender()).toMatchSnapshot(); -}); - -function shallowRender(props: Partial = {}) { - return shallow(); -} diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/JavaGradle-test.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/JavaGradle-test.tsx deleted file mode 100644 index 51402f920d7..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/JavaGradle-test.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2022 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 JavaGradle, { JavaGradleProps } from '../JavaGradle'; - -it('should render correctly', () => { - expect(shallowRender()).toMatchSnapshot(); -}); - -function shallowRender(props: Partial = {}) { - return shallow(); -} diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/JavaMaven-test.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/JavaMaven-test.tsx deleted file mode 100644 index 7f864fbd765..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/JavaMaven-test.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2022 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 JavaMaven, { JavaMavenProps } from '../JavaMaven'; - -it('should render correctly', () => { - expect(shallowRender()).toMatchSnapshot(); -}); - -function shallowRender(props: Partial = {}) { - return shallow(); -} diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/Other-test.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/Other-test.tsx deleted file mode 100644 index cb7cd6df381..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/Other-test.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2022 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 Other, { OtherProps } from '../Other'; - -it('should render correctly', () => { - expect(shallowRender()).toMatchSnapshot(); -}); - -function shallowRender(props: Partial = {}) { - return shallow(); -} diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/PrepareAnalysisCommand-test.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/PrepareAnalysisCommand-test.tsx deleted file mode 100644 index 9f387e6f04b..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/PrepareAnalysisCommand-test.tsx +++ /dev/null @@ -1,47 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2022 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 PrepareAnalysisCommand, { - PrepareAnalysisCommandProps, - PrepareType -} from '../PrepareAnalysisCommand'; - -it.each([ - [PrepareType.JavaMavenGradle, BuildTools.Gradle], - [PrepareType.JavaMavenGradle, BuildTools.Maven], - [PrepareType.StandAlone, BuildTools.Other], - [PrepareType.StandAlone, BuildTools.CFamily], - [PrepareType.MSBuild, BuildTools.DotNet] -])('should render correctly', (kind, buildTool) => { - expect(shallowRender({ kind, buildTool })).toMatchSnapshot(); -}); - -function shallowRender(props: Partial = {}) { - return shallow( - - ); -} diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/PublishSteps-test.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/PublishSteps-test.tsx deleted file mode 100644 index 31d95cfc79d..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/PublishSteps-test.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2022 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 { mockAppState } from '../../../../../helpers/testMocks'; -import { PublishSteps, PublishStepsProps } from '../PublishSteps'; - -it('should render correctly', () => { - expect(shallowRender()).toMatchSnapshot(); - expect(shallowRender({ appState: mockAppState({ branchesEnabled: true }) })).toMatchSnapshot(); -}); - -function shallowRender(props: Partial = {}) { - return shallow(); -} diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/AlertClassicEditor-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/AlertClassicEditor-test.tsx.snap deleted file mode 100644 index 21628b7c6ee..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/AlertClassicEditor-test.tsx.snap +++ /dev/null @@ -1,23 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly 1`] = ` - - - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.info.doc_link - , - } - } - /> - -`; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/AnalysisCommand-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/AnalysisCommand-test.tsx.snap deleted file mode 100644 index af15f04eafb..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/AnalysisCommand-test.tsx.snap +++ /dev/null @@ -1,34 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly for "cfamily" 1`] = ` - -`; - -exports[`should render correctly for "dotnet" 1`] = ` - -`; - -exports[`should render correctly for "gradle" 1`] = ` - -`; - -exports[`should render correctly for "maven" 1`] = ` - -`; - -exports[`should render correctly for "other" 1`] = ` - -`; - -exports[`should render correctly for undefined 1`] = `""`; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/ClangGCC-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/ClangGCC-test.tsx.snap deleted file mode 100644 index 7c5167fafd6..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/ClangGCC-test.tsx.snap +++ /dev/null @@ -1,367 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly for "linux" 1`] = ` - - - onboarding.tutorial.with.azure_pipelines.os - - - - -
        -
      1. - -
      2. -
          -
        • - - -
        • -
        -
      3. - -
      4. - -
      5. - -
      6. -
          -
        • - - - -
        • -
        -
      7. - -
      8. - -
      -
      -`; - -exports[`should render correctly for "mac" 1`] = ` - - - onboarding.tutorial.with.azure_pipelines.os - - - - -
        -
      1. - -
      2. -
          -
        • - - -
        • -
        -
      3. - -
      4. - -
      5. - -
      6. -
          -
        • - - - -
        • -
        -
      7. - -
      8. - -
      -
      -`; - -exports[`should render correctly for "win" 1`] = ` - - - onboarding.tutorial.with.azure_pipelines.os - - - - -
        -
      1. - -
      2. -
          -
        • - - -
        • -
        -
      3. - -
      4. - -
      5. - -
      6. -
          -
        • - - - -
        • -
        -
      7. - -
      8. - -
      -
      -`; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/DotNet-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/DotNet-test.tsx.snap deleted file mode 100644 index ab15daebc76..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/DotNet-test.tsx.snap +++ /dev/null @@ -1,40 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly 1`] = ` - - -
        -
      1. - -
      2. - -
      3. - -
      4. - -
      -
      -`; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/JavaGradle-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/JavaGradle-test.tsx.snap deleted file mode 100644 index 47f592f2def..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/JavaGradle-test.tsx.snap +++ /dev/null @@ -1,48 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly 1`] = ` - - -
        -
      1. - -
      2. - - -
      3. - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.onboarding.build.gradle -
      4. -
          -
        • - -
        • -
        - -
      -
      -`; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/JavaMaven-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/JavaMaven-test.tsx.snap deleted file mode 100644 index 3eaf0afd712..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/JavaMaven-test.tsx.snap +++ /dev/null @@ -1,48 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly 1`] = ` - - -
        -
      1. - -
      2. - - -
      3. - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.onboarding.build.maven -
      4. -
          -
        • - -
        • -
        - -
      -
      -`; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/Other-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/Other-test.tsx.snap deleted file mode 100644 index 87f7bf39c72..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/Other-test.tsx.snap +++ /dev/null @@ -1,40 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly 1`] = ` - - -
        -
      1. - -
      2. - -
      3. - -
      4. - -
      -
      -`; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/PrepareAnalysisCommand-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/PrepareAnalysisCommand-test.tsx.snap deleted file mode 100644 index 170210c11f5..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/PrepareAnalysisCommand-test.tsx.snap +++ /dev/null @@ -1,309 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly 1`] = ` -
        -
      • - -
      • -
      • - - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.values.gradle - , - "section": - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.section - , - } - } - /> -
      • -
      • - - : - -
      • -
      -`; - -exports[`should render correctly 2`] = ` -
        -
      • - -
      • -
      • - - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.values.maven - , - "section": - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.section - , - } - } - /> -
      • -
      • - - : - -
      • -
      -`; - -exports[`should render correctly 3`] = ` -
        -
      • - -
      • -
      • - - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.values.other - , - "section": - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.section - , - } - } - /> -
      • -
      • - -
      • -
      • - , - "key": - projectKey - , - "project_key": - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.key.sentence.project_key - , - } - } - /> -
      • -
      -`; - -exports[`should render correctly 4`] = ` -
        -
      • - -
      • -
      • - - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.values.cfamily - , - "section": - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.section - , - } - } - /> -
      • -
      • - -
      • -
      • - , - "key": - projectKey - , - "project_key": - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.key.sentence.project_key - , - } - } - /> -
      • -
      • - - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare_additional.ccpp.additional - , - "advanced": - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare_additional.ccpp.advanced - , - "button": , - "property": - sonar.cfamily.build-wrapper-output=bw-output - , - } - } - /> -
      • -
      -`; - -exports[`should render correctly 5`] = ` -
        -
      • - -
      • -
      • - - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.values.dotnet - , - "section": - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.run_analysis.section - , - } - } - /> -
      • -
      • - , - "key": - projectKey - , - "project_key": - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.key.sentence.project_key - , - } - } - /> -
      • -
      -`; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/PublishSteps-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/PublishSteps-test.tsx.snap deleted file mode 100644 index 091a7fb5cd3..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/PublishSteps-test.tsx.snap +++ /dev/null @@ -1,80 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render correctly 1`] = ` - -
    4. - - - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.info.sentence1 - -
    5. -
    6. - -
    7. -
      -`; - -exports[`should render correctly 2`] = ` - -
    8. - - - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.info.sentence1 - -
    9. -
    10. - -
    11. -
      - - onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection.link - , - } - } - /> -
      -`; diff --git a/server/sonar-web/src/main/js/components/tutorials/components/AllSetStep.tsx b/server/sonar-web/src/main/js/components/tutorials/components/AllSetStep.tsx index 58c3805e34d..dbf457dd861 100644 --- a/server/sonar-web/src/main/js/components/tutorials/components/AllSetStep.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/components/AllSetStep.tsx @@ -37,7 +37,7 @@ export default function AllSetStep(props: AllSetStepProps) { finished={false} open={open} renderForm={() => ( -
      +
      )} diff --git a/server/sonar-web/src/main/js/components/tutorials/components/EditTokenModal.tsx b/server/sonar-web/src/main/js/components/tutorials/components/EditTokenModal.tsx index 622f0a2b486..29dd00f8ec9 100644 --- a/server/sonar-web/src/main/js/components/tutorials/components/EditTokenModal.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/components/EditTokenModal.tsx @@ -31,12 +31,15 @@ import { EXPIRATION_OPTIONS, getAvailableExpirationOptions } from '../../../helpers/tokens'; +import { hasGlobalPermission } from '../../../helpers/users'; +import { Permissions } from '../../../types/permissions'; import { TokenExpiration, TokenType } from '../../../types/token'; import { Component } from '../../../types/types'; import { LoggedInUser } from '../../../types/users'; import Link from '../../common/Link'; import Select from '../../controls/Select'; import { getUniqueTokenName } from '../utils'; +import ProjectTokenScopeInfo from './ProjectTokenScopeInfo'; interface State { loading: boolean; @@ -50,6 +53,7 @@ interface Props { component: Component; currentUser: LoggedInUser; onClose: (token?: string) => void; + preferredTokenType?: TokenType.Global | TokenType.Project; } export default class EditTokenModal extends React.PureComponent { @@ -97,9 +101,11 @@ export default class EditTokenModal extends React.PureComponent { } = this.props; const { tokenName, tokenExpiration } = this.state; + const type = this.getTokenType(); + const { token } = await generateToken({ name: tokenName, - type: TokenType.Project, + type, projectKey: key, ...(tokenExpiration !== TokenExpiration.NoExpiration && { expirationDate: computeTokenExpirationDate(tokenExpiration) @@ -114,6 +120,15 @@ export default class EditTokenModal extends React.PureComponent { } }; + getTokenType = () => { + const { currentUser, preferredTokenType } = this.props; + + return preferredTokenType === TokenType.Global && + hasGlobalPermission(currentUser, Permissions.Scan) + ? TokenType.Global + : TokenType.Project; + }; + handleTokenNameChange = (event: React.ChangeEvent) => { this.setState({ tokenName: event.target.value @@ -142,7 +157,9 @@ export default class EditTokenModal extends React.PureComponent { render() { const { loading, token, tokenName, tokenExpiration, tokenExpirationOptions } = this.state; - const header = translate('onboarding.token.generate_project_token'); + const type = this.getTokenType(); + const header = translate('onboarding.token.generate', type); + const intro = translate('onboarding.token.text', type); return ( @@ -155,8 +172,8 @@ export default class EditTokenModal extends React.PureComponent {

      @@ -178,7 +195,10 @@ export default class EditTokenModal extends React.PureComponent { - +

      @@ -186,52 +206,56 @@ export default class EditTokenModal extends React.PureComponent { ) : ( -
      - {loading ? ( - - ) : ( - <> -
      - - -
      -
      - -
      - -
      -
      - - )} -
      +
      + +
      +