2020-05-24 23:13:21 +05:30
|
|
|
import { mount, shallowMount } from '@vue/test-utils';
|
2019-12-26 22:10:19 +05:30
|
|
|
import { setTestTimeout } from 'helpers/timeout';
|
2020-06-23 00:09:42 +05:30
|
|
|
import timezoneMock from 'timezone-mock';
|
2019-12-04 20:38:33 +05:30
|
|
|
import { GlLink } from '@gitlab/ui';
|
2020-04-22 19:07:51 +05:30
|
|
|
import { TEST_HOST } from 'jest/helpers/test_constants';
|
|
|
|
import {
|
|
|
|
GlAreaChart,
|
|
|
|
GlLineChart,
|
|
|
|
GlChartSeriesLabel,
|
|
|
|
GlChartLegend,
|
|
|
|
} from '@gitlab/ui/dist/charts';
|
2020-04-08 14:13:33 +05:30
|
|
|
import { cloneDeep } from 'lodash';
|
2019-12-26 22:10:19 +05:30
|
|
|
import { shallowWrapperContainsSlotText } from 'helpers/vue_test_utils_helper';
|
2020-01-01 13:55:28 +05:30
|
|
|
import { createStore } from '~/monitoring/stores';
|
2020-05-24 23:13:21 +05:30
|
|
|
import { panelTypes, chartHeight } from '~/monitoring/constants';
|
2019-12-04 20:38:33 +05:30
|
|
|
import TimeSeries from '~/monitoring/components/charts/time_series.vue';
|
|
|
|
import * as types from '~/monitoring/stores/mutation_types';
|
2020-04-22 19:07:51 +05:30
|
|
|
import { deploymentData, mockProjectDir, annotationsData } from '../../mock_data';
|
2019-12-26 22:10:19 +05:30
|
|
|
import {
|
2020-04-22 19:07:51 +05:30
|
|
|
metricsDashboardPayload,
|
2020-04-08 14:13:33 +05:30
|
|
|
metricsDashboardViewModel,
|
2020-04-22 19:07:51 +05:30
|
|
|
metricResultStatus,
|
|
|
|
} from '../../fixture_data';
|
2020-03-13 15:44:24 +05:30
|
|
|
|
|
|
|
jest.mock('lodash/throttle', () =>
|
|
|
|
// this throttle mock executes immediately
|
|
|
|
jest.fn(func => {
|
|
|
|
// eslint-disable-next-line no-param-reassign
|
|
|
|
func.cancel = jest.fn();
|
|
|
|
return func;
|
|
|
|
}),
|
|
|
|
);
|
2019-12-26 22:10:19 +05:30
|
|
|
jest.mock('~/lib/utils/icon_utils', () => ({
|
2020-06-23 00:09:42 +05:30
|
|
|
getSvgIconPathContent: jest.fn().mockImplementation(icon => Promise.resolve(`${icon}-content`)),
|
2019-12-26 22:10:19 +05:30
|
|
|
}));
|
2019-12-04 20:38:33 +05:30
|
|
|
|
|
|
|
describe('Time series component', () => {
|
|
|
|
let mockGraphData;
|
|
|
|
let store;
|
2020-06-23 00:09:42 +05:30
|
|
|
let wrapper;
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
const createWrapper = (
|
|
|
|
{ graphData = mockGraphData, ...props } = {},
|
|
|
|
mountingMethod = shallowMount,
|
|
|
|
) => {
|
|
|
|
wrapper = mountingMethod(TimeSeries, {
|
2020-04-08 14:13:33 +05:30
|
|
|
propsData: {
|
2020-05-24 23:13:21 +05:30
|
|
|
graphData,
|
2020-04-08 14:13:33 +05:30
|
|
|
deploymentData: store.state.monitoringDashboard.deploymentData,
|
2020-04-22 19:07:51 +05:30
|
|
|
annotations: store.state.monitoringDashboard.annotations,
|
|
|
|
projectPath: `${TEST_HOST}${mockProjectDir}`,
|
2020-06-23 00:09:42 +05:30
|
|
|
...props,
|
2020-04-08 14:13:33 +05:30
|
|
|
},
|
|
|
|
store,
|
2020-04-22 19:07:51 +05:30
|
|
|
stubs: {
|
|
|
|
GlPopover: true,
|
|
|
|
},
|
2020-06-23 00:09:42 +05:30
|
|
|
attachToDocument: true,
|
2020-04-08 14:13:33 +05:30
|
|
|
});
|
2020-06-23 00:09:42 +05:30
|
|
|
};
|
2019-12-26 22:10:19 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
describe('With a single time series', () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
setTestTimeout(1000);
|
2019-12-26 22:10:19 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
store = createStore();
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
store.commit(
|
2020-04-22 19:07:51 +05:30
|
|
|
`monitoringDashboard/${types.RECEIVE_METRICS_DASHBOARD_SUCCESS}`,
|
2020-04-08 14:13:33 +05:30
|
|
|
metricsDashboardPayload,
|
|
|
|
);
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
store.commit(`monitoringDashboard/${types.RECEIVE_DEPLOYMENTS_DATA_SUCCESS}`, deploymentData);
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
store.commit(
|
|
|
|
`monitoringDashboard/${types.RECEIVE_METRIC_RESULT_SUCCESS}`,
|
2020-04-22 19:07:51 +05:30
|
|
|
metricResultStatus,
|
2020-04-08 14:13:33 +05:30
|
|
|
);
|
|
|
|
// dashboard is a dynamically generated fixture and stored at environment_metrics_dashboard.json
|
|
|
|
[mockGraphData] = store.state.monitoringDashboard.dashboard.panelGroups[1].panels;
|
2019-12-04 20:38:33 +05:30
|
|
|
});
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
describe('general functions', () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
const findChart = () => wrapper.find({ ref: 'chart' });
|
2019-12-21 20:55:43 +05:30
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
beforeEach(() => {
|
2020-06-23 00:09:42 +05:30
|
|
|
createWrapper({}, mount);
|
|
|
|
return wrapper.vm.$nextTick();
|
2020-03-13 15:44:24 +05:30
|
|
|
});
|
2019-12-21 20:55:43 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
afterEach(() => {
|
|
|
|
wrapper.destroy();
|
2020-03-13 15:44:24 +05:30
|
|
|
});
|
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
it('allows user to override legend label texts using props', () => {
|
|
|
|
const legendRelatedProps = {
|
|
|
|
legendMinText: 'legendMinText',
|
|
|
|
legendMaxText: 'legendMaxText',
|
|
|
|
legendAverageText: 'legendAverageText',
|
|
|
|
legendCurrentText: 'legendCurrentText',
|
|
|
|
};
|
|
|
|
wrapper.setProps({
|
|
|
|
...legendRelatedProps,
|
|
|
|
});
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
return wrapper.vm.$nextTick().then(() => {
|
|
|
|
expect(findChart().props()).toMatchObject(legendRelatedProps);
|
2020-03-13 15:44:24 +05:30
|
|
|
});
|
|
|
|
});
|
2019-12-21 20:55:43 +05:30
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
it('chart sets a default height', () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
createWrapper();
|
2020-05-24 23:13:21 +05:30
|
|
|
expect(wrapper.props('height')).toBe(chartHeight);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('chart has a configurable height', () => {
|
|
|
|
const mockHeight = 599;
|
2020-06-23 00:09:42 +05:30
|
|
|
createWrapper();
|
2020-05-24 23:13:21 +05:30
|
|
|
|
|
|
|
wrapper.setProps({ height: mockHeight });
|
|
|
|
return wrapper.vm.$nextTick().then(() => {
|
|
|
|
expect(wrapper.props('height')).toBe(mockHeight);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
describe('events', () => {
|
|
|
|
describe('datazoom', () => {
|
|
|
|
let eChartMock;
|
|
|
|
let startValue;
|
|
|
|
let endValue;
|
2019-12-26 22:10:19 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
beforeEach(() => {
|
2020-04-08 14:13:33 +05:30
|
|
|
eChartMock = {
|
|
|
|
handlers: {},
|
|
|
|
getOption: () => ({
|
|
|
|
dataZoom: [
|
|
|
|
{
|
|
|
|
startValue,
|
|
|
|
endValue,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}),
|
|
|
|
off: jest.fn(eChartEvent => {
|
|
|
|
delete eChartMock.handlers[eChartEvent];
|
|
|
|
}),
|
|
|
|
on: jest.fn((eChartEvent, fn) => {
|
|
|
|
eChartMock.handlers[eChartEvent] = fn;
|
|
|
|
}),
|
|
|
|
};
|
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
createWrapper({}, mount);
|
|
|
|
return wrapper.vm.$nextTick(() => {
|
2020-04-08 14:13:33 +05:30
|
|
|
findChart().vm.$emit('created', eChartMock);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('handles datazoom event from chart', () => {
|
|
|
|
startValue = 1577836800000; // 2020-01-01T00:00:00.000Z
|
|
|
|
endValue = 1577840400000; // 2020-01-01T01:00:00.000Z
|
|
|
|
eChartMock.handlers.datazoom();
|
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
expect(wrapper.emitted('datazoom')).toHaveLength(1);
|
|
|
|
expect(wrapper.emitted('datazoom')[0]).toEqual([
|
2019-12-26 22:10:19 +05:30
|
|
|
{
|
2020-04-08 14:13:33 +05:30
|
|
|
start: new Date(startValue).toISOString(),
|
|
|
|
end: new Date(endValue).toISOString(),
|
2019-12-26 22:10:19 +05:30
|
|
|
},
|
2020-04-08 14:13:33 +05:30
|
|
|
]);
|
2019-12-26 22:10:19 +05:30
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
});
|
2020-04-08 14:13:33 +05:30
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
describe('methods', () => {
|
|
|
|
describe('formatTooltipText', () => {
|
2020-04-22 19:07:51 +05:30
|
|
|
const mockCommitUrl = deploymentData[0].commitUrl;
|
|
|
|
const mockDate = deploymentData[0].created_at;
|
|
|
|
const mockSha = 'f5bcd1d9';
|
|
|
|
const mockLineSeriesData = () => ({
|
|
|
|
seriesData: [
|
|
|
|
{
|
2020-06-23 00:09:42 +05:30
|
|
|
seriesName: wrapper.vm.chartData[0].name,
|
2020-04-22 19:07:51 +05:30
|
|
|
componentSubType: 'line',
|
|
|
|
value: [mockDate, 5.55555],
|
|
|
|
dataIndex: 0,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
value: mockDate,
|
2019-12-04 20:38:33 +05:30
|
|
|
});
|
|
|
|
|
2020-04-22 19:07:51 +05:30
|
|
|
const annotationsMetadata = {
|
|
|
|
tooltipData: {
|
|
|
|
sha: mockSha,
|
|
|
|
commitUrl: mockCommitUrl,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
const mockAnnotationsSeriesData = {
|
|
|
|
seriesData: [
|
|
|
|
{
|
|
|
|
componentSubType: 'scatter',
|
|
|
|
seriesName: 'series01',
|
|
|
|
dataIndex: 0,
|
|
|
|
value: [mockDate, 5.55555],
|
|
|
|
type: 'scatter',
|
|
|
|
name: 'deployments',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
value: mockDate,
|
|
|
|
};
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
it('does not throw error if data point is outside the zoom range', () => {
|
2020-04-22 19:07:51 +05:30
|
|
|
const seriesDataWithoutValue = {
|
|
|
|
...mockLineSeriesData(),
|
|
|
|
seriesData: mockLineSeriesData().seriesData.map(data => ({
|
|
|
|
...data,
|
|
|
|
value: undefined,
|
|
|
|
})),
|
|
|
|
};
|
2020-06-23 00:09:42 +05:30
|
|
|
expect(wrapper.vm.formatTooltipText(seriesDataWithoutValue)).toBeUndefined();
|
2019-12-04 20:38:33 +05:30
|
|
|
});
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
describe('when series is of line type', () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
beforeEach(() => {
|
|
|
|
createWrapper();
|
|
|
|
wrapper.vm.formatTooltipText(mockLineSeriesData());
|
|
|
|
return wrapper.vm.$nextTick();
|
2020-04-08 14:13:33 +05:30
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
it('formats tooltip title', () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
expect(wrapper.vm.tooltip.title).toBe('16 Jul 2019, 10:14AM (GMT+0000)');
|
2020-04-08 14:13:33 +05:30
|
|
|
});
|
2019-12-26 22:10:19 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
it('formats tooltip content', () => {
|
|
|
|
const name = 'Status Code';
|
|
|
|
const value = '5.556';
|
|
|
|
const dataIndex = 0;
|
2020-06-23 00:09:42 +05:30
|
|
|
const seriesLabel = wrapper.find(GlChartSeriesLabel);
|
2020-04-08 14:13:33 +05:30
|
|
|
|
|
|
|
expect(seriesLabel.vm.color).toBe('');
|
|
|
|
expect(shallowWrapperContainsSlotText(seriesLabel, 'default', name)).toBe(true);
|
2020-06-23 00:09:42 +05:30
|
|
|
expect(wrapper.vm.tooltip.content).toEqual([
|
2020-04-08 14:13:33 +05:30
|
|
|
{ name, value, dataIndex, color: undefined },
|
|
|
|
]);
|
|
|
|
|
|
|
|
expect(
|
2020-06-23 00:09:42 +05:30
|
|
|
shallowWrapperContainsSlotText(wrapper.find(GlAreaChart), 'tooltipContent', value),
|
2020-04-08 14:13:33 +05:30
|
|
|
).toBe(true);
|
|
|
|
});
|
2020-06-23 00:09:42 +05:30
|
|
|
|
|
|
|
describe('when in PT timezone', () => {
|
|
|
|
beforeAll(() => {
|
|
|
|
// Note: node.js env renders (GMT-0700), in the browser we see (PDT)
|
|
|
|
timezoneMock.register('US/Pacific');
|
|
|
|
});
|
|
|
|
|
|
|
|
afterAll(() => {
|
|
|
|
timezoneMock.unregister();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('formats tooltip title in local timezone by default', () => {
|
|
|
|
createWrapper();
|
|
|
|
wrapper.vm.formatTooltipText(mockLineSeriesData());
|
|
|
|
return wrapper.vm.$nextTick().then(() => {
|
|
|
|
expect(wrapper.vm.tooltip.title).toBe('16 Jul 2019, 3:14AM (GMT-0700)');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('formats tooltip title in local timezone', () => {
|
|
|
|
createWrapper({ timezone: 'LOCAL' });
|
|
|
|
wrapper.vm.formatTooltipText(mockLineSeriesData());
|
|
|
|
return wrapper.vm.$nextTick().then(() => {
|
|
|
|
expect(wrapper.vm.tooltip.title).toBe('16 Jul 2019, 3:14AM (GMT-0700)');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('formats tooltip title in UTC format', () => {
|
|
|
|
createWrapper({ timezone: 'UTC' });
|
|
|
|
wrapper.vm.formatTooltipText(mockLineSeriesData());
|
|
|
|
return wrapper.vm.$nextTick().then(() => {
|
|
|
|
expect(wrapper.vm.tooltip.title).toBe('16 Jul 2019, 10:14AM (UTC)');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
});
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
describe('when series is of scatter type, for deployments', () => {
|
|
|
|
beforeEach(() => {
|
2020-06-23 00:09:42 +05:30
|
|
|
wrapper.vm.formatTooltipText({
|
2020-04-22 19:07:51 +05:30
|
|
|
...mockAnnotationsSeriesData,
|
|
|
|
seriesData: mockAnnotationsSeriesData.seriesData.map(data => ({
|
|
|
|
...data,
|
|
|
|
data: annotationsMetadata,
|
|
|
|
})),
|
|
|
|
});
|
2020-06-23 00:09:42 +05:30
|
|
|
return wrapper.vm.$nextTick;
|
2020-04-22 19:07:51 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
it('set tooltip type to deployments', () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
expect(wrapper.vm.tooltip.type).toBe('deployments');
|
2020-04-08 14:13:33 +05:30
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
it('formats tooltip title', () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
expect(wrapper.vm.tooltip.title).toBe('16 Jul 2019, 10:14AM (GMT+0000)');
|
2020-04-08 14:13:33 +05:30
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
it('formats tooltip sha', () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
expect(wrapper.vm.tooltip.sha).toBe('f5bcd1d9');
|
2020-04-08 14:13:33 +05:30
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
it('formats tooltip commit url', () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
expect(wrapper.vm.tooltip.commitUrl).toBe(mockCommitUrl);
|
2020-04-08 14:13:33 +05:30
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
});
|
2020-04-22 19:07:51 +05:30
|
|
|
|
|
|
|
describe('when series is of scatter type and deployments data is missing', () => {
|
|
|
|
beforeEach(() => {
|
2020-06-23 00:09:42 +05:30
|
|
|
wrapper.vm.formatTooltipText(mockAnnotationsSeriesData);
|
|
|
|
return wrapper.vm.$nextTick;
|
2020-04-22 19:07:51 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
it('formats tooltip title', () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
expect(wrapper.vm.tooltip.title).toBe('16 Jul 2019, 10:14AM (GMT+0000)');
|
2020-04-22 19:07:51 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
it('formats tooltip sha', () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
expect(wrapper.vm.tooltip.sha).toBeUndefined();
|
2020-04-22 19:07:51 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
it('formats tooltip commit url', () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
expect(wrapper.vm.tooltip.commitUrl).toBeUndefined();
|
2020-04-22 19:07:51 +05:30
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('formatAnnotationsTooltipText', () => {
|
|
|
|
const annotationsMetadata = {
|
|
|
|
name: 'annotations',
|
|
|
|
xAxis: annotationsData[0].from,
|
|
|
|
yAxis: 0,
|
|
|
|
tooltipData: {
|
|
|
|
title: '2020/02/19 10:01:41',
|
|
|
|
content: annotationsData[0].description,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
const mockMarkPoint = {
|
|
|
|
componentType: 'markPoint',
|
|
|
|
name: 'annotations',
|
|
|
|
value: undefined,
|
|
|
|
data: annotationsMetadata,
|
|
|
|
};
|
|
|
|
|
|
|
|
it('formats tooltip title and sets tooltip content', () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
const formattedTooltipData = wrapper.vm.formatAnnotationsTooltipText(mockMarkPoint);
|
|
|
|
expect(formattedTooltipData.title).toBe('19 Feb 2020, 10:01AM (GMT+0000)');
|
2020-04-22 19:07:51 +05:30
|
|
|
expect(formattedTooltipData.content).toBe(annotationsMetadata.tooltipData.content);
|
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
});
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
describe('onResize', () => {
|
|
|
|
const mockWidth = 233;
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
beforeEach(() => {
|
|
|
|
jest.spyOn(Element.prototype, 'getBoundingClientRect').mockImplementation(() => ({
|
|
|
|
width: mockWidth,
|
|
|
|
}));
|
2020-06-23 00:09:42 +05:30
|
|
|
wrapper.vm.onResize();
|
2020-04-08 14:13:33 +05:30
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
it('sets area chart width', () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
expect(wrapper.vm.width).toBe(mockWidth);
|
2020-04-08 14:13:33 +05:30
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
describe('computed', () => {
|
|
|
|
const getChartOptions = () => findChart().props('option');
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
describe('chartData', () => {
|
|
|
|
let chartData;
|
|
|
|
const seriesData = () => chartData[0];
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
beforeEach(() => {
|
2020-06-23 00:09:42 +05:30
|
|
|
({ chartData } = wrapper.vm);
|
2020-04-08 14:13:33 +05:30
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
it('utilizes all data points', () => {
|
|
|
|
const { values } = mockGraphData.metrics[0].result[0];
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
expect(chartData.length).toBe(1);
|
|
|
|
expect(seriesData().data.length).toBe(values.length);
|
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
it('creates valid data', () => {
|
|
|
|
const { data } = seriesData();
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
expect(
|
|
|
|
data.filter(
|
|
|
|
([time, value]) => new Date(time).getTime() > 0 && typeof value === 'number',
|
|
|
|
).length,
|
|
|
|
).toBe(data.length);
|
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
it('formats line width correctly', () => {
|
|
|
|
expect(chartData[0].lineStyle.width).toBe(2);
|
|
|
|
});
|
2020-03-13 15:44:24 +05:30
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
describe('chartOptions', () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
describe('dataZoom', () => {
|
|
|
|
it('renders with scroll handle icons', () => {
|
|
|
|
expect(getChartOptions().dataZoom).toHaveLength(1);
|
|
|
|
expect(getChartOptions().dataZoom[0]).toMatchObject({
|
|
|
|
handleIcon: 'path://scroll-handle-content',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('xAxis pointer', () => {
|
|
|
|
it('snap is set to false by default', () => {
|
|
|
|
expect(getChartOptions().xAxis.axisPointer.snap).toBe(false);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
describe('are extended by `option`', () => {
|
|
|
|
const mockSeriesName = 'Extra series 1';
|
|
|
|
const mockOption = {
|
|
|
|
option1: 'option1',
|
|
|
|
option2: 'option2',
|
|
|
|
};
|
2019-12-26 22:10:19 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
it('arbitrary options', () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
wrapper.setProps({
|
2020-04-08 14:13:33 +05:30
|
|
|
option: mockOption,
|
|
|
|
});
|
2019-12-26 22:10:19 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
return wrapper.vm.$nextTick().then(() => {
|
2020-04-08 14:13:33 +05:30
|
|
|
expect(getChartOptions()).toEqual(expect.objectContaining(mockOption));
|
|
|
|
});
|
2019-12-26 22:10:19 +05:30
|
|
|
});
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
it('additional series', () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
wrapper.setProps({
|
2020-04-08 14:13:33 +05:30
|
|
|
option: {
|
|
|
|
series: [
|
|
|
|
{
|
|
|
|
name: mockSeriesName,
|
2020-04-22 19:07:51 +05:30
|
|
|
type: 'line',
|
|
|
|
data: [],
|
2020-04-08 14:13:33 +05:30
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
return wrapper.vm.$nextTick().then(() => {
|
2020-04-08 14:13:33 +05:30
|
|
|
const optionSeries = getChartOptions().series;
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
expect(optionSeries.length).toEqual(2);
|
|
|
|
expect(optionSeries[0].name).toEqual(mockSeriesName);
|
|
|
|
});
|
2020-03-13 15:44:24 +05:30
|
|
|
});
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
it('additional y-axis data', () => {
|
|
|
|
const mockCustomYAxisOption = {
|
|
|
|
name: 'Custom y-axis label',
|
|
|
|
axisLabel: {
|
|
|
|
formatter: jest.fn(),
|
|
|
|
},
|
|
|
|
};
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
wrapper.setProps({
|
2020-04-08 14:13:33 +05:30
|
|
|
option: {
|
|
|
|
yAxis: mockCustomYAxisOption,
|
|
|
|
},
|
|
|
|
});
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
return wrapper.vm.$nextTick().then(() => {
|
2020-04-08 14:13:33 +05:30
|
|
|
const { yAxis } = getChartOptions();
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
expect(yAxis[0]).toMatchObject(mockCustomYAxisOption);
|
|
|
|
});
|
2020-03-13 15:44:24 +05:30
|
|
|
});
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
it('additional x axis data', () => {
|
|
|
|
const mockCustomXAxisOption = {
|
|
|
|
name: 'Custom x axis label',
|
|
|
|
};
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
wrapper.setProps({
|
2020-04-08 14:13:33 +05:30
|
|
|
option: {
|
|
|
|
xAxis: mockCustomXAxisOption,
|
|
|
|
},
|
|
|
|
});
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
return wrapper.vm.$nextTick().then(() => {
|
2020-04-08 14:13:33 +05:30
|
|
|
const { xAxis } = getChartOptions();
|
2019-12-26 22:10:19 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
expect(xAxis).toMatchObject(mockCustomXAxisOption);
|
|
|
|
});
|
2020-03-13 15:44:24 +05:30
|
|
|
});
|
2019-12-26 22:10:19 +05:30
|
|
|
});
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
describe('yAxis formatter', () => {
|
|
|
|
let dataFormatter;
|
|
|
|
let deploymentFormatter;
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
beforeEach(() => {
|
|
|
|
dataFormatter = getChartOptions().yAxis[0].axisLabel.formatter;
|
|
|
|
deploymentFormatter = getChartOptions().yAxis[1].axisLabel.formatter;
|
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-22 19:07:51 +05:30
|
|
|
it('formats by default to precision notation', () => {
|
|
|
|
expect(dataFormatter(0.88888)).toBe('889m');
|
2020-04-08 14:13:33 +05:30
|
|
|
});
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
it('deployment formatter is set as is required to display a tooltip', () => {
|
|
|
|
expect(deploymentFormatter).toEqual(expect.any(Function));
|
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2020-04-22 19:07:51 +05:30
|
|
|
describe('annotationSeries', () => {
|
2020-04-08 14:13:33 +05:30
|
|
|
it('utilizes deployment data', () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
const annotationSeries = wrapper.vm.chartOptionSeries[0];
|
2020-04-22 19:07:51 +05:30
|
|
|
expect(annotationSeries.yAxisIndex).toBe(1); // same as annotations y axis
|
|
|
|
expect(annotationSeries.data).toEqual([
|
|
|
|
expect.objectContaining({
|
|
|
|
symbolSize: 14,
|
2020-06-23 00:09:42 +05:30
|
|
|
symbol: 'path://rocket-content',
|
2020-04-22 19:07:51 +05:30
|
|
|
value: ['2019-07-16T10:14:25.589Z', expect.any(Number)],
|
|
|
|
}),
|
|
|
|
expect.objectContaining({
|
|
|
|
symbolSize: 14,
|
2020-06-23 00:09:42 +05:30
|
|
|
symbol: 'path://rocket-content',
|
2020-04-22 19:07:51 +05:30
|
|
|
value: ['2019-07-16T11:14:25.589Z', expect.any(Number)],
|
|
|
|
}),
|
|
|
|
expect.objectContaining({
|
|
|
|
symbolSize: 14,
|
2020-06-23 00:09:42 +05:30
|
|
|
symbol: 'path://rocket-content',
|
2020-04-22 19:07:51 +05:30
|
|
|
value: ['2019-07-16T12:14:25.589Z', expect.any(Number)],
|
|
|
|
}),
|
2020-04-08 14:13:33 +05:30
|
|
|
]);
|
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
});
|
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
describe('xAxisLabel', () => {
|
|
|
|
const mockDate = Date.UTC(2020, 4, 26, 20); // 8:00 PM in GMT
|
|
|
|
|
|
|
|
const useXAxisFormatter = date => {
|
|
|
|
const { xAxis } = getChartOptions();
|
|
|
|
const { formatter } = xAxis.axisLabel;
|
|
|
|
return formatter(date);
|
|
|
|
};
|
|
|
|
|
|
|
|
it('x-axis is formatted correctly in AM/PM format', () => {
|
|
|
|
expect(useXAxisFormatter(mockDate)).toEqual('8:00 PM');
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('when in PT timezone', () => {
|
|
|
|
beforeAll(() => {
|
|
|
|
timezoneMock.register('US/Pacific');
|
|
|
|
});
|
|
|
|
|
|
|
|
afterAll(() => {
|
|
|
|
timezoneMock.unregister();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('by default, values are formatted in PT', () => {
|
|
|
|
createWrapper();
|
|
|
|
expect(useXAxisFormatter(mockDate)).toEqual('1:00 PM');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('when the chart uses local timezone, y-axis is formatted in PT', () => {
|
|
|
|
createWrapper({ timezone: 'LOCAL' });
|
|
|
|
expect(useXAxisFormatter(mockDate)).toEqual('1:00 PM');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('when the chart uses UTC, y-axis is formatted in UTC', () => {
|
|
|
|
createWrapper({ timezone: 'UTC' });
|
|
|
|
expect(useXAxisFormatter(mockDate)).toEqual('8:00 PM');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
describe('yAxisLabel', () => {
|
|
|
|
it('y-axis is configured correctly', () => {
|
|
|
|
const { yAxis } = getChartOptions();
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
expect(yAxis).toHaveLength(2);
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
const [dataAxis, deploymentAxis] = yAxis;
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
expect(dataAxis.boundaryGap).toHaveLength(2);
|
|
|
|
expect(dataAxis.scale).toBe(true);
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
expect(deploymentAxis.show).toBe(false);
|
|
|
|
expect(deploymentAxis.min).toEqual(expect.any(Number));
|
|
|
|
expect(deploymentAxis.max).toEqual(expect.any(Number));
|
|
|
|
expect(deploymentAxis.min).toBeLessThan(deploymentAxis.max);
|
|
|
|
});
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
it('constructs a label for the chart y-axis', () => {
|
|
|
|
const { yAxis } = getChartOptions();
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
expect(yAxis[0].name).toBe('Requests / Sec');
|
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
afterEach(() => {
|
2020-06-23 00:09:42 +05:30
|
|
|
wrapper.destroy();
|
2020-04-08 14:13:33 +05:30
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
});
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
describe('wrapped components', () => {
|
|
|
|
const glChartComponents = [
|
|
|
|
{
|
2020-05-24 23:13:21 +05:30
|
|
|
chartType: panelTypes.AREA_CHART,
|
2020-04-08 14:13:33 +05:30
|
|
|
component: GlAreaChart,
|
|
|
|
},
|
|
|
|
{
|
2020-05-24 23:13:21 +05:30
|
|
|
chartType: panelTypes.LINE_CHART,
|
2020-04-08 14:13:33 +05:30
|
|
|
component: GlLineChart,
|
|
|
|
},
|
|
|
|
];
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
glChartComponents.forEach(dynamicComponent => {
|
|
|
|
describe(`GitLab UI: ${dynamicComponent.chartType}`, () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
const findChartComponent = () => wrapper.find(dynamicComponent.component);
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
beforeEach(() => {
|
|
|
|
createWrapper(
|
|
|
|
{ graphData: { ...mockGraphData, type: dynamicComponent.chartType } },
|
2020-05-24 23:13:21 +05:30
|
|
|
mount,
|
|
|
|
);
|
2020-06-23 00:09:42 +05:30
|
|
|
return wrapper.vm.$nextTick();
|
2020-04-08 14:13:33 +05:30
|
|
|
});
|
2019-12-26 22:10:19 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
it('is a Vue instance', () => {
|
|
|
|
expect(findChartComponent().exists()).toBe(true);
|
|
|
|
expect(findChartComponent().isVueInstance()).toBe(true);
|
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
it('receives data properties needed for proper chart render', () => {
|
|
|
|
const props = findChartComponent().props();
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
expect(props.data).toBe(wrapper.vm.chartData);
|
|
|
|
expect(props.option).toBe(wrapper.vm.chartOptions);
|
|
|
|
expect(props.formatTooltipText).toBe(wrapper.vm.formatTooltipText);
|
|
|
|
expect(props.thresholds).toBe(wrapper.vm.thresholds);
|
2020-04-08 14:13:33 +05:30
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
it('receives a tooltip title', () => {
|
2020-04-08 14:13:33 +05:30
|
|
|
const mockTitle = 'mockTitle';
|
2020-06-23 00:09:42 +05:30
|
|
|
wrapper.vm.tooltip.title = mockTitle;
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
return wrapper.vm.$nextTick(() => {
|
2020-04-08 14:13:33 +05:30
|
|
|
expect(
|
|
|
|
shallowWrapperContainsSlotText(findChartComponent(), 'tooltipTitle', mockTitle),
|
|
|
|
).toBe(true);
|
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
});
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
describe('when tooltip is showing deployment data', () => {
|
|
|
|
const mockSha = 'mockSha';
|
|
|
|
const commitUrl = `${mockProjectDir}/-/commit/${mockSha}`;
|
2019-12-26 22:10:19 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
beforeEach(() => {
|
|
|
|
wrapper.setData({
|
2020-04-22 19:07:51 +05:30
|
|
|
tooltip: {
|
|
|
|
type: 'deployments',
|
|
|
|
},
|
|
|
|
});
|
2020-06-23 00:09:42 +05:30
|
|
|
return wrapper.vm.$nextTick();
|
2020-04-08 14:13:33 +05:30
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
it('uses deployment title', () => {
|
|
|
|
expect(
|
|
|
|
shallowWrapperContainsSlotText(findChartComponent(), 'tooltipTitle', 'Deployed'),
|
|
|
|
).toBe(true);
|
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
it('renders clickable commit sha in tooltip content', () => {
|
|
|
|
wrapper.vm.tooltip.sha = mockSha;
|
|
|
|
wrapper.vm.tooltip.commitUrl = commitUrl;
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
return wrapper.vm.$nextTick(() => {
|
|
|
|
const commitLink = wrapper.find(GlLink);
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
expect(shallowWrapperContainsSlotText(commitLink, 'default', mockSha)).toBe(true);
|
|
|
|
expect(commitLink.attributes('href')).toEqual(commitUrl);
|
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2020-04-08 14:13:33 +05:30
|
|
|
|
|
|
|
describe('with multiple time series', () => {
|
|
|
|
describe('General functions', () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
beforeEach(() => {
|
2020-04-08 14:13:33 +05:30
|
|
|
store = createStore();
|
|
|
|
const graphData = cloneDeep(metricsDashboardViewModel.panelGroups[0].panels[3]);
|
|
|
|
graphData.metrics.forEach(metric =>
|
2020-04-22 19:07:51 +05:30
|
|
|
Object.assign(metric, { result: metricResultStatus.result }),
|
2020-04-08 14:13:33 +05:30
|
|
|
);
|
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
createWrapper({ graphData: { ...graphData, type: 'area-chart' } }, mount);
|
|
|
|
return wrapper.vm.$nextTick();
|
2020-04-08 14:13:33 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(() => {
|
2020-06-23 00:09:42 +05:30
|
|
|
wrapper.destroy();
|
2020-04-08 14:13:33 +05:30
|
|
|
});
|
|
|
|
|
2020-04-22 19:07:51 +05:30
|
|
|
describe('Color match', () => {
|
|
|
|
let lineColors;
|
2020-04-08 14:13:33 +05:30
|
|
|
|
|
|
|
beforeEach(() => {
|
2020-06-23 00:09:42 +05:30
|
|
|
lineColors = wrapper.find(GlAreaChart).vm.series.map(item => item.lineStyle.color);
|
2020-04-08 14:13:33 +05:30
|
|
|
});
|
|
|
|
|
2020-04-22 19:07:51 +05:30
|
|
|
it('should contain different colors for contiguous time series', () => {
|
|
|
|
lineColors.forEach((color, index) => {
|
|
|
|
expect(color).not.toBe(lineColors[index + 1]);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should match series color with tooltip label color', () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
const labels = wrapper.findAll(GlChartSeriesLabel);
|
2020-04-22 19:07:51 +05:30
|
|
|
|
|
|
|
lineColors.forEach((color, index) => {
|
|
|
|
const labelColor = labels.at(index).props('color');
|
|
|
|
expect(color).toBe(labelColor);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should match series color with legend color', () => {
|
2020-06-23 00:09:42 +05:30
|
|
|
const legendColors = wrapper
|
2020-04-22 19:07:51 +05:30
|
|
|
.find(GlChartLegend)
|
|
|
|
.props('seriesInfo')
|
|
|
|
.map(item => item.color);
|
|
|
|
|
|
|
|
lineColors.forEach((color, index) => {
|
|
|
|
expect(color).toBe(legendColors[index]);
|
|
|
|
});
|
2020-04-08 14:13:33 +05:30
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2020-06-23 00:09:42 +05:30
|
|
|
|
|
|
|
describe('legend layout', () => {
|
|
|
|
const findLegend = () => wrapper.find(GlChartLegend);
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
createWrapper(mockGraphData, mount);
|
|
|
|
return wrapper.vm.$nextTick();
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(() => {
|
|
|
|
wrapper.destroy();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should render a tabular legend layout by default', () => {
|
|
|
|
expect(findLegend().props('layout')).toBe('table');
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('when inline legend layout prop is set', () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
wrapper.setProps({
|
|
|
|
legendLayout: 'inline',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should render an inline legend layout', () => {
|
|
|
|
expect(findLegend().props('layout')).toBe('inline');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('when table legend layout prop is set', () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
wrapper.setProps({
|
|
|
|
legendLayout: 'table',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should render a tabular legend layout', () => {
|
|
|
|
expect(findLegend().props('layout')).toBe('table');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2019-12-04 20:38:33 +05:30
|
|
|
});
|