Commit ebc27391 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch '339346-change-get-json-7b3eade53bd' into 'master'

Use import for json fixture - 4/7

See merge request gitlab-org/gitlab!71901
parents 10329c86 b6dbfc3d
...@@ -11,7 +11,7 @@ import produce from 'immer'; ...@@ -11,7 +11,7 @@ import produce from 'immer';
import Vue from 'vue'; import Vue from 'vue';
import VueApollo from 'vue-apollo'; import VueApollo from 'vue-apollo';
import { getJSONFixture } from 'helpers/fixtures'; import getProjectsQueryResponse from 'test_fixtures/graphql/projects/access_tokens/get_projects.query.graphql.json';
import createMockApollo from 'helpers/mock_apollo_helper'; import createMockApollo from 'helpers/mock_apollo_helper';
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';
...@@ -20,9 +20,6 @@ import getProjectsQuery from '~/access_tokens/graphql/queries/get_projects.query ...@@ -20,9 +20,6 @@ import getProjectsQuery from '~/access_tokens/graphql/queries/get_projects.query
import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import { getIdFromGraphQLId } from '~/graphql_shared/utils';
describe('ProjectsTokenSelector', () => { describe('ProjectsTokenSelector', () => {
const getProjectsQueryResponse = getJSONFixture(
'graphql/projects/access_tokens/get_projects.query.graphql.json',
);
const getProjectsQueryResponsePage2 = produce( const getProjectsQueryResponsePage2 = produce(
getProjectsQueryResponse, getProjectsQueryResponse,
(getProjectsQueryResponseDraft) => { (getProjectsQueryResponseDraft) => {
......
import { GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import data from 'test_fixtures/deploy_keys/keys.json';
import actionBtn from '~/deploy_keys/components/action_btn.vue'; import actionBtn from '~/deploy_keys/components/action_btn.vue';
import eventHub from '~/deploy_keys/eventhub'; import eventHub from '~/deploy_keys/eventhub';
describe('Deploy keys action btn', () => { describe('Deploy keys action btn', () => {
const data = getJSONFixture('deploy_keys/keys.json');
const deployKey = data.enabled_keys[0]; const deployKey = data.enabled_keys[0];
let wrapper; let wrapper;
......
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import data from 'test_fixtures/deploy_keys/keys.json';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import { TEST_HOST } from 'spec/test_constants'; import { TEST_HOST } from 'spec/test_constants';
import deployKeysApp from '~/deploy_keys/components/app.vue'; import deployKeysApp from '~/deploy_keys/components/app.vue';
...@@ -10,7 +11,6 @@ import axios from '~/lib/utils/axios_utils'; ...@@ -10,7 +11,6 @@ import axios from '~/lib/utils/axios_utils';
const TEST_ENDPOINT = `${TEST_HOST}/dummy/`; const TEST_ENDPOINT = `${TEST_HOST}/dummy/`;
describe('Deploy keys app component', () => { describe('Deploy keys app component', () => {
const data = getJSONFixture('deploy_keys/keys.json');
let wrapper; let wrapper;
let mock; let mock;
......
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import data from 'test_fixtures/deploy_keys/keys.json';
import key from '~/deploy_keys/components/key.vue'; import key from '~/deploy_keys/components/key.vue';
import DeployKeysStore from '~/deploy_keys/store'; import DeployKeysStore from '~/deploy_keys/store';
import { getTimeago } from '~/lib/utils/datetime_utility'; import { getTimeago } from '~/lib/utils/datetime_utility';
...@@ -7,8 +8,6 @@ describe('Deploy keys key', () => { ...@@ -7,8 +8,6 @@ describe('Deploy keys key', () => {
let wrapper; let wrapper;
let store; let store;
const data = getJSONFixture('deploy_keys/keys.json');
const findTextAndTrim = (selector) => wrapper.find(selector).text().trim(); const findTextAndTrim = (selector) => wrapper.find(selector).text().trim();
const createComponent = (propsData) => { const createComponent = (propsData) => {
......
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import data from 'test_fixtures/deploy_keys/keys.json';
import deployKeysPanel from '~/deploy_keys/components/keys_panel.vue'; import deployKeysPanel from '~/deploy_keys/components/keys_panel.vue';
import DeployKeysStore from '~/deploy_keys/store'; import DeployKeysStore from '~/deploy_keys/store';
describe('Deploy keys panel', () => { describe('Deploy keys panel', () => {
const data = getJSONFixture('deploy_keys/keys.json');
let wrapper; let wrapper;
const findTableRowHeader = () => wrapper.find('.table-row-header'); const findTableRowHeader = () => wrapper.find('.table-row-header');
......
const FIXTURE = 'merge_request_diffs/with_commit.json'; import fixture from 'test_fixtures/merge_request_diffs/with_commit.json';
export default function getDiffWithCommit() { export default function getDiffWithCommit() {
return getJSONFixture(FIXTURE); return fixture;
} }
import { escape } from 'lodash'; import { escape } from 'lodash';
import labelData from 'test_fixtures/labels/project_labels.json';
import FilteredSearchSpecHelper from 'helpers/filtered_search_spec_helper'; import FilteredSearchSpecHelper from 'helpers/filtered_search_spec_helper';
import { TEST_HOST } from 'helpers/test_constants'; import { TEST_HOST } from 'helpers/test_constants';
import DropdownUtils from '~/filtered_search/dropdown_utils'; import DropdownUtils from '~/filtered_search/dropdown_utils';
...@@ -132,15 +133,8 @@ describe('Filtered Search Visual Tokens', () => { ...@@ -132,15 +133,8 @@ describe('Filtered Search Visual Tokens', () => {
}); });
describe('updateLabelTokenColor', () => { describe('updateLabelTokenColor', () => {
const jsonFixtureName = 'labels/project_labels.json';
const dummyEndpoint = '/dummy/endpoint'; const dummyEndpoint = '/dummy/endpoint';
let labelData;
beforeAll(() => {
labelData = getJSONFixture(jsonFixtureName);
});
const missingLabelToken = FilteredSearchSpecHelper.createFilterVisualToken( const missingLabelToken = FilteredSearchSpecHelper.createFilterVisualToken(
'label', 'label',
'=', '=',
......
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