diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2018-05-04 15:42:50 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-05-08 20:20:45 +0200 |
commit | 512335aa981a816bc9ee0725c7ee0344f525f390 (patch) | |
tree | eca5d8c9f84d600f2d7d6983c4c706fcb5026a16 /server/sonar-web | |
parent | e39373b43e24f259ac80bcf8cc49cfe8f1c94573 (diff) | |
download | sonarqube-512335aa981a816bc9ee0725c7ee0344f525f390.tar.gz sonarqube-512335aa981a816bc9ee0725c7ee0344f525f390.zip |
SONARCLOUD-34 Automatically update the footer date in SonarCloud
Diffstat (limited to 'server/sonar-web')
3 files changed, 8 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/app/components/GlobalFooterSonarCloud.tsx b/server/sonar-web/src/main/js/app/components/GlobalFooterSonarCloud.tsx index c98b4415059..6dd0208f57a 100644 --- a/server/sonar-web/src/main/js/app/components/GlobalFooterSonarCloud.tsx +++ b/server/sonar-web/src/main/js/app/components/GlobalFooterSonarCloud.tsx @@ -18,13 +18,14 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import { getYear } from 'date-fns'; import { translate } from '../../helpers/l10n'; export default function GlobalFooterSonarCloud() { return ( - <div id="footer" className="page-footer page-container"> + <div className="page-footer page-container" id="footer"> <div> - © 2008-2018, SonarCloud by{' '} + {`© 2008-${getYear(new Date())}, SonarCloud by `} <a href="http://www.sonarsource.com" title="SonarSource SA"> SonarSource SA </a> diff --git a/server/sonar-web/src/main/js/app/components/__tests__/GlobalFooterSonarCloud-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/GlobalFooterSonarCloud-test.tsx index a41b84066c4..27ba87d8e89 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/GlobalFooterSonarCloud-test.tsx +++ b/server/sonar-web/src/main/js/app/components/__tests__/GlobalFooterSonarCloud-test.tsx @@ -21,6 +21,10 @@ import * as React from 'react'; import { shallow } from 'enzyme'; import GlobalFooterSonarCloud from '../GlobalFooterSonarCloud'; +jest.mock('date-fns', () => ({ + getYear: jest.fn(() => 2018) +})); + it('should render correctly', () => { expect(shallow(<GlobalFooterSonarCloud />)).toMatchSnapshot(); }); diff --git a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooterSonarCloud-test.tsx.snap b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooterSonarCloud-test.tsx.snap index 7af6f907dfc..71c3ddf2c75 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooterSonarCloud-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooterSonarCloud-test.tsx.snap @@ -6,8 +6,7 @@ exports[`should render correctly 1`] = ` id="footer" > <div> - © 2008-2018, SonarCloud by - + © 2008-2018, SonarCloud by <a href="http://www.sonarsource.com" title="SonarSource SA" |