Commit 75c616fa authored by Miguel Rincon's avatar Miguel Rincon Committed by Paul Slaughter

Migrate monitor chart specs to jest

https://gitlab.com/gitlab-org/gitlab/merge_requests/21714
parent 5cc3b099
......@@ -4,6 +4,10 @@ import ColumnChart from '~/monitoring/components/charts/column.vue';
const localVue = createLocalVue();
jest.mock('~/lib/utils/icon_utils', () => ({
getSvgIconPathContent: jest.fn().mockResolvedValue('mockSvgPathContent'),
}));
describe('Column component', () => {
let columnChart;
......
import { shallowMount } from '@vue/test-utils';
import { GlHeatmap } from '@gitlab/ui/dist/charts';
import Heatmap from '~/monitoring/components/charts/heatmap.vue';
import { graphDataPrometheusQueryRangeMultiTrack } from '../mock_data';
import { graphDataPrometheusQueryRangeMultiTrack } from '../../mock_data';
describe('Heatmap component', () => {
let heatmapChart;
......
import { shallowMount, createLocalVue } from '@vue/test-utils';
import SingleStatChart from '~/monitoring/components/charts/single_stat.vue';
import { graphDataPrometheusQuery } from '../mock_data';
import { graphDataPrometheusQuery } from '../../mock_data';
const localVue = createLocalVue();
......
......@@ -12,20 +12,14 @@ import {
mockedQueryResultPayload,
mockProjectDir,
mockHost,
} from '../mock_data';
} from '../../mock_data';
import * as iconUtils from '~/lib/utils/icon_utils';
const mockSvgPathContent = 'mockSvgPathContent';
const mockWidgets = 'mockWidgets';
const mockSvgPathContent = 'mockSvgPathContent';
jest.mock('~/lib/utils/icon_utils', () => ({
getSvgIconPathContent: jest.fn().mockImplementation(
() =>
new Promise(resolve => {
resolve(mockSvgPathContent);
}),
),
getSvgIconPathContent: jest.fn().mockImplementation(() => Promise.resolve(mockSvgPathContent)),
}));
describe('Time series component', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment