descriptionComponent = (
<>
This repository is already bound to a{' '}
- <a href={getBaseUrl() + '/dashboard?id=' + encodeURIComponent(projectKey)}>
+ <a href={`${getBaseUrl()}/dashboard?id=${encodeURIComponent(projectKey)}`}>
SonarCloud project
</a>
</>
<>
<p>
You don't have any project on SonarCloud yet:{' '}
- <a href={getBaseUrl() + '/onboarding'} rel="noopener noreferrer" target="_blank">
- Analyse a project
+ <a href={getBaseUrl() + '/projects/create'} rel="noopener noreferrer" target="_blank">
+ Create a project
</a>
</p>
</>
jest.mock('../../utils', () => ({
displayMessage: jest.fn(),
- isManualBindingAllowed: jest.fn(() => true)
+ isManualBindingAllowed: jest.fn()
}));
jest.mock('../../api', () => ({
beforeEach(() => {
(bindProject as jest.Mock<any>).mockClear();
(getMyProjects as jest.Mock<any>).mockClear();
+ (isManualBindingAllowed as jest.Mock<any>).mockClear();
+ (isManualBindingAllowed as jest.Mock<any>).mockReturnValue(true);
});
it('should display correctly', async () => {
it('should display correctly for auto binding', () => {
(isManualBindingAllowed as jest.Mock<any>).mockReturnValue(false);
- expect(getWrapper()).toMatchSnapshot();
- (isManualBindingAllowed as jest.Mock<any>).mockReturnValue(true);
+ expect(getWrapper({ projectKey: undefined })).toMatchSnapshot();
});
it('should display correctly for auto binding with already a projectKey', () => {
(isManualBindingAllowed as jest.Mock<any>).mockReturnValue(false);
expect(getWrapper()).toMatchSnapshot();
- (isManualBindingAllowed as jest.Mock<any>).mockReturnValue(true);
});
it('should display the authentication component and the display checkbox', async () => {
className="settings-description"
>
<React.Fragment>
- This repository is already bound to a
+ To display the quality of your repository, you have to
<a
- href="/dashboard?id=foo"
+ href="/projects/create"
>
- SonarCloud project
+ provision
</a>
+ a project on SonarCloud and trigger an analysis.
</React.Fragment>
</p>
<React.Fragment>