Commit d9537e09 authored by Illya Klymov's avatar Illya Klymov

Merge branch 'vs-sort-imports-by-groups-in-specs' into 'master'

Sort imports by groups in CE specs

See merge request gitlab-org/gitlab!52976
parents 3d4b3837 44205a95
...@@ -2,11 +2,11 @@ import { shallowMount, createLocalVue } from '@vue/test-utils'; ...@@ -2,11 +2,11 @@ import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { GlModal, GlSearchBoxByType } from '@gitlab/ui'; import { GlModal, GlSearchBoxByType } from '@gitlab/ui';
import AddReviewItemsModal from '~/add_context_commits_modal/components/add_context_commits_modal_wrapper.vue'; import AddReviewItemsModal from '~/add_context_commits_modal/components/add_context_commits_modal_wrapper.vue';
import getDiffWithCommit from '../../diffs/mock_data/diff_with_commit';
import defaultState from '~/add_context_commits_modal/store/state'; import defaultState from '~/add_context_commits_modal/store/state';
import mutations from '~/add_context_commits_modal/store/mutations'; import mutations from '~/add_context_commits_modal/store/mutations';
import * as actions from '~/add_context_commits_modal/store/actions'; import * as actions from '~/add_context_commits_modal/store/actions';
import getDiffWithCommit from '../../diffs/mock_data/diff_with_commit';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import waitForPromises from 'helpers/wait_for_promises';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import axios from 'axios'; import axios from 'axios';
import waitForPromises from 'helpers/wait_for_promises';
import AlertMetrics from '~/alert_management/components/alert_metrics.vue'; import AlertMetrics from '~/alert_management/components/alert_metrics.vue';
import MetricEmbed from '~/monitoring/components/embeds/metric_embed.vue'; import MetricEmbed from '~/monitoring/components/embeds/metric_embed.vue';
......
...@@ -10,8 +10,8 @@ import { ...@@ -10,8 +10,8 @@ import {
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import AlertsSettingsForm from '~/alerts_settings/components/alerts_settings_form.vue'; import AlertsSettingsForm from '~/alerts_settings/components/alerts_settings_form.vue';
import MappingBuilder from '~/alerts_settings/components/alert_mapping_builder.vue'; import MappingBuilder from '~/alerts_settings/components/alert_mapping_builder.vue';
import { defaultAlertSettingsConfig } from './util';
import { typeSet } from '~/alerts_settings/constants'; import { typeSet } from '~/alerts_settings/constants';
import { defaultAlertSettingsConfig } from './util';
describe('AlertsSettingsFormNew', () => { describe('AlertsSettingsFormNew', () => {
let wrapper; let wrapper;
......
import VueApollo from 'vue-apollo'; import VueApollo from 'vue-apollo';
import { mount, createLocalVue } from '@vue/test-utils'; import { mount, createLocalVue } from '@vue/test-utils';
import AxiosMockAdapter from 'axios-mock-adapter'; import AxiosMockAdapter from 'axios-mock-adapter';
import { GlLoadingIcon } from '@gitlab/ui';
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 { useMockIntersectionObserver } from 'helpers/mock_dom_observer'; import { useMockIntersectionObserver } from 'helpers/mock_dom_observer';
import { GlLoadingIcon } from '@gitlab/ui';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import AlertsSettingsWrapper from '~/alerts_settings/components/alerts_settings_wrapper.vue'; import AlertsSettingsWrapper from '~/alerts_settings/components/alerts_settings_wrapper.vue';
import AlertsSettingsForm from '~/alerts_settings/components/alerts_settings_form.vue'; import AlertsSettingsForm from '~/alerts_settings/components/alerts_settings_form.vue';
......
...@@ -7,6 +7,7 @@ import { ...@@ -7,6 +7,7 @@ import {
BLOB_RENDER_EVENT_SHOW_SOURCE, BLOB_RENDER_EVENT_SHOW_SOURCE,
BLOB_RENDER_ERRORS, BLOB_RENDER_ERRORS,
} from '~/blob/components/constants'; } from '~/blob/components/constants';
import { RichViewer, SimpleViewer } from '~/vue_shared/components/blob_viewers';
import { import {
Blob, Blob,
RichViewerMock, RichViewerMock,
...@@ -14,7 +15,6 @@ import { ...@@ -14,7 +15,6 @@ import {
RichBlobContentMock, RichBlobContentMock,
SimpleBlobContentMock, SimpleBlobContentMock,
} from './mock_data'; } from './mock_data';
import { RichViewer, SimpleViewer } from '~/vue_shared/components/blob_viewers';
describe('Blob Content component', () => { describe('Blob Content component', () => {
let wrapper; let wrapper;
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import BlobHeaderFilepath from '~/blob/components/blob_header_filepath.vue'; import BlobHeaderFilepath from '~/blob/components/blob_header_filepath.vue';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import { Blob as MockBlob } from './mock_data';
import { numberToHumanSize } from '~/lib/utils/number_utils'; import { numberToHumanSize } from '~/lib/utils/number_utils';
import { Blob as MockBlob } from './mock_data';
jest.mock('~/lib/utils/number_utils', () => ({ jest.mock('~/lib/utils/number_utils', () => ({
numberToHumanSize: jest.fn(() => 'a lot'), numberToHumanSize: jest.fn(() => 'a lot'),
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { mockTracking, unmockTracking, triggerEvent } from 'helpers/tracking_helper';
import { GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import { mockTracking, unmockTracking, triggerEvent } from 'helpers/tracking_helper';
import Popover from '~/blob/suggest_gitlab_ci_yml/components/popover.vue'; import Popover from '~/blob/suggest_gitlab_ci_yml/components/popover.vue';
import * as utils from '~/lib/utils/common_utils'; import * as utils from '~/lib/utils/common_utils';
......
...@@ -9,9 +9,9 @@ import eventHub from '~/boards/eventhub'; ...@@ -9,9 +9,9 @@ import eventHub from '~/boards/eventhub';
import BoardList from '~/boards/components/board_list_deprecated.vue'; import BoardList from '~/boards/components/board_list_deprecated.vue';
import '~/boards/models/issue'; import '~/boards/models/issue';
import '~/boards/models/list'; import '~/boards/models/list';
import { listObj, boardsMockInterceptor } from './mock_data';
import store from '~/boards/stores'; import store from '~/boards/stores';
import boardsStore from '~/boards/stores/boards_store'; import boardsStore from '~/boards/stores/boards_store';
import { listObj, boardsMockInterceptor } from './mock_data';
const createComponent = ({ done, listIssueProps = {}, componentProps = {}, listProps = {} }) => { const createComponent = ({ done, listIssueProps = {}, componentProps = {}, listProps = {} }) => {
const el = document.createElement('div'); const el = document.createElement('div');
......
...@@ -9,9 +9,9 @@ import BoardList from '~/boards/components/board_list_deprecated.vue'; ...@@ -9,9 +9,9 @@ import BoardList from '~/boards/components/board_list_deprecated.vue';
import '~/boards/models/issue'; import '~/boards/models/issue';
import '~/boards/models/list'; import '~/boards/models/list';
import { listObj, boardsMockInterceptor } from './mock_data';
import store from '~/boards/stores'; import store from '~/boards/stores';
import boardsStore from '~/boards/stores/boards_store'; import boardsStore from '~/boards/stores/boards_store';
import { listObj, boardsMockInterceptor } from './mock_data';
window.Sortable = Sortable; window.Sortable = Sortable;
......
import Vuex from 'vuex'; import Vuex from 'vuex';
import { useFakeRequestAnimationFrame } from 'helpers/fake_request_animation_frame';
import { createLocalVue, mount } from '@vue/test-utils'; import { createLocalVue, mount } from '@vue/test-utils';
import { useFakeRequestAnimationFrame } from 'helpers/fake_request_animation_frame';
import eventHub from '~/boards/eventhub'; import eventHub from '~/boards/eventhub';
import BoardList from '~/boards/components/board_list.vue'; import BoardList from '~/boards/components/board_list.vue';
import BoardCard from '~/boards/components/board_card.vue'; import BoardCard from '~/boards/components/board_card.vue';
import { mockList, mockIssuesByListId, issues, mockIssues } from './mock_data';
import defaultState from '~/boards/stores/state'; import defaultState from '~/boards/stores/state';
import { mockList, mockIssuesByListId, issues, mockIssues } from './mock_data';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
......
...@@ -3,10 +3,10 @@ import { TEST_HOST } from 'helpers/test_constants'; ...@@ -3,10 +3,10 @@ import { TEST_HOST } from 'helpers/test_constants';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import boardsStore from '~/boards/stores/boards_store'; import boardsStore from '~/boards/stores/boards_store';
import eventHub from '~/boards/eventhub'; import eventHub from '~/boards/eventhub';
import { listObj, listObjDuplicate } from './mock_data';
import ListIssue from '~/boards/models/issue'; import ListIssue from '~/boards/models/issue';
import List from '~/boards/models/list'; import List from '~/boards/models/list';
import { listObj, listObjDuplicate } from './mock_data';
jest.mock('js-cookie'); jest.mock('js-cookie');
......
...@@ -6,8 +6,8 @@ import { ...@@ -6,8 +6,8 @@ import {
GlSearchBoxByType, GlSearchBoxByType,
GlLoadingIcon, GlLoadingIcon,
} from '@gitlab/ui'; } from '@gitlab/ui';
import createMockApollo from 'helpers/mock_apollo_helper';
import VueApollo from 'vue-apollo'; import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
import BoardAssigneeDropdown from '~/boards/components/board_assignee_dropdown.vue'; import BoardAssigneeDropdown from '~/boards/components/board_assignee_dropdown.vue';
import IssuableAssignees from '~/sidebar/components/assignees/issuable_assignees.vue'; import IssuableAssignees from '~/sidebar/components/assignees/issuable_assignees.vue';
import MultiSelectDropdown from '~/vue_shared/components/sidebar/multiselect_dropdown.vue'; import MultiSelectDropdown from '~/vue_shared/components/sidebar/multiselect_dropdown.vue';
......
...@@ -15,9 +15,8 @@ import boardsVuexStore from '~/boards/stores'; ...@@ -15,9 +15,8 @@ import boardsVuexStore from '~/boards/stores';
import boardsStore from '~/boards/stores/boards_store'; import boardsStore from '~/boards/stores/boards_store';
import BoardCardLayout from '~/boards/components/board_card_layout_deprecated.vue'; import BoardCardLayout from '~/boards/components/board_card_layout_deprecated.vue';
import issueCardInner from '~/boards/components/issue_card_inner.vue'; import issueCardInner from '~/boards/components/issue_card_inner.vue';
import { listObj, boardsMockInterceptor, setMockEndpoints } from '../mock_data';
import { ISSUABLE } from '~/boards/constants'; import { ISSUABLE } from '~/boards/constants';
import { listObj, boardsMockInterceptor, setMockEndpoints } from '../mock_data';
describe('Board card layout', () => { describe('Board card layout', () => {
let wrapper; let wrapper;
......
...@@ -4,9 +4,8 @@ import { createLocalVue, shallowMount } from '@vue/test-utils'; ...@@ -4,9 +4,8 @@ import { createLocalVue, shallowMount } from '@vue/test-utils';
import defaultState from '~/boards/stores/state'; import defaultState from '~/boards/stores/state';
import BoardCardLayout from '~/boards/components/board_card_layout.vue'; import BoardCardLayout from '~/boards/components/board_card_layout.vue';
import IssueCardInner from '~/boards/components/issue_card_inner.vue'; import IssueCardInner from '~/boards/components/issue_card_inner.vue';
import { mockLabelList, mockIssue } from '../mock_data';
import { ISSUABLE } from '~/boards/constants'; import { ISSUABLE } from '~/boards/constants';
import { mockLabelList, mockIssue } from '../mock_data';
describe('Board card layout', () => { describe('Board card layout', () => {
let wrapper; let wrapper;
......
...@@ -5,8 +5,8 @@ import Draggable from 'vuedraggable'; ...@@ -5,8 +5,8 @@ import Draggable from 'vuedraggable';
import EpicsSwimlanes from 'ee_component/boards/components/epics_swimlanes.vue'; import EpicsSwimlanes from 'ee_component/boards/components/epics_swimlanes.vue';
import getters from 'ee_else_ce/boards/stores/getters'; import getters from 'ee_else_ce/boards/stores/getters';
import BoardColumnDeprecated from '~/boards/components/board_column_deprecated.vue'; import BoardColumnDeprecated from '~/boards/components/board_column_deprecated.vue';
import { mockLists, mockListsWithModel } from '../mock_data';
import BoardContent from '~/boards/components/board_content.vue'; import BoardContent from '~/boards/components/board_content.vue';
import { mockLists, mockListsWithModel } from '../mock_data';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { TEST_HOST } from 'helpers/test_constants';
import { GlModal } from '@gitlab/ui'; import { GlModal } from '@gitlab/ui';
import { TEST_HOST } from 'helpers/test_constants';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import { deprecatedCreateFlash as createFlash } from '~/flash'; import { deprecatedCreateFlash as createFlash } from '~/flash';
......
...@@ -4,8 +4,8 @@ import { GlToggle, GlLoadingIcon } from '@gitlab/ui'; ...@@ -4,8 +4,8 @@ import { GlToggle, GlLoadingIcon } from '@gitlab/ui';
import BoardSidebarSubscription from '~/boards/components/sidebar/board_sidebar_subscription.vue'; import BoardSidebarSubscription from '~/boards/components/sidebar/board_sidebar_subscription.vue';
import * as types from '~/boards/stores/mutation_types'; import * as types from '~/boards/stores/mutation_types';
import { createStore } from '~/boards/stores'; import { createStore } from '~/boards/stores';
import { mockActiveIssue } from '../../mock_data';
import createFlash from '~/flash'; import createFlash from '~/flash';
import { mockActiveIssue } from '../../mock_data';
jest.mock('~/flash.js'); jest.mock('~/flash.js');
......
...@@ -7,8 +7,8 @@ import '~/boards/models/issue'; ...@@ -7,8 +7,8 @@ import '~/boards/models/issue';
import '~/boards/models/list'; import '~/boards/models/list';
import { GlLabel } from '@gitlab/ui'; import { GlLabel } from '@gitlab/ui';
import IssueCardInner from '~/boards/components/issue_card_inner_deprecated.vue'; import IssueCardInner from '~/boards/components/issue_card_inner_deprecated.vue';
import { listObj } from './mock_data';
import store from '~/boards/stores'; import store from '~/boards/stores';
import { listObj } from './mock_data';
describe('Issue card component', () => { describe('Issue card component', () => {
const user = new ListAssignee({ const user = new ListAssignee({
......
...@@ -2,10 +2,10 @@ import { mount } from '@vue/test-utils'; ...@@ -2,10 +2,10 @@ import { mount } from '@vue/test-utils';
import { range } from 'lodash'; import { range } from 'lodash';
import { GlLabel } from '@gitlab/ui'; import { GlLabel } from '@gitlab/ui';
import IssueCardInner from '~/boards/components/issue_card_inner.vue'; import IssueCardInner from '~/boards/components/issue_card_inner.vue';
import { mockLabelList } from './mock_data';
import defaultStore from '~/boards/stores'; import defaultStore from '~/boards/stores';
import eventHub from '~/boards/eventhub'; import eventHub from '~/boards/eventhub';
import { updateHistory } from '~/lib/utils/url_utility'; import { updateHistory } from '~/lib/utils/url_utility';
import { mockLabelList } from './mock_data';
jest.mock('~/lib/utils/url_utility'); jest.mock('~/lib/utils/url_utility');
jest.mock('~/boards/eventhub'); jest.mock('~/boards/eventhub');
......
import testAction from 'helpers/vuex_action_helper'; import testAction from 'helpers/vuex_action_helper';
import {
mockLists,
mockListsById,
mockIssue,
mockIssue2,
rawIssue,
mockIssues,
mockMilestone,
labels,
mockActiveIssue,
mockGroupProjects,
} from '../mock_data';
import actions, { gqlClient } from '~/boards/stores/actions'; import actions, { gqlClient } from '~/boards/stores/actions';
import * as types from '~/boards/stores/mutation_types'; import * as types from '~/boards/stores/mutation_types';
import { inactiveId } from '~/boards/constants'; import { inactiveId } from '~/boards/constants';
...@@ -25,6 +13,18 @@ import { ...@@ -25,6 +13,18 @@ import {
formatIssueInput, formatIssueInput,
} from '~/boards/boards_util'; } from '~/boards/boards_util';
import createFlash from '~/flash'; import createFlash from '~/flash';
import {
mockLists,
mockListsById,
mockIssue,
mockIssue2,
rawIssue,
mockIssues,
mockMilestone,
labels,
mockActiveIssue,
mockGroupProjects,
} from '../mock_data';
jest.mock('~/flash'); jest.mock('~/flash');
......
...@@ -6,8 +6,8 @@ import { deprecatedCreateFlash as createFlash } from '~/flash'; ...@@ -6,8 +6,8 @@ import { deprecatedCreateFlash as createFlash } from '~/flash';
import getInitialState from '~/ci_variable_list/store/state'; import getInitialState from '~/ci_variable_list/store/state';
import * as actions from '~/ci_variable_list/store/actions'; import * as actions from '~/ci_variable_list/store/actions';
import * as types from '~/ci_variable_list/store/mutation_types'; import * as types from '~/ci_variable_list/store/mutation_types';
import mockData from '../services/mock_data';
import { prepareDataForDisplay, prepareEnvironments } from '~/ci_variable_list/store/utils'; import { prepareDataForDisplay, prepareEnvironments } from '~/ci_variable_list/store/utils';
import mockData from '../services/mock_data';
jest.mock('~/api.js'); jest.mock('~/api.js');
jest.mock('~/flash.js'); jest.mock('~/flash.js');
......
import { shallowMount, mount } from '@vue/test-utils'; import { shallowMount, mount } from '@vue/test-utils';
import Applications from '~/clusters/components/applications.vue'; import Applications from '~/clusters/components/applications.vue';
import { CLUSTER_TYPE, PROVIDER_TYPE } from '~/clusters/constants'; import { CLUSTER_TYPE, PROVIDER_TYPE } from '~/clusters/constants';
import { APPLICATIONS_MOCK_STATE } from '../services/mock_data';
import eventHub from '~/clusters/event_hub'; import eventHub from '~/clusters/event_hub';
import ApplicationRow from '~/clusters/components/application_row.vue'; import ApplicationRow from '~/clusters/components/application_row.vue';
import KnativeDomainEditor from '~/clusters/components/knative_domain_editor.vue'; import KnativeDomainEditor from '~/clusters/components/knative_domain_editor.vue';
import CrossplaneProviderStack from '~/clusters/components/crossplane_provider_stack.vue'; import CrossplaneProviderStack from '~/clusters/components/crossplane_provider_stack.vue';
import IngressModsecuritySettings from '~/clusters/components/ingress_modsecurity_settings.vue'; import IngressModsecuritySettings from '~/clusters/components/ingress_modsecurity_settings.vue';
import FluentdOutputSettings from '~/clusters/components/fluentd_output_settings.vue'; import FluentdOutputSettings from '~/clusters/components/fluentd_output_settings.vue';
import { APPLICATIONS_MOCK_STATE } from '../services/mock_data';
describe('Applications', () => { describe('Applications', () => {
let wrapper; let wrapper;
......
...@@ -5,10 +5,10 @@ import * as Sentry from '~/sentry/wrapper'; ...@@ -5,10 +5,10 @@ import * as Sentry from '~/sentry/wrapper';
import Poll from '~/lib/utils/poll'; import Poll from '~/lib/utils/poll';
import { deprecatedCreateFlash as flashError } from '~/flash'; import { deprecatedCreateFlash as flashError } from '~/flash';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { apiData } from '../mock_data';
import { MAX_REQUESTS } from '~/clusters_list/constants'; import { MAX_REQUESTS } from '~/clusters_list/constants';
import * as types from '~/clusters_list/store/mutation_types'; import * as types from '~/clusters_list/store/mutation_types';
import * as actions from '~/clusters_list/store/actions'; import * as actions from '~/clusters_list/store/actions';
import { apiData } from '../mock_data';
jest.mock('~/flash.js'); jest.mock('~/flash.js');
......
import * as types from '~/clusters_list/store/mutation_types'; import * as types from '~/clusters_list/store/mutation_types';
import { apiData } from '../mock_data';
import getInitialState from '~/clusters_list/store/state'; import getInitialState from '~/clusters_list/store/state';
import mutations from '~/clusters_list/store/mutations'; import mutations from '~/clusters_list/store/mutations';
import { apiData } from '../mock_data';
describe('Admin statistics panel mutations', () => { describe('Admin statistics panel mutations', () => {
let state; let state;
......
import MockAdapter from 'axios-mock-adapter';
import testAction from 'helpers/vuex_action_helper'; import testAction from 'helpers/vuex_action_helper';
import { useMockLocationHelper } from 'helpers/mock_window_location_helper'; import { useMockLocationHelper } from 'helpers/mock_window_location_helper';
import MockAdapter from 'axios-mock-adapter';
import createState from '~/create_cluster/eks_cluster/store/state'; import createState from '~/create_cluster/eks_cluster/store/state';
import * as actions from '~/create_cluster/eks_cluster/store/actions'; import * as actions from '~/create_cluster/eks_cluster/store/actions';
import { import {
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { selectedMachineTypeMock, gapiMachineTypesResponseMock } from '../mock_data';
import createState from '~/create_cluster/gke_cluster/store/state'; import createState from '~/create_cluster/gke_cluster/store/state';
import DropdownButton from '~/vue_shared/components/dropdown/dropdown_button.vue'; import DropdownButton from '~/vue_shared/components/dropdown/dropdown_button.vue';
import DropdownHiddenInput from '~/vue_shared/components/dropdown/dropdown_hidden_input.vue'; import DropdownHiddenInput from '~/vue_shared/components/dropdown/dropdown_hidden_input.vue';
import GkeMachineTypeDropdown from '~/create_cluster/gke_cluster/components/gke_machine_type_dropdown.vue'; import GkeMachineTypeDropdown from '~/create_cluster/gke_cluster/components/gke_machine_type_dropdown.vue';
import { selectedMachineTypeMock, gapiMachineTypesResponseMock } from '../mock_data';
const componentConfig = { const componentConfig = {
fieldId: 'cluster_provider_gcp_attributes_gcp_machine_type', fieldId: 'cluster_provider_gcp_attributes_gcp_machine_type',
......
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { shallowMount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import createState from '~/create_cluster/gke_cluster/store/state'; import createState from '~/create_cluster/gke_cluster/store/state';
import { selectedProjectMock, gapiProjectsResponseMock } from '../mock_data';
import GkeProjectIdDropdown from '~/create_cluster/gke_cluster/components/gke_project_id_dropdown.vue'; import GkeProjectIdDropdown from '~/create_cluster/gke_cluster/components/gke_project_id_dropdown.vue';
import DropdownButton from '~/vue_shared/components/dropdown/dropdown_button.vue'; import DropdownButton from '~/vue_shared/components/dropdown/dropdown_button.vue';
import DropdownHiddenInput from '~/vue_shared/components/dropdown/dropdown_hidden_input.vue'; import DropdownHiddenInput from '~/vue_shared/components/dropdown/dropdown_hidden_input.vue';
import { selectedProjectMock, gapiProjectsResponseMock } from '../mock_data';
const componentConfig = { const componentConfig = {
docsUrl: 'https://console.cloud.google.com/home/dashboard', docsUrl: 'https://console.cloud.google.com/home/dashboard',
......
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { GlLoadingIcon } from '@gitlab/ui'; import { GlLoadingIcon } from '@gitlab/ui';
import notes from '../../mock_data/notes';
import DesignDiscussion from '~/design_management/components/design_notes/design_discussion.vue'; import DesignDiscussion from '~/design_management/components/design_notes/design_discussion.vue';
import DesignNote from '~/design_management/components/design_notes/design_note.vue'; import DesignNote from '~/design_management/components/design_notes/design_note.vue';
import DesignReplyForm from '~/design_management/components/design_notes/design_reply_form.vue'; import DesignReplyForm from '~/design_management/components/design_notes/design_reply_form.vue';
...@@ -8,6 +7,7 @@ import createNoteMutation from '~/design_management/graphql/mutations/create_not ...@@ -8,6 +7,7 @@ import createNoteMutation from '~/design_management/graphql/mutations/create_not
import toggleResolveDiscussionMutation from '~/design_management/graphql/mutations/toggle_resolve_discussion.mutation.graphql'; import toggleResolveDiscussionMutation from '~/design_management/graphql/mutations/toggle_resolve_discussion.mutation.graphql';
import ReplyPlaceholder from '~/notes/components/discussion_reply_placeholder.vue'; import ReplyPlaceholder from '~/notes/components/discussion_reply_placeholder.vue';
import ToggleRepliesWidget from '~/design_management/components/design_notes/toggle_replies_widget.vue'; import ToggleRepliesWidget from '~/design_management/components/design_notes/toggle_replies_widget.vue';
import notes from '../../mock_data/notes';
import mockDiscussion from '../../mock_data/discussion'; import mockDiscussion from '../../mock_data/discussion';
const defaultMockDiscussion = { const defaultMockDiscussion = {
......
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import DesignOverlay from '~/design_management/components/design_overlay.vue'; import DesignOverlay from '~/design_management/components/design_overlay.vue';
import updateActiveDiscussion from '~/design_management/graphql/mutations/update_active_discussion.mutation.graphql'; import updateActiveDiscussion from '~/design_management/graphql/mutations/update_active_discussion.mutation.graphql';
import notes from '../mock_data/notes';
import { ACTIVE_DISCUSSION_SOURCE_TYPES } from '~/design_management/constants'; import { ACTIVE_DISCUSSION_SOURCE_TYPES } from '~/design_management/constants';
import notes from '../mock_data/notes';
const mutate = jest.fn(() => Promise.resolve()); const mutate = jest.fn(() => Promise.resolve());
......
...@@ -4,9 +4,9 @@ import Cookies from 'js-cookie'; ...@@ -4,9 +4,9 @@ import Cookies from 'js-cookie';
import DesignSidebar from '~/design_management/components/design_sidebar.vue'; import DesignSidebar from '~/design_management/components/design_sidebar.vue';
import Participants from '~/sidebar/components/participants/participants.vue'; import Participants from '~/sidebar/components/participants/participants.vue';
import DesignDiscussion from '~/design_management/components/design_notes/design_discussion.vue'; import DesignDiscussion from '~/design_management/components/design_notes/design_discussion.vue';
import design from '../mock_data/design';
import updateActiveDiscussionMutation from '~/design_management/graphql/mutations/update_active_discussion.mutation.graphql'; import updateActiveDiscussionMutation from '~/design_management/graphql/mutations/update_active_discussion.mutation.graphql';
import DesignTodoButton from '~/design_management/components/design_todo_button.vue'; import DesignTodoButton from '~/design_management/components/design_todo_button.vue';
import design from '../mock_data/design';
const scrollIntoViewMock = jest.fn(); const scrollIntoViewMock = jest.fn();
HTMLElement.prototype.scrollIntoView = scrollIntoViewMock; HTMLElement.prototype.scrollIntoView = scrollIntoViewMock;
......
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { createLocalVue, shallowMount } from '@vue/test-utils';
import { GlIcon, GlLoadingIcon, GlIntersectionObserver } from '@gitlab/ui'; import { GlIcon, GlLoadingIcon, GlIntersectionObserver } from '@gitlab/ui';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import VueRouter from 'vue-router'; import VueRouter from 'vue-router';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import Item from '~/design_management/components/list/item.vue'; import Item from '~/design_management/components/list/item.vue';
const localVue = createLocalVue(); const localVue = createLocalVue();
......
...@@ -18,15 +18,15 @@ import { DESIGNS_ROUTE_NAME, DESIGN_ROUTE_NAME } from '~/design_management/route ...@@ -18,15 +18,15 @@ import { DESIGNS_ROUTE_NAME, DESIGN_ROUTE_NAME } from '~/design_management/route
import createRouter from '~/design_management/router'; import createRouter from '~/design_management/router';
import * as utils from '~/design_management/utils/design_management_utils'; import * as utils from '~/design_management/utils/design_management_utils';
import { DESIGN_DETAIL_LAYOUT_CLASSLIST } from '~/design_management/constants'; import { DESIGN_DETAIL_LAYOUT_CLASSLIST } from '~/design_management/constants';
import design from '../../mock_data/design';
import mockResponseWithDesigns from '../../mock_data/designs';
import mockResponseNoDesigns from '../../mock_data/no_designs';
import mockAllVersions from '../../mock_data/all_versions';
import { import {
DESIGN_TRACKING_PAGE_NAME, DESIGN_TRACKING_PAGE_NAME,
DESIGN_SNOWPLOW_EVENT_TYPES, DESIGN_SNOWPLOW_EVENT_TYPES,
DESIGN_USAGE_PING_EVENT_TYPES, DESIGN_USAGE_PING_EVENT_TYPES,
} from '~/design_management/utils/tracking'; } from '~/design_management/utils/tracking';
import design from '../../mock_data/design';
import mockResponseWithDesigns from '../../mock_data/designs';
import mockResponseNoDesigns from '../../mock_data/no_designs';
import mockAllVersions from '../../mock_data/all_versions';
jest.mock('~/flash'); jest.mock('~/flash');
jest.mock('~/api.js'); jest.mock('~/api.js');
......
...@@ -22,6 +22,11 @@ import { ...@@ -22,6 +22,11 @@ import {
import createFlash from '~/flash'; import createFlash from '~/flash';
import createRouter from '~/design_management/router'; import createRouter from '~/design_management/router';
import * as utils from '~/design_management/utils/design_management_utils'; import * as utils from '~/design_management/utils/design_management_utils';
import moveDesignMutation from '~/design_management/graphql/mutations/move_design.mutation.graphql';
import {
DESIGN_TRACKING_PAGE_NAME,
DESIGN_SNOWPLOW_EVENT_TYPES,
} from '~/design_management/utils/tracking';
import { import {
designListQueryResponse, designListQueryResponse,
designUploadMutationCreatedResponse, designUploadMutationCreatedResponse,
...@@ -31,11 +36,6 @@ import { ...@@ -31,11 +36,6 @@ import {
reorderedDesigns, reorderedDesigns,
moveDesignMutationResponseWithErrors, moveDesignMutationResponseWithErrors,
} from '../mock_data/apollo_mock'; } from '../mock_data/apollo_mock';
import moveDesignMutation from '~/design_management/graphql/mutations/move_design.mutation.graphql';
import {
DESIGN_TRACKING_PAGE_NAME,
DESIGN_SNOWPLOW_EVENT_TYPES,
} from '~/design_management/utils/tracking';
jest.mock('~/flash.js'); jest.mock('~/flash.js');
const mockPageEl = { const mockPageEl = {
......
...@@ -10,8 +10,8 @@ import { ...@@ -10,8 +10,8 @@ import {
ADD_IMAGE_DIFF_NOTE_ERROR, ADD_IMAGE_DIFF_NOTE_ERROR,
UPDATE_IMAGE_DIFF_NOTE_ERROR, UPDATE_IMAGE_DIFF_NOTE_ERROR,
} from '~/design_management/utils/error_messages'; } from '~/design_management/utils/error_messages';
import design from '../mock_data/design';
import createFlash from '~/flash'; import createFlash from '~/flash';
import design from '../mock_data/design';
jest.mock('~/flash.js'); jest.mock('~/flash.js');
......
...@@ -3,8 +3,8 @@ import Vuex from 'vuex'; ...@@ -3,8 +3,8 @@ import Vuex from 'vuex';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlLoadingIcon, GlPagination } from '@gitlab/ui'; import { GlLoadingIcon, GlPagination } from '@gitlab/ui';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import { TEST_HOST } from 'spec/test_constants';
import Mousetrap from 'mousetrap'; import Mousetrap from 'mousetrap';
import { TEST_HOST } from 'spec/test_constants';
import App from '~/diffs/components/app.vue'; import App from '~/diffs/components/app.vue';
import NoChanges from '~/diffs/components/no_changes.vue'; import NoChanges from '~/diffs/components/no_changes.vue';
import DiffFile from '~/diffs/components/diff_file.vue'; import DiffFile from '~/diffs/components/diff_file.vue';
...@@ -13,14 +13,14 @@ import HiddenFilesWarning from '~/diffs/components/hidden_files_warning.vue'; ...@@ -13,14 +13,14 @@ import HiddenFilesWarning from '~/diffs/components/hidden_files_warning.vue';
import CollapsedFilesWarning from '~/diffs/components/collapsed_files_warning.vue'; import CollapsedFilesWarning from '~/diffs/components/collapsed_files_warning.vue';
import CommitWidget from '~/diffs/components/commit_widget.vue'; import CommitWidget from '~/diffs/components/commit_widget.vue';
import TreeList from '~/diffs/components/tree_list.vue'; import TreeList from '~/diffs/components/tree_list.vue';
import createDiffsStore from '../create_diffs_store';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import * as urlUtils from '~/lib/utils/url_utility'; import * as urlUtils from '~/lib/utils/url_utility';
import diffsMockData from '../mock_data/merge_request_diffs';
import { EVT_VIEW_FILE_BY_FILE } from '~/diffs/constants'; import { EVT_VIEW_FILE_BY_FILE } from '~/diffs/constants';
import eventHub from '~/diffs/event_hub'; import eventHub from '~/diffs/event_hub';
import diffsMockData from '../mock_data/merge_request_diffs';
import createDiffsStore from '../create_diffs_store';
const mergeRequestDiff = { version_index: 1 }; const mergeRequestDiff = { version_index: 1 };
const TEST_ENDPOINT = `${TEST_HOST}/diff/endpoint`; const TEST_ENDPOINT = `${TEST_HOST}/diff/endpoint`;
......
import { trimText } from 'helpers/text_helper';
import { mount, createLocalVue } from '@vue/test-utils'; import { mount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { trimText } from 'helpers/text_helper';
import CompareVersionsComponent from '~/diffs/components/compare_versions.vue'; import CompareVersionsComponent from '~/diffs/components/compare_versions.vue';
import { createStore } from '~/mr_notes/stores'; import { createStore } from '~/mr_notes/stores';
import diffsMockData from '../mock_data/merge_request_diffs'; import diffsMockData from '../mock_data/merge_request_diffs';
......
...@@ -9,9 +9,9 @@ import ParallelDiffView from '~/diffs/components/parallel_diff_view.vue'; ...@@ -9,9 +9,9 @@ import ParallelDiffView from '~/diffs/components/parallel_diff_view.vue';
import NoteForm from '~/notes/components/note_form.vue'; import NoteForm from '~/notes/components/note_form.vue';
import DiffDiscussions from '~/diffs/components/diff_discussions.vue'; import DiffDiscussions from '~/diffs/components/diff_discussions.vue';
import { IMAGE_DIFF_POSITION_TYPE } from '~/diffs/constants'; import { IMAGE_DIFF_POSITION_TYPE } from '~/diffs/constants';
import diffFileMockData from '../mock_data/diff_file';
import { diffViewerModes } from '~/ide/constants'; import { diffViewerModes } from '~/ide/constants';
import DiffView from '~/diffs/components/diff_view.vue'; import DiffView from '~/diffs/components/diff_view.vue';
import diffFileMockData from '../mock_data/diff_file';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
......
...@@ -7,17 +7,16 @@ import { mockTracking, triggerEvent } from 'helpers/tracking_helper'; ...@@ -7,17 +7,16 @@ import { mockTracking, triggerEvent } from 'helpers/tracking_helper';
import DiffFileHeader from '~/diffs/components/diff_file_header.vue'; import DiffFileHeader from '~/diffs/components/diff_file_header.vue';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import FileIcon from '~/vue_shared/components/file_icon.vue'; import FileIcon from '~/vue_shared/components/file_icon.vue';
import diffDiscussionsMockData from '../mock_data/diff_discussions';
import { truncateSha } from '~/lib/utils/text_utility'; import { truncateSha } from '~/lib/utils/text_utility';
import { diffViewerModes } from '~/ide/constants'; import { diffViewerModes } from '~/ide/constants';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import { scrollToElement } from '~/lib/utils/common_utils'; import { scrollToElement } from '~/lib/utils/common_utils';
import testAction from '../../__helpers__/vuex_action_helper';
import { SET_MR_FILE_REVIEWS } from '~/diffs/store/mutation_types'; import { SET_MR_FILE_REVIEWS } from '~/diffs/store/mutation_types';
import { reviewFile } from '~/diffs/store/actions'; import { reviewFile } from '~/diffs/store/actions';
import { DIFF_FILE_AUTOMATIC_COLLAPSE, DIFF_FILE_MANUAL_COLLAPSE } from '~/diffs/constants'; import { DIFF_FILE_AUTOMATIC_COLLAPSE, DIFF_FILE_MANUAL_COLLAPSE } from '~/diffs/constants';
import testAction from '../../__helpers__/vuex_action_helper';
import diffDiscussionsMockData from '../mock_data/diff_discussions';
jest.mock('~/lib/utils/common_utils'); jest.mock('~/lib/utils/common_utils');
......
...@@ -6,8 +6,6 @@ import axios from '~/lib/utils/axios_utils'; ...@@ -6,8 +6,6 @@ import axios from '~/lib/utils/axios_utils';
import httpStatus from '~/lib/utils/http_status'; import httpStatus from '~/lib/utils/http_status';
import createDiffsStore from '~/diffs/store/modules'; import createDiffsStore from '~/diffs/store/modules';
import createNotesStore from '~/notes/stores/modules'; import createNotesStore from '~/notes/stores/modules';
import diffFileMockDataReadable from '../mock_data/diff_file';
import diffFileMockDataUnreadable from '../mock_data/diff_file_unreadable';
import DiffFileComponent from '~/diffs/components/diff_file.vue'; import DiffFileComponent from '~/diffs/components/diff_file.vue';
import DiffFileHeaderComponent from '~/diffs/components/diff_file_header.vue'; import DiffFileHeaderComponent from '~/diffs/components/diff_file_header.vue';
...@@ -21,6 +19,8 @@ import { ...@@ -21,6 +19,8 @@ import {
} from '~/diffs/constants'; } from '~/diffs/constants';
import { diffViewerModes, diffViewerErrors } from '~/ide/constants'; import { diffViewerModes, diffViewerErrors } from '~/ide/constants';
import diffFileMockDataUnreadable from '../mock_data/diff_file_unreadable';
import diffFileMockDataReadable from '../mock_data/diff_file';
function changeViewer(store, index, { automaticallyCollapsed, manuallyCollapsed, name }) { function changeViewer(store, index, { automaticallyCollapsed, manuallyCollapsed, name }) {
const file = store.state.diffs.diffFiles[index]; const file = store.state.diffs.diffFiles[index];
......
...@@ -3,8 +3,8 @@ import { getByTestId, fireEvent } from '@testing-library/dom'; ...@@ -3,8 +3,8 @@ import { getByTestId, fireEvent } from '@testing-library/dom';
import Vuex from 'vuex'; import Vuex from 'vuex';
import diffsModule from '~/diffs/store/modules'; import diffsModule from '~/diffs/store/modules';
import DiffRow from '~/diffs/components/diff_row.vue'; import DiffRow from '~/diffs/components/diff_row.vue';
import diffFileMockData from '../mock_data/diff_file';
import { mapParallel } from '~/diffs/components/diff_row_utils'; import { mapParallel } from '~/diffs/components/diff_row_utils';
import diffFileMockData from '../mock_data/diff_file';
describe('DiffRow', () => { describe('DiffRow', () => {
const testLines = [ const testLines = [
......
...@@ -2,9 +2,9 @@ import { shallowMount } from '@vue/test-utils'; ...@@ -2,9 +2,9 @@ import { shallowMount } from '@vue/test-utils';
import { createStore } from '~/mr_notes/stores'; import { createStore } from '~/mr_notes/stores';
import InlineDiffTableRow from '~/diffs/components/inline_diff_table_row.vue'; import InlineDiffTableRow from '~/diffs/components/inline_diff_table_row.vue';
import DiffGutterAvatars from '~/diffs/components/diff_gutter_avatars.vue'; import DiffGutterAvatars from '~/diffs/components/diff_gutter_avatars.vue';
import { mapInline } from '~/diffs/components/diff_row_utils';
import diffFileMockData from '../mock_data/diff_file'; import diffFileMockData from '../mock_data/diff_file';
import discussionsMockData from '../mock_data/diff_discussions'; import discussionsMockData from '../mock_data/diff_discussions';
import { mapInline } from '~/diffs/components/diff_row_utils';
const TEST_USER_ID = 'abc123'; const TEST_USER_ID = 'abc123';
const TEST_USER = { id: TEST_USER_ID }; const TEST_USER = { id: TEST_USER_ID };
......
...@@ -4,8 +4,8 @@ import { createComponentWithStore } from 'helpers/vue_mount_component_helper'; ...@@ -4,8 +4,8 @@ import { createComponentWithStore } from 'helpers/vue_mount_component_helper';
import { createStore } from '~/mr_notes/stores'; import { createStore } from '~/mr_notes/stores';
import ParallelDiffTableRow from '~/diffs/components/parallel_diff_table_row.vue'; import ParallelDiffTableRow from '~/diffs/components/parallel_diff_table_row.vue';
import { mapParallel } from '~/diffs/components/diff_row_utils'; import { mapParallel } from '~/diffs/components/diff_row_utils';
import diffFileMockData from '../mock_data/diff_file';
import DiffGutterAvatars from '~/diffs/components/diff_gutter_avatars.vue'; import DiffGutterAvatars from '~/diffs/components/diff_gutter_avatars.vue';
import diffFileMockData from '../mock_data/diff_file';
import discussionsMockData from '../mock_data/diff_discussions'; import discussionsMockData from '../mock_data/diff_discussions';
describe('ParallelDiffTableRow', () => { describe('ParallelDiffTableRow', () => {
......
...@@ -58,8 +58,8 @@ import axios from '~/lib/utils/axios_utils'; ...@@ -58,8 +58,8 @@ import axios from '~/lib/utils/axios_utils';
import * as utils from '~/diffs/store/utils'; import * as utils from '~/diffs/store/utils';
import * as commonUtils from '~/lib/utils/common_utils'; import * as commonUtils from '~/lib/utils/common_utils';
import { mergeUrlParams } from '~/lib/utils/url_utility'; import { mergeUrlParams } from '~/lib/utils/url_utility';
import { diffMetadata } from '../mock_data/diff_metadata';
import { deprecatedCreateFlash as createFlash } from '~/flash'; import { deprecatedCreateFlash as createFlash } from '~/flash';
import { diffMetadata } from '../mock_data/diff_metadata';
jest.mock('~/flash'); jest.mock('~/flash');
......
...@@ -2,8 +2,8 @@ import createState from '~/diffs/store/modules/diff_state'; ...@@ -2,8 +2,8 @@ import createState from '~/diffs/store/modules/diff_state';
import mutations from '~/diffs/store/mutations'; import mutations from '~/diffs/store/mutations';
import * as types from '~/diffs/store/mutation_types'; import * as types from '~/diffs/store/mutation_types';
import { INLINE_DIFF_VIEW_TYPE, INLINE_DIFF_LINES_KEY } from '~/diffs/constants'; import { INLINE_DIFF_VIEW_TYPE, INLINE_DIFF_LINES_KEY } from '~/diffs/constants';
import diffFileMockData from '../mock_data/diff_file';
import * as utils from '~/diffs/store/utils'; import * as utils from '~/diffs/store/utils';
import diffFileMockData from '../mock_data/diff_file';
describe('DiffsStoreMutations', () => { describe('DiffsStoreMutations', () => {
describe('SET_BASE_CONFIG', () => { describe('SET_BASE_CONFIG', () => {
......
import { shallowMount, mount } from '@vue/test-utils'; import { shallowMount, mount } from '@vue/test-utils';
import { TEST_HOST } from 'helpers/test_constants';
import { GlDropdown, GlDropdownItem, GlLoadingIcon, GlIcon } from '@gitlab/ui'; import { GlDropdown, GlDropdownItem, GlLoadingIcon, GlIcon } from '@gitlab/ui';
import { TEST_HOST } from 'helpers/test_constants';
import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
import eventHub from '~/environments/event_hub'; import eventHub from '~/environments/event_hub';
import EnvironmentActions from '~/environments/components/environment_actions.vue'; import EnvironmentActions from '~/environments/components/environment_actions.vue';
......
...@@ -5,8 +5,8 @@ import stubChildren from 'helpers/stub_children'; ...@@ -5,8 +5,8 @@ import stubChildren from 'helpers/stub_children';
import ErrorTrackingList from '~/error_tracking/components/error_tracking_list.vue'; import ErrorTrackingList from '~/error_tracking/components/error_tracking_list.vue';
import ErrorTrackingActions from '~/error_tracking/components/error_tracking_actions.vue'; import ErrorTrackingActions from '~/error_tracking/components/error_tracking_actions.vue';
import { trackErrorListViewsOptions, trackErrorStatusUpdateOptions } from '~/error_tracking/utils'; import { trackErrorListViewsOptions, trackErrorStatusUpdateOptions } from '~/error_tracking/utils';
import errorsList from './list_mock.json';
import Tracking from '~/tracking'; import Tracking from '~/tracking';
import errorsList from './list_mock.json';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(Vuex); localVue.use(Vuex);
......
...@@ -8,8 +8,8 @@ import appComponent from '~/frequent_items/components/app.vue'; ...@@ -8,8 +8,8 @@ import appComponent from '~/frequent_items/components/app.vue';
import eventHub from '~/frequent_items/event_hub'; import eventHub from '~/frequent_items/event_hub';
import { FREQUENT_ITEMS, HOUR_IN_MS } from '~/frequent_items/constants'; import { FREQUENT_ITEMS, HOUR_IN_MS } from '~/frequent_items/constants';
import { getTopFrequentItems } from '~/frequent_items/utils'; import { getTopFrequentItems } from '~/frequent_items/utils';
import { currentSession, mockFrequentProjects, mockSearchedProjects } from '../mock_data';
import { createStore } from '~/frequent_items/store'; import { createStore } from '~/frequent_items/store';
import { currentSession, mockFrequentProjects, mockSearchedProjects } from '../mock_data';
useLocalStorageSpy(); useLocalStorageSpy();
......
import testAction from 'helpers/vuex_action_helper';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import testAction from 'helpers/vuex_action_helper';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import AccessorUtilities from '~/lib/utils/accessor'; import AccessorUtilities from '~/lib/utils/accessor';
import * as actions from '~/frequent_items/store/actions'; import * as actions from '~/frequent_items/store/actions';
......
/* eslint no-param-reassign: "off" */ /* eslint no-param-reassign: "off" */
import $ from 'jquery'; import $ from 'jquery';
import MockAdapter from 'axios-mock-adapter';
import { emojiFixtureMap, initEmojiMock, describeEmojiFields } from 'helpers/emoji'; import { emojiFixtureMap, initEmojiMock, describeEmojiFields } from 'helpers/emoji';
import '~/lib/utils/jquery_at_who'; import '~/lib/utils/jquery_at_who';
import GfmAutoComplete, { membersBeforeSave } from 'ee_else_ce/gfm_auto_complete'; import GfmAutoComplete, { membersBeforeSave } from 'ee_else_ce/gfm_auto_complete';
import { TEST_HOST } from 'helpers/test_constants'; import { TEST_HOST } from 'helpers/test_constants';
import { getJSONFixture } from 'helpers/fixtures'; import { getJSONFixture } from 'helpers/fixtures';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import MockAdapter from 'axios-mock-adapter';
import AjaxCache from '~/lib/utils/ajax_cache'; import AjaxCache from '~/lib/utils/ajax_cache';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { TEST_HOST } from 'helpers/test_constants';
import { GlLoadingIcon } from '@gitlab/ui'; import { GlLoadingIcon } from '@gitlab/ui';
import { listen } from 'codesandbox-api'; import { listen } from 'codesandbox-api';
import { TEST_HOST } from 'helpers/test_constants';
import ClientsideNavigator from '~/ide/components/preview/navigator.vue'; import ClientsideNavigator from '~/ide/components/preview/navigator.vue';
jest.mock('codesandbox-api', () => ({ jest.mock('codesandbox-api', () => ({
......
import Editor from '~/ide/lib/editor'; import Editor from '~/ide/lib/editor';
import DecorationsController from '~/ide/lib/decorations/controller'; import DecorationsController from '~/ide/lib/decorations/controller';
import Model from '~/ide/lib/common/model'; import Model from '~/ide/lib/common/model';
import { file } from '../../helpers';
import { createStore } from '~/ide/stores'; import { createStore } from '~/ide/stores';
import { file } from '../../helpers';
describe('Multi-file editor library decorations controller', () => { describe('Multi-file editor library decorations controller', () => {
let editorInstance; let editorInstance;
......
...@@ -20,8 +20,8 @@ import { ...@@ -20,8 +20,8 @@ import {
} from '~/ide/stores/actions'; } from '~/ide/stores/actions';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import * as types from '~/ide/stores/mutation_types'; import * as types from '~/ide/stores/mutation_types';
import { file, createTriggerRenameAction, createTriggerChangeAction } from '../helpers';
import eventHub from '~/ide/eventhub'; import eventHub from '~/ide/eventhub';
import { file, createTriggerRenameAction, createTriggerChangeAction } from '../helpers';
jest.mock('~/lib/utils/url_utility', () => ({ jest.mock('~/lib/utils/url_utility', () => ({
visitUrl: jest.fn(), visitUrl: jest.fn(),
......
import { file } from 'jest/ide/helpers';
import axios from 'axios'; import axios from 'axios';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import { file } from 'jest/ide/helpers';
import testAction from 'helpers/vuex_action_helper'; import testAction from 'helpers/vuex_action_helper';
import { visitUrl } from '~/lib/utils/url_utility'; import { visitUrl } from '~/lib/utils/url_utility';
import { createStore } from '~/ide/stores'; import { createStore } from '~/ide/stores';
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import waitForPromises from 'helpers/wait_for_promises';
import { GlAlert, GlModal } from '@gitlab/ui'; import { GlAlert, GlModal } from '@gitlab/ui';
import waitForPromises from 'helpers/wait_for_promises';
import PagerDutySettingsForm from '~/incidents_settings/components/pagerduty_form.vue'; import PagerDutySettingsForm from '~/incidents_settings/components/pagerduty_form.vue';
describe('Alert integration settings form', () => { describe('Alert integration settings form', () => {
......
...@@ -7,6 +7,10 @@ import { visitUrl } from '~/lib/utils/url_utility'; ...@@ -7,6 +7,10 @@ import { visitUrl } from '~/lib/utils/url_utility';
import '~/behaviors/markdown/render_gfm'; import '~/behaviors/markdown/render_gfm';
import IssuableApp from '~/issue_show/components/app.vue'; import IssuableApp from '~/issue_show/components/app.vue';
import eventHub from '~/issue_show/event_hub'; import eventHub from '~/issue_show/event_hub';
import IncidentTabs from '~/issue_show/components/incidents/incident_tabs.vue';
import DescriptionComponent from '~/issue_show/components/description.vue';
import PinnedLinks from '~/issue_show/components/pinned_links.vue';
import { IssuableStatus, IssuableStatusText } from '~/issue_show/constants';
import { import {
appProps, appProps,
initialRequest, initialRequest,
...@@ -14,10 +18,6 @@ import { ...@@ -14,10 +18,6 @@ import {
secondRequest, secondRequest,
zoomMeetingUrl, zoomMeetingUrl,
} from '../mock_data'; } from '../mock_data';
import IncidentTabs from '~/issue_show/components/incidents/incident_tabs.vue';
import DescriptionComponent from '~/issue_show/components/description.vue';
import PinnedLinks from '~/issue_show/components/pinned_links.vue';
import { IssuableStatus, IssuableStatusText } from '~/issue_show/constants';
function formatText(text) { function formatText(text) {
return text.trim().replace(/\s\s+/g, ' '); return text.trim().replace(/\s\s+/g, ' ');
......
...@@ -4,12 +4,12 @@ import { GlTab } from '@gitlab/ui'; ...@@ -4,12 +4,12 @@ import { GlTab } from '@gitlab/ui';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import INVALID_URL from '~/lib/utils/invalid_url'; import INVALID_URL from '~/lib/utils/invalid_url';
import IncidentTabs from '~/issue_show/components/incidents/incident_tabs.vue'; import IncidentTabs from '~/issue_show/components/incidents/incident_tabs.vue';
import { descriptionProps } from '../../mock_data';
import DescriptionComponent from '~/issue_show/components/description.vue'; import DescriptionComponent from '~/issue_show/components/description.vue';
import HighlightBar from '~/issue_show/components/incidents/highlight_bar.vue'; import HighlightBar from '~/issue_show/components/incidents/highlight_bar.vue';
import AlertDetailsTable from '~/vue_shared/components/alert_details_table.vue'; import AlertDetailsTable from '~/vue_shared/components/alert_details_table.vue';
import Tracking from '~/tracking'; import Tracking from '~/tracking';
import { trackIncidentDetailsViewsOptions } from '~/incidents/constants'; import { trackIncidentDetailsViewsOptions } from '~/incidents/constants';
import { descriptionProps } from '../../mock_data';
const mockAlert = { const mockAlert = {
__typename: 'AlertManagementAlert', __typename: 'AlertManagementAlert',
......
...@@ -4,8 +4,8 @@ import waitForPromises from 'helpers/wait_for_promises'; ...@@ -4,8 +4,8 @@ import waitForPromises from 'helpers/wait_for_promises';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { initIssuableApp } from '~/issue_show/issue'; import { initIssuableApp } from '~/issue_show/issue';
import * as parseData from '~/issue_show/utils/parse_data'; import * as parseData from '~/issue_show/utils/parse_data';
import { appProps } from './mock_data';
import createStore from '~/notes/stores'; import createStore from '~/notes/stores';
import { appProps } from './mock_data';
const mock = new MockAdapter(axios); const mock = new MockAdapter(axios);
mock.onGet().reply(200); mock.onGet().reply(200);
......
...@@ -7,8 +7,8 @@ import { formatDate } from '~/lib/utils/datetime_utility'; ...@@ -7,8 +7,8 @@ import { formatDate } from '~/lib/utils/datetime_utility';
import { mergeUrlParams } from '~/lib/utils/url_utility'; import { mergeUrlParams } from '~/lib/utils/url_utility';
import Issuable from '~/issues_list/components/issuable.vue'; import Issuable from '~/issues_list/components/issuable.vue';
import IssueAssignees from '~/vue_shared/components/issue/issue_assignees.vue'; import IssueAssignees from '~/vue_shared/components/issue/issue_assignees.vue';
import { simpleIssue, testAssignees, testLabels } from '../issuable_list_test_data';
import { isScopedLabel } from '~/lib/utils/common_utils'; import { isScopedLabel } from '~/lib/utils/common_utils';
import { simpleIssue, testAssignees, testLabels } from '../issuable_list_test_data';
jest.mock('~/user_popovers'); jest.mock('~/user_popovers');
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import { GlAlert, GlButton, GlModal } from '@gitlab/ui'; import { GlAlert, GlButton, GlModal } from '@gitlab/ui';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import JiraConnectApp from '~/jira_connect/components/app.vue'; import JiraConnectApp from '~/jira_connect/components/app.vue';
import createStore from '~/jira_connect/store'; import createStore from '~/jira_connect/store';
......
...@@ -3,10 +3,9 @@ import { GlAvatar, GlButton } from '@gitlab/ui'; ...@@ -3,10 +3,9 @@ import { GlAvatar, GlButton } from '@gitlab/ui';
import { extendedWrapper } from 'helpers/vue_test_utils_helper'; import { extendedWrapper } from 'helpers/vue_test_utils_helper';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import { mockGroup1 } from '../mock_data';
import GroupsListItem from '~/jira_connect/components/groups_list_item.vue'; import GroupsListItem from '~/jira_connect/components/groups_list_item.vue';
import * as JiraConnectApi from '~/jira_connect/api'; import * as JiraConnectApi from '~/jira_connect/api';
import { mockGroup1 } from '../mock_data';
describe('GroupsListItem', () => { describe('GroupsListItem', () => {
let wrapper; let wrapper;
......
import { GlButton, GlLink } from '@gitlab/ui'; import { GlButton, GlLink } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import job from '../mock_data';
import JobsSidebarRetryButton from '~/jobs/components/job_sidebar_retry_button.vue'; import JobsSidebarRetryButton from '~/jobs/components/job_sidebar_retry_button.vue';
import createStore from '~/jobs/store'; import createStore from '~/jobs/store';
import job from '../mock_data';
describe('Job Sidebar Retry Button', () => { describe('Job Sidebar Retry Button', () => {
let store; let store;
......
...@@ -4,9 +4,8 @@ import { defaultTimeRange } from '~/vue_shared/constants'; ...@@ -4,9 +4,8 @@ import { defaultTimeRange } from '~/vue_shared/constants';
import { convertToFixedRange } from '~/lib/utils/datetime_range'; import { convertToFixedRange } from '~/lib/utils/datetime_range';
import { createStore } from '~/logs/stores'; import { createStore } from '~/logs/stores';
import { TOKEN_TYPE_POD_NAME } from '~/logs/constants'; import { TOKEN_TYPE_POD_NAME } from '~/logs/constants';
import { mockPods, mockSearch } from '../mock_data';
import LogAdvancedFilters from '~/logs/components/log_advanced_filters.vue'; import LogAdvancedFilters from '~/logs/components/log_advanced_filters.vue';
import { mockPods, mockSearch } from '../mock_data';
const module = 'environmentLogs'; const module = 'environmentLogs';
......
import { GlDropdownItem } from '@gitlab/ui'; import { GlDropdownItem } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { createStore } from '~/logs/stores'; import { createStore } from '~/logs/stores';
import { mockPods, mockPodName } from '../mock_data';
import LogSimpleFilters from '~/logs/components/log_simple_filters.vue'; import LogSimpleFilters from '~/logs/components/log_simple_filters.vue';
import { mockPods, mockPodName } from '../mock_data';
const module = 'environmentLogs'; const module = 'environmentLogs';
......
...@@ -19,6 +19,7 @@ import { defaultTimeRange } from '~/vue_shared/constants'; ...@@ -19,6 +19,7 @@ import { defaultTimeRange } from '~/vue_shared/constants';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { deprecatedCreateFlash as flash } from '~/flash'; import { deprecatedCreateFlash as flash } from '~/flash';
import { TOKEN_TYPE_POD_NAME } from '~/logs/constants';
import { import {
mockPodName, mockPodName,
mockEnvironmentsEndpoint, mockEnvironmentsEndpoint,
...@@ -34,7 +35,6 @@ import { ...@@ -34,7 +35,6 @@ import {
mockManagedApps, mockManagedApps,
mockManagedAppsEndpoint, mockManagedAppsEndpoint,
} from '../mock_data'; } from '../mock_data';
import { TOKEN_TYPE_POD_NAME } from '~/logs/constants';
jest.mock('~/flash'); jest.mock('~/flash');
jest.mock('~/lib/utils/datetime_range'); jest.mock('~/lib/utils/datetime_range');
......
import { mount, createWrapper } from '@vue/test-utils'; import { mount, createWrapper } from '@vue/test-utils';
import { getByText as getByTextHelper } from '@testing-library/dom'; import { getByText as getByTextHelper } from '@testing-library/dom';
import { GlAvatarLink } from '@gitlab/ui'; import { GlAvatarLink } from '@gitlab/ui';
import { group as member } from '../../mock_data';
import GroupAvatar from '~/members/components/avatars/group_avatar.vue'; import GroupAvatar from '~/members/components/avatars/group_avatar.vue';
import { group as member } from '../../mock_data';
describe('MemberList', () => { describe('MemberList', () => {
let wrapper; let wrapper;
......
import { mount, createWrapper } from '@vue/test-utils'; import { mount, createWrapper } from '@vue/test-utils';
import { getByText as getByTextHelper } from '@testing-library/dom'; import { getByText as getByTextHelper } from '@testing-library/dom';
import { invite as member } from '../../mock_data';
import InviteAvatar from '~/members/components/avatars/invite_avatar.vue'; import InviteAvatar from '~/members/components/avatars/invite_avatar.vue';
import { invite as member } from '../../mock_data';
describe('MemberList', () => { describe('MemberList', () => {
let wrapper; let wrapper;
......
import { mount, createWrapper } from '@vue/test-utils'; import { mount, createWrapper } from '@vue/test-utils';
import { within } from '@testing-library/dom'; import { within } from '@testing-library/dom';
import { GlAvatarLink, GlBadge } from '@gitlab/ui'; import { GlAvatarLink, GlBadge } from '@gitlab/ui';
import { member as memberMock, orphanedMember } from '../../mock_data';
import UserAvatar from '~/members/components/avatars/user_avatar.vue'; import UserAvatar from '~/members/components/avatars/user_avatar.vue';
import { member as memberMock, orphanedMember } from '../../mock_data';
describe('UserAvatar', () => { describe('UserAvatar', () => {
let wrapper; let wrapper;
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { MEMBER_TYPES } from '~/members/constants'; import { MEMBER_TYPES } from '~/members/constants';
import { member as memberMock, group, invite, accessRequest } from '../../mock_data';
import MemberActionButtons from '~/members/components/table/member_action_buttons.vue'; import MemberActionButtons from '~/members/components/table/member_action_buttons.vue';
import UserActionButtons from '~/members/components/action_buttons/user_action_buttons.vue'; import UserActionButtons from '~/members/components/action_buttons/user_action_buttons.vue';
import GroupActionButtons from '~/members/components/action_buttons/group_action_buttons.vue'; import GroupActionButtons from '~/members/components/action_buttons/group_action_buttons.vue';
import InviteActionButtons from '~/members/components/action_buttons/invite_action_buttons.vue'; import InviteActionButtons from '~/members/components/action_buttons/invite_action_buttons.vue';
import AccessRequestActionButtons from '~/members/components/action_buttons/access_request_action_buttons.vue'; import AccessRequestActionButtons from '~/members/components/action_buttons/access_request_action_buttons.vue';
import { member as memberMock, group, invite, accessRequest } from '../../mock_data';
describe('MemberActionButtons', () => { describe('MemberActionButtons', () => {
let wrapper; let wrapper;
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { MEMBER_TYPES } from '~/members/constants'; import { MEMBER_TYPES } from '~/members/constants';
import { member as memberMock, group, invite, accessRequest } from '../../mock_data';
import MemberAvatar from '~/members/components/table/member_avatar.vue'; import MemberAvatar from '~/members/components/table/member_avatar.vue';
import UserAvatar from '~/members/components/avatars/user_avatar.vue'; import UserAvatar from '~/members/components/avatars/user_avatar.vue';
import GroupAvatar from '~/members/components/avatars/group_avatar.vue'; import GroupAvatar from '~/members/components/avatars/group_avatar.vue';
import InviteAvatar from '~/members/components/avatars/invite_avatar.vue'; import InviteAvatar from '~/members/components/avatars/invite_avatar.vue';
import { member as memberMock, group, invite, accessRequest } from '../../mock_data';
describe('MemberList', () => { describe('MemberList', () => {
let wrapper; let wrapper;
......
import { mount, createLocalVue } from '@vue/test-utils'; import { mount, createLocalVue } from '@vue/test-utils';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { MEMBER_TYPES } from '~/members/constants'; import { MEMBER_TYPES } from '~/members/constants';
import MembersTableCell from '~/members/components/table/members_table_cell.vue';
import { import {
member as memberMock, member as memberMock,
directMember, directMember,
...@@ -9,7 +10,6 @@ import { ...@@ -9,7 +10,6 @@ import {
invite, invite,
accessRequest, accessRequest,
} from '../../mock_data'; } from '../../mock_data';
import MembersTableCell from '~/members/components/table/members_table_cell.vue';
describe('MembersTableCell', () => { describe('MembersTableCell', () => {
const WrappedComponent = { const WrappedComponent = {
......
...@@ -6,8 +6,8 @@ import MockAdapter from 'axios-mock-adapter'; ...@@ -6,8 +6,8 @@ import MockAdapter from 'axios-mock-adapter';
import { GlLoadingIcon, GlSearchBoxByType, GlDropdownItem } from '@gitlab/ui'; import { GlLoadingIcon, GlSearchBoxByType, GlDropdownItem } from '@gitlab/ui';
import { ENTER_KEY } from '~/lib/utils/keys'; import { ENTER_KEY } from '~/lib/utils/keys';
import MilestoneCombobox from '~/milestones/components/milestone_combobox.vue'; import MilestoneCombobox from '~/milestones/components/milestone_combobox.vue';
import { projectMilestones, groupMilestones } from './mock_data';
import createStore from '~/milestones/stores/'; import createStore from '~/milestones/stores/';
import { projectMilestones, groupMilestones } from './mock_data';
const extraLinks = [ const extraLinks = [
{ text: 'Create new', url: 'http://127.0.0.1:3000/h5bp/html5-boilerplate/-/milestones/new' }, { text: 'Create new', url: 'http://127.0.0.1:3000/h5bp/html5-boilerplate/-/milestones/new' },
......
...@@ -3,9 +3,9 @@ import { TEST_HOST } from 'helpers/test_constants'; ...@@ -3,9 +3,9 @@ import { TEST_HOST } from 'helpers/test_constants';
import Anomaly from '~/monitoring/components/charts/anomaly.vue'; import Anomaly from '~/monitoring/components/charts/anomaly.vue';
import { colorValues } from '~/monitoring/constants'; import { colorValues } from '~/monitoring/constants';
import MonitorTimeSeriesChart from '~/monitoring/components/charts/time_series.vue';
import { anomalyDeploymentData, mockProjectDir } from '../../mock_data'; import { anomalyDeploymentData, mockProjectDir } from '../../mock_data';
import { anomalyGraphData } from '../../graph_data'; import { anomalyGraphData } from '../../graph_data';
import MonitorTimeSeriesChart from '~/monitoring/components/charts/time_series.vue';
const mockProjectPath = `${TEST_HOST}${mockProjectDir}`; const mockProjectPath = `${TEST_HOST}${mockProjectDir}`;
......
import { mount, shallowMount } from '@vue/test-utils'; import { mount, shallowMount } from '@vue/test-utils';
import { setTestTimeout } from 'helpers/timeout';
import timezoneMock from 'timezone-mock'; import timezoneMock from 'timezone-mock';
import { GlLink } from '@gitlab/ui'; import { GlLink } from '@gitlab/ui';
import { TEST_HOST } from 'helpers/test_constants';
import { import {
GlAreaChart, GlAreaChart,
GlLineChart, GlLineChart,
GlChartSeriesLabel, GlChartSeriesLabel,
GlChartLegend, GlChartLegend,
} from '@gitlab/ui/dist/charts'; } from '@gitlab/ui/dist/charts';
import { TEST_HOST } from 'helpers/test_constants';
import { setTestTimeout } from 'helpers/timeout';
import { shallowWrapperContainsSlotText } from 'helpers/vue_test_utils_helper'; import { shallowWrapperContainsSlotText } from 'helpers/vue_test_utils_helper';
import { panelTypes, chartHeight } from '~/monitoring/constants'; import { panelTypes, chartHeight } from '~/monitoring/constants';
import TimeSeries from '~/monitoring/components/charts/time_series.vue'; import TimeSeries from '~/monitoring/components/charts/time_series.vue';
......
...@@ -2,13 +2,13 @@ import { shallowMount } from '@vue/test-utils'; ...@@ -2,13 +2,13 @@ import { shallowMount } from '@vue/test-utils';
import { GlDropdownItem } from '@gitlab/ui'; import { GlDropdownItem } from '@gitlab/ui';
import { createStore } from '~/monitoring/stores'; import { createStore } from '~/monitoring/stores';
import { DASHBOARD_PAGE, PANEL_NEW_PAGE } from '~/monitoring/router/constants'; import { DASHBOARD_PAGE, PANEL_NEW_PAGE } from '~/monitoring/router/constants';
import { setupAllDashboards, setupStoreWithData } from '../store_utils';
import { redirectTo } from '~/lib/utils/url_utility'; import { redirectTo } from '~/lib/utils/url_utility';
import Tracking from '~/tracking'; import Tracking from '~/tracking';
import ActionsMenu from '~/monitoring/components/dashboard_actions_menu.vue'; import ActionsMenu from '~/monitoring/components/dashboard_actions_menu.vue';
import CustomMetricsFormFields from '~/custom_metrics/components/custom_metrics_form_fields.vue'; import CustomMetricsFormFields from '~/custom_metrics/components/custom_metrics_form_fields.vue';
import { dashboardActionsMenuProps, dashboardGitResponse } from '../mock_data';
import * as types from '~/monitoring/stores/mutation_types'; import * as types from '~/monitoring/stores/mutation_types';
import { dashboardActionsMenuProps, dashboardGitResponse } from '../mock_data';
import { setupAllDashboards, setupStoreWithData } from '../store_utils';
jest.mock('~/lib/utils/url_utility', () => ({ jest.mock('~/lib/utils/url_utility', () => ({
redirectTo: jest.fn(), redirectTo: jest.fn(),
......
...@@ -7,6 +7,7 @@ import RefreshButton from '~/monitoring/components/refresh_button.vue'; ...@@ -7,6 +7,7 @@ import RefreshButton from '~/monitoring/components/refresh_button.vue';
import DashboardHeader from '~/monitoring/components/dashboard_header.vue'; import DashboardHeader from '~/monitoring/components/dashboard_header.vue';
import DashboardsDropdown from '~/monitoring/components/dashboards_dropdown.vue'; import DashboardsDropdown from '~/monitoring/components/dashboards_dropdown.vue';
import ActionsMenu from '~/monitoring/components/dashboard_actions_menu.vue'; import ActionsMenu from '~/monitoring/components/dashboard_actions_menu.vue';
import { redirectTo } from '~/lib/utils/url_utility';
import { setupAllDashboards, setupStoreWithDashboard, setupStoreWithData } from '../store_utils'; import { setupAllDashboards, setupStoreWithDashboard, setupStoreWithData } from '../store_utils';
import { import {
environmentData, environmentData,
...@@ -14,7 +15,6 @@ import { ...@@ -14,7 +15,6 @@ import {
selfMonitoringDashboardGitResponse, selfMonitoringDashboardGitResponse,
dashboardHeaderProps, dashboardHeaderProps,
} from '../mock_data'; } from '../mock_data';
import { redirectTo } from '~/lib/utils/url_utility';
const mockProjectPath = 'https://path/to/project'; const mockProjectPath = 'https://path/to/project';
......
...@@ -3,11 +3,10 @@ import { GlCard, GlForm, GlFormTextarea, GlAlert } from '@gitlab/ui'; ...@@ -3,11 +3,10 @@ import { GlCard, GlForm, GlFormTextarea, GlAlert } from '@gitlab/ui';
import { createStore } from '~/monitoring/stores'; import { createStore } from '~/monitoring/stores';
import DashboardPanel from '~/monitoring/components/dashboard_panel.vue'; import DashboardPanel from '~/monitoring/components/dashboard_panel.vue';
import * as types from '~/monitoring/stores/mutation_types'; import * as types from '~/monitoring/stores/mutation_types';
import { metricsDashboardResponse } from '../fixture_data';
import { mockTimeRange } from '../mock_data';
import DashboardPanelBuilder from '~/monitoring/components/dashboard_panel_builder.vue'; import DashboardPanelBuilder from '~/monitoring/components/dashboard_panel_builder.vue';
import DateTimePicker from '~/vue_shared/components/date_time_picker/date_time_picker.vue'; import DateTimePicker from '~/vue_shared/components/date_time_picker/date_time_picker.vue';
import { metricsDashboardResponse } from '../fixture_data';
import { mockTimeRange } from '../mock_data';
const mockPanel = metricsDashboardResponse.dashboard.panel_groups[0].panels[0]; const mockPanel = metricsDashboardResponse.dashboard.panel_groups[0].panels[0];
......
import Vuex from 'vuex'; import Vuex from 'vuex';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import AxiosMockAdapter from 'axios-mock-adapter'; import AxiosMockAdapter from 'axios-mock-adapter';
import { setTestTimeout } from 'helpers/timeout';
import { GlDropdownItem } from '@gitlab/ui'; import { GlDropdownItem } from '@gitlab/ui';
import { setTestTimeout } from 'helpers/timeout';
import invalidUrl from '~/lib/utils/invalid_url'; import invalidUrl from '~/lib/utils/invalid_url';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import AlertWidget from '~/monitoring/components/alert_widget.vue'; import AlertWidget from '~/monitoring/components/alert_widget.vue';
import DashboardPanel from '~/monitoring/components/dashboard_panel.vue'; import DashboardPanel from '~/monitoring/components/dashboard_panel.vue';
import {
mockAlert,
mockLogsHref,
mockLogsPath,
mockNamespace,
mockNamespacedData,
mockTimeRange,
} from '../mock_data';
import { dashboardProps, graphData, graphDataEmpty } from '../fixture_data';
import {
anomalyGraphData,
singleStatGraphData,
heatmapGraphData,
barGraphData,
} from '../graph_data';
import { panelTypes } from '~/monitoring/constants'; import { panelTypes } from '~/monitoring/constants';
...@@ -37,6 +22,21 @@ import MonitorStackedColumnChart from '~/monitoring/components/charts/stacked_co ...@@ -37,6 +22,21 @@ import MonitorStackedColumnChart from '~/monitoring/components/charts/stacked_co
import { createStore, monitoringDashboard } from '~/monitoring/stores'; import { createStore, monitoringDashboard } from '~/monitoring/stores';
import { createStore as createEmbedGroupStore } from '~/monitoring/stores/embed_group'; import { createStore as createEmbedGroupStore } from '~/monitoring/stores/embed_group';
import {
anomalyGraphData,
singleStatGraphData,
heatmapGraphData,
barGraphData,
} from '../graph_data';
import { dashboardProps, graphData, graphDataEmpty } from '../fixture_data';
import {
mockAlert,
mockLogsHref,
mockLogsPath,
mockNamespace,
mockNamespacedData,
mockTimeRange,
} from '../mock_data';
const mocks = { const mocks = {
$toast: { $toast: {
......
...@@ -16,6 +16,7 @@ import GraphGroup from '~/monitoring/components/graph_group.vue'; ...@@ -16,6 +16,7 @@ import GraphGroup from '~/monitoring/components/graph_group.vue';
import LinksSection from '~/monitoring/components/links_section.vue'; import LinksSection from '~/monitoring/components/links_section.vue';
import { createStore } from '~/monitoring/stores'; import { createStore } from '~/monitoring/stores';
import * as types from '~/monitoring/stores/mutation_types'; import * as types from '~/monitoring/stores/mutation_types';
import { deprecatedCreateFlash as createFlash } from '~/flash';
import { import {
setupAllDashboards, setupAllDashboards,
setupStoreWithDashboard, setupStoreWithDashboard,
...@@ -30,7 +31,6 @@ import { ...@@ -30,7 +31,6 @@ import {
metricsDashboardPanelCount, metricsDashboardPanelCount,
dashboardProps, dashboardProps,
} from '../fixture_data'; } from '../fixture_data';
import { deprecatedCreateFlash as createFlash } from '~/flash';
jest.mock('~/flash'); jest.mock('~/flash');
......
...@@ -9,13 +9,13 @@ import { ...@@ -9,13 +9,13 @@ import {
updateHistory, updateHistory,
} from '~/lib/utils/url_utility'; } from '~/lib/utils/url_utility';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { mockProjectDir } from '../mock_data';
import { dashboardProps } from '../fixture_data';
import Dashboard from '~/monitoring/components/dashboard.vue'; import Dashboard from '~/monitoring/components/dashboard.vue';
import DashboardHeader from '~/monitoring/components/dashboard_header.vue'; import DashboardHeader from '~/monitoring/components/dashboard_header.vue';
import { createStore } from '~/monitoring/stores'; import { createStore } from '~/monitoring/stores';
import { defaultTimeRange } from '~/vue_shared/constants'; import { defaultTimeRange } from '~/vue_shared/constants';
import { dashboardProps } from '../fixture_data';
import { mockProjectDir } from '../mock_data';
jest.mock('~/flash'); jest.mock('~/flash');
jest.mock('~/lib/utils/url_utility'); jest.mock('~/lib/utils/url_utility');
......
import { timeSeriesGraphData } from './graph_data';
import { graphDataToCsv } from '~/monitoring/csv_export'; import { graphDataToCsv } from '~/monitoring/csv_export';
import { timeSeriesGraphData } from './graph_data';
describe('monitoring export_csv', () => { describe('monitoring export_csv', () => {
describe('graphDataToCsv', () => { describe('graphDataToCsv', () => {
......
// The path below needs to be relative because we import the mock-data to karma // The path below needs to be relative because we import the mock-data to karma
import { TEST_HOST } from '../__helpers__/test_constants';
import invalidUrl from '~/lib/utils/invalid_url'; import invalidUrl from '~/lib/utils/invalid_url';
import { TEST_HOST } from '../__helpers__/test_constants';
// This import path needs to be relative for now because this mock data is used in // This import path needs to be relative for now because this mock data is used in
// Karma specs too, where the helpers/test_constants alias can not be resolved // Karma specs too, where the helpers/test_constants alias can not be resolved
......
...@@ -3,8 +3,8 @@ import { backoffMockImplementation } from 'helpers/backoff_helper'; ...@@ -3,8 +3,8 @@ import { backoffMockImplementation } from 'helpers/backoff_helper';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import statusCodes from '~/lib/utils/http_status'; import statusCodes from '~/lib/utils/http_status';
import * as commonUtils from '~/lib/utils/common_utils'; import * as commonUtils from '~/lib/utils/common_utils';
import { metricsDashboardResponse } from '../fixture_data';
import { getDashboard, getPrometheusQueryData } from '~/monitoring/requests'; import { getDashboard, getPrometheusQueryData } from '~/monitoring/requests';
import { metricsDashboardResponse } from '../fixture_data';
describe('monitoring metrics_requests', () => { describe('monitoring metrics_requests', () => {
let mock; let mock;
......
...@@ -11,8 +11,8 @@ import { ...@@ -11,8 +11,8 @@ import {
normalizeCustomDashboardPath, normalizeCustomDashboardPath,
} from '~/monitoring/stores/utils'; } from '~/monitoring/stores/utils';
import * as urlUtils from '~/lib/utils/url_utility'; import * as urlUtils from '~/lib/utils/url_utility';
import { annotationsData } from '../mock_data';
import { NOT_IN_DB_PREFIX } from '~/monitoring/constants'; import { NOT_IN_DB_PREFIX } from '~/monitoring/constants';
import { annotationsData } from '../mock_data';
const projectPath = 'gitlab-org/gitlab-test'; const projectPath = 'gitlab-org/gitlab-test';
......
...@@ -3,13 +3,13 @@ import { ...@@ -3,13 +3,13 @@ import {
mergeURLVariables, mergeURLVariables,
optionsFromSeriesData, optionsFromSeriesData,
} from '~/monitoring/stores/variable_mapping'; } from '~/monitoring/stores/variable_mapping';
import * as urlUtils from '~/lib/utils/url_utility';
import { import {
templatingVariablesExamples, templatingVariablesExamples,
storeTextVariables, storeTextVariables,
storeCustomVariables, storeCustomVariables,
storeMetricLabelValuesVariables, storeMetricLabelValuesVariables,
} from '../mock_data'; } from '../mock_data';
import * as urlUtils from '~/lib/utils/url_utility';
describe('Monitoring variable mapping', () => { describe('Monitoring variable mapping', () => {
describe('parseTemplatingVariables', () => { describe('parseTemplatingVariables', () => {
......
import { shallowMount, mount } from '@vue/test-utils'; import { shallowMount, mount } from '@vue/test-utils';
import { discussionMock } from '../mock_data';
import DiscussionActions from '~/notes/components/discussion_actions.vue'; import DiscussionActions from '~/notes/components/discussion_actions.vue';
import ReplyPlaceholder from '~/notes/components/discussion_reply_placeholder.vue'; import ReplyPlaceholder from '~/notes/components/discussion_reply_placeholder.vue';
import ResolveDiscussionButton from '~/notes/components/discussion_resolve_button.vue'; import ResolveDiscussionButton from '~/notes/components/discussion_resolve_button.vue';
import ResolveWithIssueButton from '~/notes/components/discussion_resolve_with_issue_button.vue'; import ResolveWithIssueButton from '~/notes/components/discussion_resolve_with_issue_button.vue';
import createStore from '~/notes/stores'; import createStore from '~/notes/stores';
import { discussionMock } from '../mock_data';
// NOTE: clone mock_data so that it is not accidentally mutated // NOTE: clone mock_data so that it is not accidentally mutated
const createDiscussionMock = (props = {}) => const createDiscussionMock = (props = {}) =>
......
...@@ -3,8 +3,8 @@ import { shallowMount, createLocalVue } from '@vue/test-utils'; ...@@ -3,8 +3,8 @@ import { shallowMount, createLocalVue } from '@vue/test-utils';
import { GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import notesModule from '~/notes/stores/modules'; import notesModule from '~/notes/stores/modules';
import DiscussionCounter from '~/notes/components/discussion_counter.vue'; import DiscussionCounter from '~/notes/components/discussion_counter.vue';
import { noteableDataMock, discussionMock, notesDataMock, userDataMock } from '../mock_data';
import * as types from '~/notes/stores/mutation_types'; import * as types from '~/notes/stores/mutation_types';
import { noteableDataMock, discussionMock, notesDataMock, userDataMock } from '../mock_data';
describe('DiscussionCounter component', () => { describe('DiscussionCounter component', () => {
let store; let store;
......
import Vue from 'vue'; import Vue from 'vue';
import { mount, createLocalVue, createWrapper } from '@vue/test-utils'; import { mount, createLocalVue, createWrapper } from '@vue/test-utils';
import { TEST_HOST } from 'spec/test_constants';
import AxiosMockAdapter from 'axios-mock-adapter'; import AxiosMockAdapter from 'axios-mock-adapter';
import { TEST_HOST } from 'spec/test_constants';
import createStore from '~/notes/stores'; import createStore from '~/notes/stores';
import noteActions from '~/notes/components/note_actions.vue'; import noteActions from '~/notes/components/note_actions.vue';
import { userDataMock } from '../mock_data';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { userDataMock } from '../mock_data';
describe('noteActions', () => { describe('noteActions', () => {
let wrapper; let wrapper;
......
...@@ -10,9 +10,9 @@ import createStore from '~/notes/stores'; ...@@ -10,9 +10,9 @@ import createStore from '~/notes/stores';
import * as constants from '~/notes/constants'; import * as constants from '~/notes/constants';
import '~/behaviors/markdown/render_gfm'; import '~/behaviors/markdown/render_gfm';
// TODO: use generated fixture (https://gitlab.com/gitlab-org/gitlab-foss/issues/62491) // TODO: use generated fixture (https://gitlab.com/gitlab-org/gitlab-foss/issues/62491)
import * as mockData from '../mock_data';
import * as urlUtility from '~/lib/utils/url_utility'; import * as urlUtility from '~/lib/utils/url_utility';
import OrderedLayout from '~/vue_shared/components/ordered_layout.vue'; import OrderedLayout from '~/vue_shared/components/ordered_layout.vue';
import * as mockData from '../mock_data';
jest.mock('~/user_popovers', () => jest.fn()); jest.mock('~/user_popovers', () => jest.fn());
......
import { TEST_HOST } from 'spec/test_constants';
import AxiosMockAdapter from 'axios-mock-adapter'; import AxiosMockAdapter from 'axios-mock-adapter';
import { TEST_HOST } from 'spec/test_constants';
import testAction from 'helpers/vuex_action_helper'; import testAction from 'helpers/vuex_action_helper';
import Api from '~/api'; import Api from '~/api';
import { deprecatedCreateFlash as Flash } from '~/flash'; import { deprecatedCreateFlash as Flash } from '~/flash';
...@@ -9,7 +9,11 @@ import * as mutationTypes from '~/notes/stores/mutation_types'; ...@@ -9,7 +9,11 @@ import * as mutationTypes from '~/notes/stores/mutation_types';
import * as notesConstants from '~/notes/constants'; import * as notesConstants from '~/notes/constants';
import createStore from '~/notes/stores'; import createStore from '~/notes/stores';
import mrWidgetEventHub from '~/vue_merge_request_widget/event_hub'; import mrWidgetEventHub from '~/vue_merge_request_widget/event_hub';
import { resetStore } from '../helpers'; import axios from '~/lib/utils/axios_utils';
import * as utils from '~/notes/stores/utils';
import updateIssueConfidentialMutation from '~/sidebar/components/confidential/mutations/update_issue_confidential.mutation.graphql';
import updateMergeRequestLockMutation from '~/sidebar/components/lock/mutations/update_merge_request_lock.mutation.graphql';
import updateIssueLockMutation from '~/sidebar/components/lock/mutations/update_issue_lock.mutation.graphql';
import { import {
discussionMock, discussionMock,
notesDataMock, notesDataMock,
...@@ -18,11 +22,7 @@ import { ...@@ -18,11 +22,7 @@ import {
individualNote, individualNote,
batchSuggestionsInfoMock, batchSuggestionsInfoMock,
} from '../mock_data'; } from '../mock_data';
import axios from '~/lib/utils/axios_utils'; import { resetStore } from '../helpers';
import * as utils from '~/notes/stores/utils';
import updateIssueConfidentialMutation from '~/sidebar/components/confidential/mutations/update_issue_confidential.mutation.graphql';
import updateMergeRequestLockMutation from '~/sidebar/components/lock/mutations/update_merge_request_lock.mutation.graphql';
import updateIssueLockMutation from '~/sidebar/components/lock/mutations/update_issue_lock.mutation.graphql';
const TEST_ERROR_MESSAGE = 'Test error message'; const TEST_ERROR_MESSAGE = 'Test error message';
jest.mock('~/flash'); jest.mock('~/flash');
......
import axios from 'axios'; import axios from 'axios';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlButtonGroup, GlDropdown, GlDropdownItem } from '@gitlab/ui';
import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import { GlButtonGroup, GlDropdown, GlDropdownItem } from '@gitlab/ui';
import httpStatus from '~/lib/utils/http_status'; import httpStatus from '~/lib/utils/http_status';
import NotificationsDropdown from '~/notifications/components/notifications_dropdown.vue'; import NotificationsDropdown from '~/notifications/components/notifications_dropdown.vue';
import NotificationsDropdownItem from '~/notifications/components/notifications_dropdown_item.vue'; import NotificationsDropdownItem from '~/notifications/components/notifications_dropdown_item.vue';
......
...@@ -17,6 +17,7 @@ import { ...@@ -17,6 +17,7 @@ import {
composerPackageInclude, composerPackageInclude,
groupExists, groupExists,
} from '~/packages/details/store/getters'; } from '~/packages/details/store/getters';
import { NpmManager } from '~/packages/details/constants';
import { import {
conanPackage, conanPackage,
npmPackage, npmPackage,
...@@ -32,7 +33,6 @@ import { ...@@ -32,7 +33,6 @@ import {
registryUrl, registryUrl,
pypiSetupCommandStr, pypiSetupCommandStr,
} from '../mock_data'; } from '../mock_data';
import { NpmManager } from '~/packages/details/constants';
describe('Getters PackageDetails Store', () => { describe('Getters PackageDetails Store', () => {
let state; let state;
......
...@@ -6,8 +6,8 @@ import { GlAreaChart } from '@gitlab/ui/dist/charts'; ...@@ -6,8 +6,8 @@ import { GlAreaChart } from '@gitlab/ui/dist/charts';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import CodeCoverage from '~/pages/projects/graphs/components/code_coverage.vue'; import CodeCoverage from '~/pages/projects/graphs/components/code_coverage.vue';
import { codeCoverageMockData, sortedDataByDates } from './mock_data';
import httpStatusCodes from '~/lib/utils/http_status'; import httpStatusCodes from '~/lib/utils/http_status';
import { codeCoverageMockData, sortedDataByDates } from './mock_data';
describe('Code Coverage', () => { describe('Code Coverage', () => {
let wrapper; let wrapper;
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { EDITOR_READY_EVENT } from '~/editor/constants';
import TextEditor from '~/pipeline_editor/components/text_editor.vue';
import { import {
mockCiConfigPath, mockCiConfigPath,
mockCiYml, mockCiYml,
...@@ -7,9 +10,6 @@ import { ...@@ -7,9 +10,6 @@ import {
mockProjectNamespace, mockProjectNamespace,
} from '../mock_data'; } from '../mock_data';
import { EDITOR_READY_EVENT } from '~/editor/constants';
import TextEditor from '~/pipeline_editor/components/text_editor.vue';
describe('~/pipeline_editor/components/text_editor.vue', () => { describe('~/pipeline_editor/components/text_editor.vue', () => {
let wrapper; let wrapper;
......
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import Api from '~/api'; import Api from '~/api';
import httpStatus from '~/lib/utils/http_status';
import axios from '~/lib/utils/axios_utils';
import { resolvers } from '~/pipeline_editor/graphql/resolvers';
import { import {
mockCiConfigPath, mockCiConfigPath,
mockCiYml, mockCiYml,
...@@ -7,9 +10,6 @@ import { ...@@ -7,9 +10,6 @@ import {
mockLintResponse, mockLintResponse,
mockProjectFullPath, mockProjectFullPath,
} from '../mock_data'; } from '../mock_data';
import httpStatus from '~/lib/utils/http_status';
import axios from '~/lib/utils/axios_utils';
import { resolvers } from '~/pipeline_editor/graphql/resolvers';
jest.mock('~/api', () => { jest.mock('~/api', () => {
return { return {
......
import { nextTick } from 'vue'; import { nextTick } from 'vue';
import { mount, shallowMount, createLocalVue } from '@vue/test-utils'; import { mount, shallowMount, createLocalVue } from '@vue/test-utils';
import { GlAlert, GlButton, GlFormInput, GlFormTextarea, GlLoadingIcon, GlTabs } from '@gitlab/ui'; import { GlAlert, GlButton, GlFormInput, GlFormTextarea, GlLoadingIcon, GlTabs } from '@gitlab/ui';
import waitForPromises from 'helpers/wait_for_promises';
import VueApollo from 'vue-apollo'; import VueApollo from 'vue-apollo';
import waitForPromises from 'helpers/wait_for_promises';
import createMockApollo from 'helpers/mock_apollo_helper'; import createMockApollo from 'helpers/mock_apollo_helper';
import httpStatusCodes from '~/lib/utils/http_status'; import httpStatusCodes from '~/lib/utils/http_status';
import { objectToQuery, redirectTo, refreshCurrentPage } from '~/lib/utils/url_utility'; import { objectToQuery, redirectTo, refreshCurrentPage } from '~/lib/utils/url_utility';
import CommitForm from '~/pipeline_editor/components/commit/commit_form.vue';
import getCiConfigData from '~/pipeline_editor/graphql/queries/ci_config.graphql';
import EditorTab from '~/pipeline_editor/components/ui/editor_tab.vue';
import PipelineGraph from '~/pipelines/components/pipeline_graph/pipeline_graph.vue';
import PipelineEditorApp from '~/pipeline_editor/pipeline_editor_app.vue';
import TextEditor from '~/pipeline_editor/components/text_editor.vue';
import { import {
mockCiConfigPath, mockCiConfigPath,
mockCiConfigQueryResponse, mockCiConfigQueryResponse,
...@@ -21,13 +28,6 @@ import { ...@@ -21,13 +28,6 @@ import {
mockNewMergeRequestPath, mockNewMergeRequestPath,
} from './mock_data'; } from './mock_data';
import CommitForm from '~/pipeline_editor/components/commit/commit_form.vue';
import getCiConfigData from '~/pipeline_editor/graphql/queries/ci_config.graphql';
import EditorTab from '~/pipeline_editor/components/ui/editor_tab.vue';
import PipelineGraph from '~/pipelines/components/pipeline_graph/pipeline_graph.vue';
import PipelineEditorApp from '~/pipeline_editor/pipeline_editor_app.vue';
import TextEditor from '~/pipeline_editor/components/text_editor.vue';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(VueApollo); localVue.use(VueApollo);
......
...@@ -5,6 +5,7 @@ import waitForPromises from 'helpers/wait_for_promises'; ...@@ -5,6 +5,7 @@ import waitForPromises from 'helpers/wait_for_promises';
import httpStatusCodes from '~/lib/utils/http_status'; import httpStatusCodes from '~/lib/utils/http_status';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import PipelineNewForm from '~/pipeline_new/components/pipeline_new_form.vue'; import PipelineNewForm from '~/pipeline_new/components/pipeline_new_form.vue';
import { redirectTo } from '~/lib/utils/url_utility';
import { import {
mockBranches, mockBranches,
mockTags, mockTags,
...@@ -13,7 +14,6 @@ import { ...@@ -13,7 +14,6 @@ import {
mockProjectId, mockProjectId,
mockError, mockError,
} from '../mock_data'; } from '../mock_data';
import { redirectTo } from '~/lib/utils/url_utility';
jest.mock('~/lib/utils/url_utility', () => ({ jest.mock('~/lib/utils/url_utility', () => ({
redirectTo: jest.fn(), redirectTo: jest.fn(),
......
...@@ -6,9 +6,9 @@ import PipelineStore from '~/pipelines/stores/pipeline_store'; ...@@ -6,9 +6,9 @@ import PipelineStore from '~/pipelines/stores/pipeline_store';
import GraphComponentLegacy from '~/pipelines/components/graph/graph_component_legacy.vue'; import GraphComponentLegacy from '~/pipelines/components/graph/graph_component_legacy.vue';
import StageColumnComponentLegacy from '~/pipelines/components/graph/stage_column_component_legacy.vue'; import StageColumnComponentLegacy from '~/pipelines/components/graph/stage_column_component_legacy.vue';
import LinkedPipelinesColumnLegacy from '~/pipelines/components/graph/linked_pipelines_column_legacy.vue'; import LinkedPipelinesColumnLegacy from '~/pipelines/components/graph/linked_pipelines_column_legacy.vue';
import PipelinesMediator from '~/pipelines/pipeline_details_mediator';
import graphJSON from './mock_data_legacy'; import graphJSON from './mock_data_legacy';
import linkedPipelineJSON from './linked_pipelines_mock_data'; import linkedPipelineJSON from './linked_pipelines_mock_data';
import PipelinesMediator from '~/pipelines/pipeline_details_mediator';
describe('graph component', () => { describe('graph component', () => {
let store; let store;
......
...@@ -2,8 +2,8 @@ import { mount } from '@vue/test-utils'; ...@@ -2,8 +2,8 @@ import { mount } from '@vue/test-utils';
import { GlButton, GlLoadingIcon } from '@gitlab/ui'; import { GlButton, GlLoadingIcon } from '@gitlab/ui';
import LinkedPipelineComponent from '~/pipelines/components/graph/linked_pipeline.vue'; import LinkedPipelineComponent from '~/pipelines/components/graph/linked_pipeline.vue';
import CiStatus from '~/vue_shared/components/ci_icon.vue'; import CiStatus from '~/vue_shared/components/ci_icon.vue';
import mockData from './linked_pipelines_mock_data';
import { UPSTREAM, DOWNSTREAM } from '~/pipelines/components/graph/constants'; import { UPSTREAM, DOWNSTREAM } from '~/pipelines/components/graph/constants';
import mockData from './linked_pipelines_mock_data';
const mockPipeline = mockData.triggered[0]; const mockPipeline = mockData.triggered[0];
const validTriggeredPipelineId = mockPipeline.project.id; const validTriggeredPipelineId = mockPipeline.project.id;
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlModal, GlLoadingIcon } from '@gitlab/ui'; import { GlModal, GlLoadingIcon } from '@gitlab/ui';
import HeaderComponent from '~/pipelines/components/header_component.vue';
import deletePipelineMutation from '~/pipelines/graphql/mutations/delete_pipeline.mutation.graphql';
import retryPipelineMutation from '~/pipelines/graphql/mutations/retry_pipeline.mutation.graphql';
import cancelPipelineMutation from '~/pipelines/graphql/mutations/cancel_pipeline.mutation.graphql';
import { import {
mockCancelledPipelineHeader, mockCancelledPipelineHeader,
mockFailedPipelineHeader, mockFailedPipelineHeader,
mockRunningPipelineHeader, mockRunningPipelineHeader,
mockSuccessfulPipelineHeader, mockSuccessfulPipelineHeader,
} from './mock_data'; } from './mock_data';
import HeaderComponent from '~/pipelines/components/header_component.vue';
import deletePipelineMutation from '~/pipelines/graphql/mutations/delete_pipeline.mutation.graphql';
import retryPipelineMutation from '~/pipelines/graphql/mutations/retry_pipeline.mutation.graphql';
import cancelPipelineMutation from '~/pipelines/graphql/mutations/cancel_pipeline.mutation.graphql';
describe('Pipeline details header', () => { describe('Pipeline details header', () => {
let wrapper; let wrapper;
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlAlert } from '@gitlab/ui'; import { GlAlert } from '@gitlab/ui';
import { pipelineData, singleStageData } from './mock_data';
import { CI_CONFIG_STATUS_INVALID, CI_CONFIG_STATUS_VALID } from '~/pipeline_editor/constants'; import { CI_CONFIG_STATUS_INVALID, CI_CONFIG_STATUS_VALID } from '~/pipeline_editor/constants';
import { DRAW_FAILURE, EMPTY_PIPELINE_DATA, INVALID_CI_CONFIG } from '~/pipelines/constants'; import { DRAW_FAILURE, EMPTY_PIPELINE_DATA, INVALID_CI_CONFIG } from '~/pipelines/constants';
import PipelineGraph from '~/pipelines/components/pipeline_graph/pipeline_graph.vue'; import PipelineGraph from '~/pipelines/components/pipeline_graph/pipeline_graph.vue';
import StagePill from '~/pipelines/components/pipeline_graph/stage_pill.vue'; import StagePill from '~/pipelines/components/pipeline_graph/stage_pill.vue';
import JobPill from '~/pipelines/components/pipeline_graph/job_pill.vue'; import JobPill from '~/pipelines/components/pipeline_graph/job_pill.vue';
import { pipelineData, singleStageData } from './mock_data';
describe('pipeline graph component', () => { describe('pipeline graph component', () => {
const defaultProps = { pipelineData }; const defaultProps = { pipelineData };
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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