diff --git a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Login-it.tsx b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Login-it.tsx
new file mode 100644
index 00000000000..70ac5f61ec6
--- /dev/null
+++ b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Login-it.tsx
@@ -0,0 +1,144 @@
+/*
+ * 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, waitFor } from '@testing-library/react';
+import userEvent from '@testing-library/user-event';
+import * as React from 'react';
+import { getIdentityProviders } from '../../../../api/users';
+import { addGlobalErrorMessage } from '../../../../helpers/globalMessages';
+import { mockLocation } from '../../../../helpers/testMocks';
+import { renderComponent } from '../../../../helpers/testReactTestingUtils';
+import { LoginContainer } from '../LoginContainer';
+
+jest.mock('../../../../api/users', () => {
+ const { mockIdentityProvider } = jest.requireActual('../../../../helpers/testMocks');
+ return {
+ getIdentityProviders: jest
+ .fn()
+ .mockResolvedValue({ identityProviders: [mockIdentityProvider()] })
+ };
+});
+
+jest.mock('../../../../api/auth', () => ({
+ logIn: jest.fn((_id, password) => (password === 'valid' ? Promise.resolve() : Promise.reject()))
+}));
+
+jest.mock('../../../../helpers/globalMessages', () => ({
+ addGlobalErrorMessage: jest.fn()
+}));
+
+const originalLocation = window.location;
+const replace = jest.fn();
+
+beforeAll(() => {
+ const location = {
+ ...window.location,
+ replace
+ };
+ Object.defineProperty(window, 'location', {
+ writable: true,
+ value: location
+ });
+});
+
+afterAll(() => {
+ Object.defineProperty(window, 'location', {
+ writable: true,
+ value: originalLocation
+ });
+});
+
+beforeEach(jest.clearAllMocks);
+
+it('should behave correctly', async () => {
+ renderLoginContainer();
+ const user = userEvent.setup();
+
+ const heading = await screen.findByRole('heading', { name: 'login.login_to_sonarqube' });
+ expect(heading).toBeInTheDocument();
+
+ // OAuth provider.
+ const link = screen.getByRole('link', { name: 'Github login.login_with_x.Github' });
+ expect(link).toBeInTheDocument();
+ expect(link).toHaveAttribute('href', '/sessions/init/github?return_to=%2Fsome%2Fpath');
+ expect(link).toMatchSnapshot('OAuthProvider link');
+
+ // Login form collapsed by default.
+ expect(screen.queryByLabelText('login')).not.toBeInTheDocument();
+
+ // Open login form, log in.
+ await user.click(screen.getByRole('button', { name: 'login.more_options' }));
+
+ const cancelLink = await screen.findByRole('link', { name: 'cancel' });
+ expect(cancelLink).toBeInTheDocument();
+ expect(cancelLink).toHaveAttribute('href', '/');
+
+ const loginField = screen.getByLabelText('login');
+ const passwordField = screen.getByLabelText('password');
+ const submitButton = screen.getByRole('button', { name: 'sessions.log_in' });
+
+ // Incorrect login.
+ await user.type(loginField, 'janedoe');
+ await user.type(passwordField, 'invalid');
+ // Don't use userEvent.click() here. This allows us to more easily see the loading state changes.
+ submitButton.click();
+ expect(submitButton).toBeDisabled(); // Loading.
+ await waitFor(() => {
+ expect(addGlobalErrorMessage).toHaveBeenCalledWith('login.authentication_failed');
+ });
+
+ // Correct login.
+ await user.clear(passwordField);
+ await user.type(passwordField, 'valid');
+ await user.click(submitButton);
+ expect(addGlobalErrorMessage).toHaveBeenCalledTimes(1);
+ expect(replace).toHaveBeenCalledWith('/some/path');
+});
+
+it('should not show any OAuth providers if none are configured', async () => {
+ (getIdentityProviders as jest.Mock).mockResolvedValueOnce({ identityProviders: [] });
+ renderLoginContainer();
+
+ const heading = await screen.findByRole('heading', { name: 'login.login_to_sonarqube' });
+ expect(heading).toBeInTheDocument();
+
+ // No OAuth providers, login form display by default.
+ expect(
+ screen.queryByRole('link', { name: 'login.login_with_x', exact: false })
+ ).not.toBeInTheDocument();
+ expect(screen.getByLabelText('login')).toBeInTheDocument();
+});
+
+it("should show a warning if there's an authorization error", async () => {
+ renderLoginContainer({
+ location: mockLocation({ query: { authorizationError: 'true' } })
+ });
+
+ const heading = await screen.findByRole('heading', { name: 'login.login_to_sonarqube' });
+ expect(heading).toBeInTheDocument();
+
+ expect(screen.getByRole('alert')).toBeInTheDocument();
+ expect(screen.getByText('login.unauthorized_access_alert')).toBeInTheDocument();
+});
+
+function renderLoginContainer(props: Partial = {}) {
+ return renderComponent(
+
+ );
+}
diff --git a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Login-test.tsx b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Login-test.tsx
deleted file mode 100644
index 5f1071ea4dc..00000000000
--- a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Login-test.tsx
+++ /dev/null
@@ -1,52 +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 { mockLocation } from '../../../../helpers/testMocks';
-import { Login, LoginProps } from '../Login';
-
-it('should render correctly', () => {
- expect(shallowRender()).toMatchSnapshot('with identity providers');
- expect(shallowRender({ identityProviders: [] })).toMatchSnapshot(
- 'without any identity providers'
- );
- expect(
- shallowRender({ location: mockLocation({ query: { authorizationError: true } }) })
- ).toMatchSnapshot('with authorization error');
-});
-
-function shallowRender(props: Partial = {}) {
- return shallow(
-
- );
-}
diff --git a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/LoginContainer-test.tsx b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/LoginContainer-test.tsx
deleted file mode 100644
index 510f7c4074f..00000000000
--- a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/LoginContainer-test.tsx
+++ /dev/null
@@ -1,69 +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 { logIn } from '../../../../api/auth';
-import { getIdentityProviders } from '../../../../api/users';
-import { mockLocation } from '../../../../helpers/testMocks';
-import { waitAndUpdate } from '../../../../helpers/testUtils';
-import { LoginContainer } from '../LoginContainer';
-
-jest.mock('../../../../api/users', () => {
- const { mockIdentityProvider } = jest.requireActual('../../../../helpers/testMocks');
- return {
- getIdentityProviders: jest
- .fn()
- .mockResolvedValue({ identityProviders: [mockIdentityProvider()] })
- };
-});
-
-jest.mock('../../../../api/auth', () => ({
- logIn: jest.fn().mockResolvedValue({})
-}));
-
-beforeEach(jest.clearAllMocks);
-
-it('should render correctly', async () => {
- const wrapper = shallowRender();
- await waitAndUpdate(wrapper);
-
- expect(wrapper).toMatchSnapshot();
- expect(getIdentityProviders).toBeCalled();
-});
-
-it('should not provide any options if no IdPs are present', async () => {
- (getIdentityProviders as jest.Mock).mockResolvedValue({});
- const wrapper = shallowRender();
- await waitAndUpdate(wrapper);
-
- expect(wrapper.type()).toBeNull();
- expect(getIdentityProviders).toBeCalled();
-});
-
-it('should handle submission', () => {
- (logIn as jest.Mock).mockResolvedValue(null);
- const wrapper = shallowRender();
- wrapper.instance().handleSubmit('user', 'pass');
- expect(logIn).toBeCalledWith('user', 'pass');
-});
-
-function shallowRender(props: Partial = {}) {
- return shallow();
-}
diff --git a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/LoginForm-test.tsx b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/LoginForm-test.tsx
deleted file mode 100644
index 5f3b1b64385..00000000000
--- a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/LoginForm-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 { change, click, submit, waitAndUpdate } from '../../../../helpers/testUtils';
-import LoginForm from '../LoginForm';
-
-it('logs in with simple credentials', () => {
- const onSubmit = jest.fn(() => Promise.resolve());
- const wrapper = shallow();
- expect(wrapper).toMatchSnapshot();
-
- change(wrapper.find('#login'), 'admin');
- change(wrapper.find('#password'), 'admin');
- submit(wrapper.find('form'));
-
- expect(onSubmit).toBeCalledWith('admin', 'admin');
-});
-
-it('should display a spinner and disabled button while loading', async () => {
- const onSubmit = jest.fn(() => Promise.resolve());
- const wrapper = shallow();
-
- change(wrapper.find('#login'), 'admin');
- change(wrapper.find('#password'), 'admin');
- submit(wrapper.find('form'));
- wrapper.update();
- expect(wrapper).toMatchSnapshot();
-
- await waitAndUpdate(wrapper);
-});
-
-it('expands more options', () => {
- const wrapper = shallow();
- expect(wrapper).toMatchSnapshot();
-
- click(wrapper.find('.js-more-options'));
- expect(wrapper).toMatchSnapshot();
-});
diff --git a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Logout-it.tsx b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Logout-it.tsx
new file mode 100644
index 00000000000..a211ec6e648
--- /dev/null
+++ b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Logout-it.tsx
@@ -0,0 +1,91 @@
+/*
+ * 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, waitFor } from '@testing-library/react';
+import * as React from 'react';
+import { logOut } from '../../../../api/auth';
+import RecentHistory from '../../../../app/components/RecentHistory';
+import { addGlobalErrorMessage } from '../../../../helpers/globalMessages';
+import { renderComponent } from '../../../../helpers/testReactTestingUtils';
+import Logout from '../Logout';
+
+jest.mock('../../../../api/auth', () => ({
+ logOut: jest.fn().mockResolvedValue(true)
+}));
+
+jest.mock('../../../../helpers/globalMessages', () => ({
+ addGlobalErrorMessage: jest.fn()
+}));
+
+jest.mock('../../../../helpers/system', () => ({
+ getBaseUrl: jest.fn().mockReturnValue('/context')
+}));
+
+jest.mock('../../../../app/components/RecentHistory', () => ({
+ __esModule: true,
+ default: {
+ clear: jest.fn()
+ }
+}));
+
+const originalLocation = window.location;
+const replace = jest.fn();
+
+beforeAll(() => {
+ const location = {
+ ...window.location,
+ replace
+ };
+ Object.defineProperty(window, 'location', {
+ writable: true,
+ value: location
+ });
+});
+
+afterAll(() => {
+ Object.defineProperty(window, 'location', {
+ writable: true,
+ value: originalLocation
+ });
+});
+
+beforeEach(jest.clearAllMocks);
+
+it('should behave correctly', async () => {
+ renderLogout();
+
+ expect(screen.getByText('logging_out')).toBeInTheDocument();
+ await waitFor(() => {
+ expect(replace).toHaveBeenCalledWith('/context/');
+ });
+ expect(RecentHistory.clear).toHaveBeenCalled();
+});
+
+it('should correctly handle a failing log out', async () => {
+ (logOut as jest.Mock).mockRejectedValueOnce(false);
+ renderLogout();
+
+ await waitFor(() => {
+ expect(addGlobalErrorMessage).toHaveBeenCalledWith('login.logout_failed');
+ });
+});
+
+function renderLogout() {
+ return renderComponent();
+}
diff --git a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Logout-test.tsx b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Logout-test.tsx
deleted file mode 100644
index 9ff8fa85c6f..00000000000
--- a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Logout-test.tsx
+++ /dev/null
@@ -1,83 +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 { logOut } from '../../../../api/auth';
-import { addGlobalErrorMessage } from '../../../../helpers/globalMessages';
-import { waitAndUpdate } from '../../../../helpers/testUtils';
-import Logout from '../Logout';
-
-jest.mock('../../../../api/auth', () => ({
- logOut: jest.fn().mockResolvedValue(true)
-}));
-
-jest.mock('../../../../helpers/globalMessages', () => ({
- addGlobalErrorMessage: jest.fn()
-}));
-
-const originalLocation = window.location;
-beforeAll(() => {
- const location = {
- ...window.location,
- replace: jest.fn()
- };
- Object.defineProperty(window, 'location', {
- writable: true,
- value: location
- });
-});
-
-beforeEach(() => {
- jest.clearAllMocks();
-});
-
-afterAll(() => {
- Object.defineProperty(window, 'location', {
- writable: true,
- value: originalLocation
- });
-});
-
-it('should logout correctly', async () => {
- (logOut as jest.Mock).mockResolvedValue(true);
-
- const wrapper = shallowRender();
- await waitAndUpdate(wrapper);
-
- expect(logOut).toHaveBeenCalled();
- expect(window.location.replace).toHaveBeenCalledWith('/');
- expect(addGlobalErrorMessage).not.toHaveBeenCalled();
-});
-
-it('should not redirect if logout fails', async () => {
- (logOut as jest.Mock).mockRejectedValue(false);
-
- const wrapper = shallowRender();
- await waitAndUpdate(wrapper);
-
- expect(logOut).toHaveBeenCalled();
- expect(window.location.replace).not.toHaveBeenCalled();
- expect(addGlobalErrorMessage).toHaveBeenCalled();
- expect(wrapper).toMatchSnapshot();
-});
-
-function shallowRender() {
- return shallow();
-}
diff --git a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/OAuthProviders-test.tsx b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/OAuthProviders-test.tsx
deleted file mode 100644
index be169509357..00000000000
--- a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/OAuthProviders-test.tsx
+++ /dev/null
@@ -1,60 +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 OAuthProviders from '../OAuthProviders';
-
-const identityProviders = [
- {
- backgroundColor: '#000',
- iconPath: '/some/path',
- key: 'foo',
- name: 'Foo'
- },
- {
- backgroundColor: '#00F',
- helpMessage: 'Help message!',
- iconPath: '/icon/path',
- key: 'bar',
- name: 'Bar'
- }
-];
-
-it('should render correctly', () => {
- const wrapper = shallow();
- expect(wrapper).toMatchSnapshot();
- wrapper.find('OAuthProvider').forEach(node => expect(node.dive()).toMatchSnapshot());
-});
-
-it('should use the custom label formatter', () => {
- const wrapper = shallow(
- 'custom_format.' + name}
- identityProviders={[identityProviders[0]]}
- returnTo=""
- />
- );
- expect(
- wrapper
- .find('OAuthProvider')
- .first()
- .dive()
- ).toMatchSnapshot();
-});
diff --git a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Unauthorized-it.tsx b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Unauthorized-it.tsx
new file mode 100644
index 00000000000..ddbf360f5b3
--- /dev/null
+++ b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Unauthorized-it.tsx
@@ -0,0 +1,46 @@
+/*
+ * 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 } from '@testing-library/react';
+import * as React from 'react';
+import { getCookie } from '../../../../helpers/cookies';
+import { renderComponent } from '../../../../helpers/testReactTestingUtils';
+import Unauthorized from '../Unauthorized';
+
+jest.mock('../../../../helpers/cookies', () => ({
+ getCookie: jest.fn()
+}));
+
+it('should render correctly', () => {
+ renderUnauthorized();
+ expect(screen.getByText('unauthorized.message')).toBeInTheDocument();
+ expect(screen.queryByText('REASON')).not.toBeInTheDocument();
+ expect(screen.getByRole('link', { name: 'layout.home' })).toBeInTheDocument();
+});
+
+it('should correctly get the reason from the cookie', () => {
+ (getCookie as jest.Mock).mockReturnValueOnce('REASON');
+ renderUnauthorized();
+ expect(screen.getByText('unauthorized.reason REASON')).toBeInTheDocument();
+});
+
+function renderUnauthorized() {
+ return renderComponent();
+}
diff --git a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Unauthorized-test.tsx b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Unauthorized-test.tsx
deleted file mode 100644
index 392ac1d59c7..00000000000
--- a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/Unauthorized-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 Unauthorized from '../Unauthorized';
-
-jest.mock('../../../../helpers/cookies', () => ({
- getCookie: jest.fn().mockReturnValue('Foo')
-}));
-
-it('render', () => {
- expect(shallow()).toMatchSnapshot();
-});
diff --git a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/__snapshots__/Login-it.tsx.snap b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/__snapshots__/Login-it.tsx.snap
new file mode 100644
index 00000000000..96449a1dc42
--- /dev/null
+++ b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/__snapshots__/Login-it.tsx.snap
@@ -0,0 +1,19 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should behave correctly: OAuthProvider link 1`] = `
+
+
+
+ login.login_with_x.Github
+
+
+`;
diff --git a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/__snapshots__/Login-test.tsx.snap b/server/sonar-web/src/main/js/apps/sessions/components/__tests__/__snapshots__/Login-test.tsx.snap
deleted file mode 100644
index 22b570e17b1..00000000000
--- a/server/sonar-web/src/main/js/apps/sessions/components/__tests__/__snapshots__/Login-test.tsx.snap
+++ /dev/null
@@ -1,85 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`should render correctly: with authorization error 1`] = `
-