summaryrefslogtreecommitdiff
path: root/spec/frontend/monitoring/store/utils_spec.js
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-27 12:07:43 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-27 12:07:43 +0000
commit39fa7d1eeb2dba52f0601128f3ac91f57d19866e (patch)
treeda042d34ff762dd1957e51666a34202295a081b9 /spec/frontend/monitoring/store/utils_spec.js
parent6ac4a6713ed3196af899011f7e18658e16ebaac0 (diff)
downloadgitlab-ce-39fa7d1eeb2dba52f0601128f3ac91f57d19866e.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/monitoring/store/utils_spec.js')
-rw-r--r--spec/frontend/monitoring/store/utils_spec.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/frontend/monitoring/store/utils_spec.js b/spec/frontend/monitoring/store/utils_spec.js
index 1e5bbc9c113..4bbbe33647c 100644
--- a/spec/frontend/monitoring/store/utils_spec.js
+++ b/spec/frontend/monitoring/store/utils_spec.js
@@ -25,6 +25,10 @@ describe('mapToDashboardViewModel', () => {
panels: [
{
title: 'Title A',
+ xLabel: '',
+ xAxis: {
+ name: '',
+ },
type: 'chart-type',
y_label: 'Y Label A',
metrics: [],
@@ -44,6 +48,10 @@ describe('mapToDashboardViewModel', () => {
{
title: 'Title A',
type: 'chart-type',
+ xLabel: '',
+ xAxis: {
+ name: '',
+ },
y_label: 'Y Label A',
yAxis: {
name: 'Y Label A',
@@ -114,6 +122,28 @@ describe('mapToDashboardViewModel', () => {
const getMappedPanel = () => mapToDashboardViewModel(dashboard).panelGroups[0].panels[0];
+ it('panel with x_label', () => {
+ setupWithPanel({
+ title: panelTitle,
+ x_label: 'x label',
+ });
+
+ expect(getMappedPanel()).toEqual({
+ title: panelTitle,
+ xLabel: 'x label',
+ xAxis: {
+ name: 'x label',
+ },
+ y_label: '',
+ yAxis: {
+ name: '',
+ format: SUPPORTED_FORMATS.number,
+ precision: 2,
+ },
+ metrics: [],
+ });
+ });
+
it('group y_axis defaults', () => {
setupWithPanel({
title: panelTitle,
@@ -121,7 +151,11 @@ describe('mapToDashboardViewModel', () => {
expect(getMappedPanel()).toEqual({
title: panelTitle,
+ xLabel: '',
y_label: '',
+ xAxis: {
+ name: '',
+ },
yAxis: {
name: '',
format: SUPPORTED_FORMATS.number,