Commit 85605dd4 authored by Scott Hampton's avatar Scott Hampton

Move mock data up a level

Move mock data file up a directory so that it is
more generally applicable to all of the repo
analytics folder.

Also did a slight refactor in the test coverage
table spec file.
parent c4ff2d70
...@@ -6,7 +6,7 @@ import getProjectsTestCoverage from 'ee/analytics/repository_analytics/graphql/q ...@@ -6,7 +6,7 @@ import getProjectsTestCoverage from 'ee/analytics/repository_analytics/graphql/q
import createMockApollo from 'helpers/mock_apollo_helper'; import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import { getTimeago } from '~/lib/utils/datetime_utility'; import { getTimeago } from '~/lib/utils/datetime_utility';
import { defaultTestCoverageTable, projects } from './mock_data'; import { defaultTestCoverageTable, projects } from '../mock_data';
import Api from '~/api'; import Api from '~/api';
jest.mock('~/api.js'); jest.mock('~/api.js');
...@@ -40,9 +40,12 @@ describe('Test coverage table component', () => { ...@@ -40,9 +40,12 @@ describe('Test coverage table component', () => {
]); ]);
}; };
const createComponent = (options = {}) => { const createComponent = ({
const { glFeatures = {}, mockApollo, mockData = {}, mountFn = shallowMount } = options; glFeatures = {},
mockApollo,
mockData = {},
mountFn = shallowMount,
} = {}) => {
wrapper = mountFn(TestCoverageTable, { wrapper = mountFn(TestCoverageTable, {
localVue, localVue,
data() { data() {
......
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