Welcome to mirror list, hosted at ThFree Co, Russian Federation.

stat_graph_contributors_spec.js « graphs « javascripts « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2ebb6845a8b3ec8521542b40fd202290b8e27c5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import ContributorsStatGraph from '~/pages/projects/graphs/show/stat_graph_contributors';
import { ContributorsGraph } from '~/pages/projects/graphs/show/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',
      );
    });
  });
});