diff options
author | Winnie Hellmann <winnie@gitlab.com> | 2017-12-11 14:39:33 +0100 |
---|---|---|
committer | Winnie Hellmann <winnie@gitlab.com> | 2017-12-18 11:13:41 +0100 |
commit | e720e8b8fbc9c7e04e528a54cce37d18c776d2d2 (patch) | |
tree | 2af3ccfd688f912dd234a8c9f6ab3e2a4d9683bb /spec | |
parent | 1109a5cea46b25b3bd27b095c5fd11881d88bd72 (diff) | |
download | gitlab-ce-e720e8b8fbc9c7e04e528a54cce37d18c776d2d2.tar.gz |
Translate date ranges on contributors page
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/graphs/stat_graph_contributors_spec.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/javascripts/graphs/stat_graph_contributors_spec.js b/spec/javascripts/graphs/stat_graph_contributors_spec.js new file mode 100644 index 00000000000..962423462e7 --- /dev/null +++ b/spec/javascripts/graphs/stat_graph_contributors_spec.js @@ -0,0 +1,26 @@ +import ContributorsStatGraph from '~/graphs/stat_graph_contributors'; +import { ContributorsGraph } from '~/graphs/stat_graph_contributors_graph'; + +import { setLanguage } from '../helpers/locale_helper'; + +describe('ContributorsStatGraph', () => { + describe('change_date_header', () => { + beforeAll(() => { + setLanguage('de'); + }); + + afterAll(() => { + setLanguage(null); + }); + + it('uses the locale to display date ranges', () => { + ContributorsGraph.init_x_domain([{ date: '2013-01-31' }, { date: '2012-01-31' }]); + setFixtures('<div id="date_header"></div>'); + const graph = new ContributorsStatGraph(); + + graph.change_date_header(); + + expect(document.getElementById('date_header').innerText).toBe('31. Januar 2012 – 31. Januar 2013'); + }); + }); +}); |