formatterOption as dateTimeFormatterOption
} from '../../../components/intl/DateTimeFormatter';
import { parseDate } from '../../../helpers/dates';
-import { translate } from '../../../helpers/l10n';
+import { translate, translateWithParameters } from '../../../helpers/l10n';
import { formatMeasure } from '../../../helpers/measures';
import { Component, Dict } from '../../../types/types';
import { Query } from '../utils';
` - ${formatDate(tooltipEndDate, longFormatterOption)}`}
</React.Fragment>
);
+ const description = translateWithParameters(
+ 'issues.facet.createdAt.bar_description',
+ formatMeasure(stats[start], 'SHORT_INT'),
+ formatDate(startDate, longFormatterOption),
+ formatDate(tooltipEndDate, longFormatterOption)
+ );
return {
createdAfter: startDate,
createdBefore: endDate,
tooltip,
+ description,
x: index,
y: stats[start]
};
it('should display bars', () => {
const data = [
- { x: 1, y: 10 },
- { x: 2, y: 30 },
- { x: 3, y: 20 }
+ { x: 1, y: 10, description: '' },
+ { x: 2, y: 30, description: '' },
+ { x: 3, y: 20, description: '' }
];
const chart = shallow(<BarChart barsWidth={20} data={data} height={100} width={100} />);
expect(chart.find('.bar-chart-bar').length).toBe(3);
it('should display ticks', () => {
const data = [
- { x: 1, y: 10 },
- { x: 2, y: 30 },
- { x: 3, y: 20 }
+ { x: 1, y: 10, description: '' },
+ { x: 2, y: 30, description: '' },
+ { x: 3, y: 20, description: '' }
];
const ticks = ['A', 'B', 'C'];
const chart = shallow(
it('should display values', () => {
const data = [
- { x: 1, y: 10 },
- { x: 2, y: 30 },
- { x: 3, y: 20 }
+ { x: 1, y: 10, description: '' },
+ { x: 2, y: 30, description: '' },
+ { x: 3, y: 20, description: '' }
];
const values = ['A', 'B', 'C'];
const chart = shallow(
it('should display bars, ticks and values', () => {
const data = [
- { x: 1, y: 10 },
- { x: 2, y: 30 },
- { x: 3, y: 20 }
+ { x: 1, y: 10, description: '' },
+ { x: 2, y: 30, description: '' },
+ { x: 3, y: 20, description: '' }
];
const ticks = ['A', 'B', 'C'];
const values = ['A', 'B', 'C'];