Commit f9a9890e authored by Paul Slaughter's avatar Paul Slaughter

Merge branch 'jestodus-monitor-chart-specs' into 'master'

Migrate chart specs to jest

See merge request gitlab-org/gitlab!21714
parents 5cc3b099 75c616fa
......@@ -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