From 6a9d2132286ae3faf86e64eb69b06d969c809ba8 Mon Sep 17 00:00:00 2001 From: stanislavh Date: Thu, 13 Apr 2023 14:10:37 +0200 Subject: [PATCH] SONAR-18436 Migrate Project Links to RTL --- .../js/api/mocks/ProjectLinksServiceMock.ts | 63 ++++++++ .../src/main/js/app/utils/startReactApp.tsx | 4 +- .../src/main/js/apps/projectLinks/LinkRow.tsx | 6 +- .../{App.tsx => ProjectLinksApp.tsx} | 21 ++- .../apps/projectLinks/__tests__/App-test.tsx | 77 ---------- .../__tests__/CreationModal-test.tsx | 37 ----- .../projectLinks/__tests__/Header-test.tsx | 41 ----- .../projectLinks/__tests__/LinkRow-test.tsx | 55 ------- .../__tests__/ProjectLinksApp-it.tsx | 107 +++++++++++++ .../projectLinks/__tests__/Table-test.tsx | 36 ----- .../__tests__/__snapshots__/App-test.tsx.snap | 121 --------------- .../__snapshots__/CreationModal-test.tsx.snap | 87 ----------- .../__snapshots__/Header-test.tsx.snap | 30 ---- .../__snapshots__/LinkRow-test.tsx.snap | 144 ------------------ .../__snapshots__/Table-test.tsx.snap | 88 ----------- .../resources/org/sonar/l10n/core.properties | 1 + 16 files changed, 193 insertions(+), 725 deletions(-) create mode 100644 server/sonar-web/src/main/js/api/mocks/ProjectLinksServiceMock.ts rename server/sonar-web/src/main/js/apps/projectLinks/{App.tsx => ProjectLinksApp.tsx} (84%) delete mode 100644 server/sonar-web/src/main/js/apps/projectLinks/__tests__/App-test.tsx delete mode 100644 server/sonar-web/src/main/js/apps/projectLinks/__tests__/CreationModal-test.tsx delete mode 100644 server/sonar-web/src/main/js/apps/projectLinks/__tests__/Header-test.tsx delete mode 100644 server/sonar-web/src/main/js/apps/projectLinks/__tests__/LinkRow-test.tsx create mode 100644 server/sonar-web/src/main/js/apps/projectLinks/__tests__/ProjectLinksApp-it.tsx delete mode 100644 server/sonar-web/src/main/js/apps/projectLinks/__tests__/Table-test.tsx delete mode 100644 server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/App-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/CreationModal-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/Header-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/LinkRow-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/Table-test.tsx.snap diff --git a/server/sonar-web/src/main/js/api/mocks/ProjectLinksServiceMock.ts b/server/sonar-web/src/main/js/api/mocks/ProjectLinksServiceMock.ts new file mode 100644 index 00000000000..f564e9d42aa --- /dev/null +++ b/server/sonar-web/src/main/js/api/mocks/ProjectLinksServiceMock.ts @@ -0,0 +1,63 @@ +/* + * SonarQube + * Copyright (C) 2009-2023 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { cloneDeep } from 'lodash'; +import { ProjectLink } from '../../types/types'; +import { createLink, deleteLink, getProjectLinks } from '../projectLinks'; + +export default class ProjectLinksServiceMock { + projectLinks: ProjectLink[] = []; + idCounter: number = 0; + + constructor() { + jest.mocked(getProjectLinks).mockImplementation(this.handleGetProjectLinks); + jest.mocked(createLink).mockImplementation(this.handleCreateLink); + jest.mocked(deleteLink).mockImplementation(this.handleDeleteLink); + } + + handleGetProjectLinks = () => { + return this.reply(this.projectLinks); + }; + + handleCreateLink = ({ name, url }: { name: string; url: string }) => { + const link = { + id: `id${this.idCounter++}`, + name, + type: name, + url, + }; + this.projectLinks.push(link); + + return this.reply(link); + }; + + handleDeleteLink = (id: string) => { + this.projectLinks.filter((link) => link.id !== id); + + return this.reply(undefined); + }; + + reset = () => { + this.projectLinks = []; + }; + + reply(response: T): Promise { + return Promise.resolve(cloneDeep(response)); + } +} diff --git a/server/sonar-web/src/main/js/app/utils/startReactApp.tsx b/server/sonar-web/src/main/js/app/utils/startReactApp.tsx index 14e3c683fbb..c97a41582aa 100644 --- a/server/sonar-web/src/main/js/app/utils/startReactApp.tsx +++ b/server/sonar-web/src/main/js/app/utils/startReactApp.tsx @@ -43,8 +43,8 @@ import projectBaselineRoutes from '../../apps/projectBaseline/routes'; import projectBranchesRoutes from '../../apps/projectBranches/routes'; import ProjectDeletionApp from '../../apps/projectDeletion/App'; import projectDumpRoutes from '../../apps/projectDump/routes'; -import ProjectKeyApp from '../../apps/projectKey/Key'; -import ProjectLinksApp from '../../apps/projectLinks/App'; +import ProjectKeyApp from '../../apps/projectKey/ProjectKeyApp'; +import ProjectLinksApp from '../../apps/projectLinks/ProjectLinksApp'; import projectQualityGateRoutes from '../../apps/projectQualityGate/routes'; import projectQualityProfilesRoutes from '../../apps/projectQualityProfiles/routes'; import projectsRoutes from '../../apps/projects/routes'; diff --git a/server/sonar-web/src/main/js/apps/projectLinks/LinkRow.tsx b/server/sonar-web/src/main/js/apps/projectLinks/LinkRow.tsx index 6680aaca7a2..ad216214166 100644 --- a/server/sonar-web/src/main/js/apps/projectLinks/LinkRow.tsx +++ b/server/sonar-web/src/main/js/apps/projectLinks/LinkRow.tsx @@ -79,7 +79,11 @@ export default class LinkRow extends React.PureComponent { onConfirm={this.props.onDelete} > {({ onClick }) => ( - )} diff --git a/server/sonar-web/src/main/js/apps/projectLinks/App.tsx b/server/sonar-web/src/main/js/apps/projectLinks/ProjectLinksApp.tsx similarity index 84% rename from server/sonar-web/src/main/js/apps/projectLinks/App.tsx rename to server/sonar-web/src/main/js/apps/projectLinks/ProjectLinksApp.tsx index 8533444e13d..8da9634a051 100644 --- a/server/sonar-web/src/main/js/apps/projectLinks/App.tsx +++ b/server/sonar-web/src/main/js/apps/projectLinks/ProjectLinksApp.tsx @@ -36,7 +36,7 @@ interface State { loading: boolean; } -export class App extends React.PureComponent { +export class ProjectLinksApp extends React.PureComponent { mounted = false; state: State = { loading: true }; @@ -56,8 +56,12 @@ export class App extends React.PureComponent { } fetchLinks = () => { + const { + component: { key }, + } = this.props; + this.setState({ loading: true }); - getProjectLinks(this.props.component.key).then( + getProjectLinks(key).then( (links) => { if (this.mounted) { this.setState({ links, loading: false }); @@ -72,7 +76,11 @@ export class App extends React.PureComponent { }; handleCreateLink = (name: string, url: string) => { - return createLink({ name, projectKey: this.props.component.key, url }).then((link) => { + const { + component: { key }, + } = this.props; + + return createLink({ name, projectKey: key, url }).then((link) => { if (this.mounted) { this.setState(({ links = [] }) => ({ links: [...links, link], @@ -92,16 +100,17 @@ export class App extends React.PureComponent { }; render() { + const { loading, links } = this.state; return (
- - {this.state.links && } + + {links &&
} ); } } -export default withComponentContext(App); +export default withComponentContext(ProjectLinksApp); diff --git a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/App-test.tsx deleted file mode 100644 index f43a4b1ebf7..00000000000 --- a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/App-test.tsx +++ /dev/null @@ -1,77 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import { shallow } from 'enzyme'; -import * as React from 'react'; -import { createLink, deleteLink, getProjectLinks } from '../../../api/projectLinks'; -import { mockComponent } from '../../../helpers/mocks/component'; -import { waitAndUpdate } from '../../../helpers/testUtils'; -import { App } from '../App'; - -// import { getProjectLinks, createLink, deleteLink } from '../../api/projectLinks'; -jest.mock('../../../api/projectLinks', () => ({ - getProjectLinks: jest.fn().mockResolvedValue([ - { id: '1', type: 'homepage', url: 'http://example.com' }, - { id: '2', name: 'foo', type: 'foo', url: 'http://example.com/foo' }, - ]), - createLink: jest - .fn() - .mockResolvedValue({ id: '3', name: 'bar', type: 'bar', url: 'http://example.com/bar' }), - deleteLink: jest.fn().mockResolvedValue(undefined), -})); - -it('should fetch links and render', async () => { - const wrapper = shallow(); - await waitAndUpdate(wrapper); - expect(wrapper).toMatchSnapshot(); - expect(getProjectLinks).toHaveBeenCalledWith('comp'); -}); - -it('should fetch links when component changes', async () => { - const wrapper = shallow(); - await waitAndUpdate(wrapper); - expect(getProjectLinks).toHaveBeenLastCalledWith('comp'); - - wrapper.setProps({ component: { key: 'another' } }); - expect(getProjectLinks).toHaveBeenLastCalledWith('another'); -}); - -it('should create link', async () => { - const wrapper = shallow(); - await waitAndUpdate(wrapper); - - wrapper.find('Header').prop('onCreate')('bar', 'http://example.com/bar'); - await waitAndUpdate(wrapper); - expect(wrapper).toMatchSnapshot(); - expect(createLink).toHaveBeenCalledWith({ - name: 'bar', - projectKey: 'comp', - url: 'http://example.com/bar', - }); -}); - -it('should delete link', async () => { - const wrapper = shallow(); - await waitAndUpdate(wrapper); - - wrapper.find('Table').prop('onDelete')('foo'); - await waitAndUpdate(wrapper); - expect(wrapper).toMatchSnapshot(); - expect(deleteLink).toHaveBeenCalledWith('foo'); -}); diff --git a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/CreationModal-test.tsx b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/CreationModal-test.tsx deleted file mode 100644 index 7d6a8067fcb..00000000000 --- a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/CreationModal-test.tsx +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import { shallow } from 'enzyme'; -import * as React from 'react'; -import { change, submit } from '../../../helpers/testUtils'; -import CreationModal from '../CreationModal'; - -it('should create link', () => { - const onClose = jest.fn(); - const onSubmit = jest.fn().mockResolvedValue(undefined); - const wrapper = shallow(); - const form = wrapper.dive(); - - change(form.find('#create-link-name'), 'foo'); - change(form.find('#create-link-url'), 'http://example.com/foo'); - expect(form).toMatchSnapshot(); - - submit(wrapper); - expect(onSubmit).toHaveBeenCalledWith('foo', 'http://example.com/foo'); -}); diff --git a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/Header-test.tsx b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/Header-test.tsx deleted file mode 100644 index 652f19463e4..00000000000 --- a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/Header-test.tsx +++ /dev/null @@ -1,41 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import { shallow } from 'enzyme'; -import * as React from 'react'; -import { click } from '../../../helpers/testUtils'; -import Header from '../Header'; - -it('should render', () => { - expect(shallow(
)).toMatchSnapshot(); -}); - -it('should open creation modal', () => { - const onCreate = jest.fn(); - const wrapper = shallow(
); - click(wrapper.find('Button')); - expect(wrapper.find('CreationModal').exists()).toBe(true); - - wrapper.find('CreationModal').prop('onSubmit')('foo', 'http://example.com/foo'); - expect(onCreate).toHaveBeenCalledWith('foo', 'http://example.com/foo'); - - wrapper.find('CreationModal').prop('onClose')(); - wrapper.update(); - expect(wrapper.find('CreationModal').exists()).toBe(false); -}); diff --git a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/LinkRow-test.tsx b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/LinkRow-test.tsx deleted file mode 100644 index 8e6e1594ae7..00000000000 --- a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/LinkRow-test.tsx +++ /dev/null @@ -1,55 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import { shallow } from 'enzyme'; -import * as React from 'react'; -import LinkRow from '../LinkRow'; - -it('should render provided link', () => { - expect( - shallow( - - ) - ).toMatchSnapshot(); -}); - -it('should render custom link', () => { - expect( - shallow( - - ) - ).toMatchSnapshot(); -}); - -it('should render dangerous code as plain text', () => { - expect( - shallow( - - ) - ).toMatchSnapshot(); -}); diff --git a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/ProjectLinksApp-it.tsx b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/ProjectLinksApp-it.tsx new file mode 100644 index 00000000000..317ccea3a18 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/ProjectLinksApp-it.tsx @@ -0,0 +1,107 @@ +/* + * SonarQube + * Copyright (C) 2009-2023 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import userEvent from '@testing-library/user-event'; +import { last } from 'lodash'; +import React from 'react'; +import { Route } from 'react-router-dom'; +import { byRole, byText } from 'testing-library-selector'; +import ProjectLinksServiceMock from '../../../api/mocks/ProjectLinksServiceMock'; +import { mockComponent } from '../../../helpers/mocks/component'; +import { renderAppWithComponentContext } from '../../../helpers/testReactTestingUtils'; +import ProjectLinksApp from '../ProjectLinksApp'; + +jest.mock('../../../api/projectLinks'); + +const componentsMock = new ProjectLinksServiceMock(); + +afterEach(() => { + componentsMock.reset(); +}); + +it('renders project links app and can do CRUD operations', async () => { + const { ui } = getPageObjects(); + + const newLinkName1 = 'link1'; + const newLinkName2 = 'issue'; + renderProjectLinksApp(); + await ui.appIsLoaded(); + + expect(ui.noResultsTable.get()).toBeInTheDocument(); + + // Create link + await ui.createLink(newLinkName1, 'https://link.com'); + expect(ui.deleteLinkButton(newLinkName1).get()).toBeInTheDocument(); + expect(ui.noResultsTable.query()).not.toBeInTheDocument(); + + // Create invalid link with provided type + await ui.createLink(newLinkName2, 'invalidurl'); + expect(ui.deleteLinkButton(newLinkName2).query()).not.toBeInTheDocument(); + expect(byText('project_links.issue').get()).toBeInTheDocument(); + + // Delete link + await ui.deleteLink(newLinkName1); + expect(ui.deleteLinkButton(newLinkName1).query()).not.toBeInTheDocument(); +}); + +function renderProjectLinksApp() { + return renderAppWithComponentContext( + 'project/links', + () => } />, + {}, + { component: mockComponent() } + ); +} + +function getPageObjects() { + const user = userEvent.setup(); + + const ui = { + pageTitle: byRole('heading', { name: 'project_links.page' }), + noResultsTable: byText('no_results'), + createLinkButton: byRole('button', { name: 'create' }), + nameInput: byRole('textbox', { name: /project_links.name/ }), + urlInput: byRole('textbox', { name: /project_links.url/ }), + cancelDialogButton: byRole('button', { name: 'cancel' }), + deleteLinkButton: (name: string) => + byRole('button', { name: `project_links.delete_x_link.${name}` }), + deleteButton: byRole('button', { name: 'delete' }), + }; + + async function appIsLoaded() { + expect(await ui.pageTitle.find()).toBeInTheDocument(); + } + + async function createLink(name: string, url: string) { + await user.click(ui.createLinkButton.get()); + await user.type(ui.nameInput.get(), name); + await user.type(ui.urlInput.get(), url); + await user.click(last(ui.createLinkButton.getAll()) as HTMLElement); + } + + async function deleteLink(name: string) { + await user.click(ui.deleteLinkButton(name).get()); + await user.click(ui.deleteButton.get()); + } + + return { + ui: { ...ui, appIsLoaded, createLink, deleteLink }, + user, + }; +} diff --git a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/Table-test.tsx b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/Table-test.tsx deleted file mode 100644 index fe48fd38f3d..00000000000 --- a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/Table-test.tsx +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import { shallow } from 'enzyme'; -import * as React from 'react'; -import Table from '../Table'; - -it('should render', () => { - const links = [ - { id: '1', type: 'homepage', url: 'http://example.com/homepage' }, - { id: '2', type: 'issue', url: 'http://example.com/issue' }, - { id: '3', name: 'foo', type: 'foo', url: 'http://example.com/foo' }, - { id: '4', name: 'bar', type: 'bar', url: 'http://example.com/bar' }, - ]; - expect(shallow(
)).toMatchSnapshot(); -}); - -it('should render empty', () => { - expect(shallow(
)).toMatchSnapshot(); -}); diff --git a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/App-test.tsx.snap b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/App-test.tsx.snap deleted file mode 100644 index 8274d51e0fc..00000000000 --- a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/App-test.tsx.snap +++ /dev/null @@ -1,121 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should create link 1`] = ` -
- -
- -
- - -`; - -exports[`should delete link 1`] = ` -
- -
- -
- - -`; - -exports[`should fetch links and render 1`] = ` -
- -
- -
- - -`; diff --git a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/CreationModal-test.tsx.snap b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/CreationModal-test.tsx.snap deleted file mode 100644 index 3eefed9e759..00000000000 --- a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/CreationModal-test.tsx.snap +++ /dev/null @@ -1,87 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should create link 1`] = ` - -
-
-

- project_links.create_new_project_link -

-
-
- -
- - -
-
- - -
-
-
- - - create - - - cancel - -
- -
-`; diff --git a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/Header-test.tsx.snap b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/Header-test.tsx.snap deleted file mode 100644 index 36966fb6e9a..00000000000 --- a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/Header-test.tsx.snap +++ /dev/null @@ -1,30 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render 1`] = ` - -
-

- project_links.page -

-
- -
-
- project_links.page.description -
-
-
-`; diff --git a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/LinkRow-test.tsx.snap b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/LinkRow-test.tsx.snap deleted file mode 100644 index 1d479fdfb1a..00000000000 --- a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/LinkRow-test.tsx.snap +++ /dev/null @@ -1,144 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render custom link 1`] = ` - - - - - -`; - -exports[`should render dangerous code as plain text 1`] = ` - - - - - -`; - -exports[`should render provided link 1`] = ` - - - - -`; diff --git a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/Table-test.tsx.snap b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/Table-test.tsx.snap deleted file mode 100644 index 7bc58db4589..00000000000 --- a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/__snapshots__/Table-test.tsx.snap +++ /dev/null @@ -1,88 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`should render 1`] = ` -
-
-
- -
- - foo - -
-
-
- - http://example.com - - - - - -
-
- -
- - dangerous - -
-
-
- javascript:alert("Hello") - - - - -
-
- -
-
- - project_links.homepage - -
-
- - sonar.links.homepage - -
-
-
-
- - http://example.com - - -
- - - - - - - - - - - - - - -
-`; - -exports[`should render empty 1`] = ` -
- no_results -
-`; diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index 3d879075e4b..2192f4895ce 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -492,6 +492,7 @@ project_links.scm_dev=Developer connection project_links.create_new_project_link=Create New Project Link project_links.delete_project_link=Delete Project Link project_links.are_you_sure_to_delete_x_link=Are you sure you want to delete the "{0}" link? +project_links.delete_x_link=Delete "{0}" link project_links.name=Name project_links.url=URL -- 2.39.5