Commit acd5fbf6 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'remove-preload-fixtures-from-jest-specs' into 'master'

[RUN-AS-IF-FOSS] Remove "preloadFixtures" and "loadJSONFixtures" from jest specs

See merge request gitlab-org/gitlab!55590
parents a9f10f16 8af3ca9d
describe('Sidebar', () => { describe('Sidebar', () => {
preloadFixtures('issues/open-issue.html');
beforeEach(() => loadFixtures('issues/open-issue.html')); beforeEach(() => loadFixtures('issues/open-issue.html'));
it('does not have a max select', () => { it('does not have a max select', () => {
......
...@@ -19,7 +19,6 @@ jest.mock('ee/saml_providers/scim_token_service', () => { ...@@ -19,7 +19,6 @@ jest.mock('ee/saml_providers/scim_token_service', () => {
describe('SCIMTokenToggleArea', () => { describe('SCIMTokenToggleArea', () => {
const FIXTURE = 'groups/saml_providers/show.html'; const FIXTURE = 'groups/saml_providers/show.html';
let scimTokenToggleArea; let scimTokenToggleArea;
preloadFixtures(FIXTURE);
beforeEach(() => { beforeEach(() => {
loadFixtures(FIXTURE); loadFixtures(FIXTURE);
......
...@@ -5,8 +5,6 @@ const ceFixture = 'search/blob_search_result.html'; ...@@ -5,8 +5,6 @@ const ceFixture = 'search/blob_search_result.html';
const searchKeyword = 'Send'; // spec/frontend/fixtures/search.rb#79 const searchKeyword = 'Send'; // spec/frontend/fixtures/search.rb#79
describe('ee/search/highlight_blob_search_result', () => { describe('ee/search/highlight_blob_search_result', () => {
preloadFixtures(fixture, ceFixture);
// Basic search support // Basic search support
it('highlights lines with search term occurrence', () => { it('highlights lines with search term occurrence', () => {
loadFixtures(ceFixture); loadFixtures(ceFixture);
......
...@@ -14,7 +14,6 @@ settings: ...@@ -14,7 +14,6 @@ settings:
globals: globals:
getJSONFixture: false getJSONFixture: false
loadFixtures: false loadFixtures: false
preloadFixtures: false
setFixtures: false setFixtures: false
rules: rules:
jest/expect-expect: jest/expect-expect:
......
...@@ -8,8 +8,6 @@ describe('U2FAuthenticate', () => { ...@@ -8,8 +8,6 @@ describe('U2FAuthenticate', () => {
let container; let container;
let component; let component;
preloadFixtures('u2f/authenticate.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('u2f/authenticate.html'); loadFixtures('u2f/authenticate.html');
u2fDevice = new MockU2FDevice(); u2fDevice = new MockU2FDevice();
......
...@@ -8,8 +8,6 @@ describe('U2FRegister', () => { ...@@ -8,8 +8,6 @@ describe('U2FRegister', () => {
let container; let container;
let component; let component;
preloadFixtures('u2f/register.html');
beforeEach((done) => { beforeEach((done) => {
loadFixtures('u2f/register.html'); loadFixtures('u2f/register.html');
u2fDevice = new MockU2FDevice(); u2fDevice = new MockU2FDevice();
......
...@@ -13,7 +13,6 @@ const mockResponse = { ...@@ -13,7 +13,6 @@ const mockResponse = {
}; };
describe('WebAuthnAuthenticate', () => { describe('WebAuthnAuthenticate', () => {
preloadFixtures('webauthn/authenticate.html');
useMockNavigatorCredentials(); useMockNavigatorCredentials();
let fallbackElement; let fallbackElement;
......
...@@ -5,7 +5,6 @@ import MockWebAuthnDevice from './mock_webauthn_device'; ...@@ -5,7 +5,6 @@ import MockWebAuthnDevice from './mock_webauthn_device';
import { useMockNavigatorCredentials } from './util'; import { useMockNavigatorCredentials } from './util';
describe('WebAuthnRegister', () => { describe('WebAuthnRegister', () => {
preloadFixtures('webauthn/register.html');
useMockNavigatorCredentials(); useMockNavigatorCredentials();
const mockResponse = { const mockResponse = {
......
...@@ -60,7 +60,6 @@ describe('AwardsHandler', () => { ...@@ -60,7 +60,6 @@ describe('AwardsHandler', () => {
u: '6.0', u: '6.0',
}, },
}; };
preloadFixtures('snippets/show.html');
const openAndWaitForEmojiMenu = (sel = '.js-add-award') => { const openAndWaitForEmojiMenu = (sel = '.js-add-award') => {
$(sel).eq(0).click(); $(sel).eq(0).click();
......
...@@ -6,8 +6,6 @@ describe('Quick Submit behavior', () => { ...@@ -6,8 +6,6 @@ describe('Quick Submit behavior', () => {
const keydownEvent = (options = { keyCode: 13, metaKey: true }) => $.Event('keydown', options); const keydownEvent = (options = { keyCode: 13, metaKey: true }) => $.Event('keydown', options);
preloadFixtures('snippets/show.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('snippets/show.html'); loadFixtures('snippets/show.html');
......
...@@ -3,7 +3,6 @@ import '~/behaviors/requires_input'; ...@@ -3,7 +3,6 @@ import '~/behaviors/requires_input';
describe('requiresInput', () => { describe('requiresInput', () => {
let submitButton; let submitButton;
preloadFixtures('branches/new_branch.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('branches/new_branch.html'); loadFixtures('branches/new_branch.html');
......
...@@ -13,8 +13,6 @@ describe('ShortcutsIssuable', () => { ...@@ -13,8 +13,6 @@ describe('ShortcutsIssuable', () => {
const snippetShowFixtureName = 'snippets/show.html'; const snippetShowFixtureName = 'snippets/show.html';
const mrShowFixtureName = 'merge_requests/merge_request_of_current_user.html'; const mrShowFixtureName = 'merge_requests/merge_request_of_current_user.html';
preloadFixtures(snippetShowFixtureName, mrShowFixtureName);
beforeAll((done) => { beforeAll((done) => {
initCopyAsGFM(); initCopyAsGFM();
......
...@@ -7,7 +7,6 @@ jest.mock('~/projects/upload_file_experiment', () => ({ ...@@ -7,7 +7,6 @@ jest.mock('~/projects/upload_file_experiment', () => ({
})); }));
describe('BlobFileDropzone', () => { describe('BlobFileDropzone', () => {
preloadFixtures('blob/show.html');
let dropzone; let dropzone;
let replaceFileButton; let replaceFileButton;
......
...@@ -4,8 +4,6 @@ import SketchLoader from '~/blob/sketch'; ...@@ -4,8 +4,6 @@ import SketchLoader from '~/blob/sketch';
jest.mock('jszip'); jest.mock('jszip');
describe('Sketch viewer', () => { describe('Sketch viewer', () => {
preloadFixtures('static/sketch_viewer.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('static/sketch_viewer.html'); loadFixtures('static/sketch_viewer.html');
}); });
......
...@@ -16,8 +16,6 @@ describe('Blob viewer', () => { ...@@ -16,8 +16,6 @@ describe('Blob viewer', () => {
setTestTimeout(2000); setTestTimeout(2000);
preloadFixtures('blob/show_readme.html');
beforeEach(() => { beforeEach(() => {
$.fn.extend(jQueryMock); $.fn.extend(jQueryMock);
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
......
import LinkedTabs from '~/lib/utils/bootstrap_linked_tabs'; import LinkedTabs from '~/lib/utils/bootstrap_linked_tabs';
describe('Linked Tabs', () => { describe('Linked Tabs', () => {
preloadFixtures('static/linked_tabs.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('static/linked_tabs.html'); loadFixtures('static/linked_tabs.html');
}); });
......
...@@ -4,9 +4,6 @@ import VariableList from '~/ci_variable_list/ci_variable_list'; ...@@ -4,9 +4,6 @@ import VariableList from '~/ci_variable_list/ci_variable_list';
const HIDE_CLASS = 'hide'; const HIDE_CLASS = 'hide';
describe('VariableList', () => { describe('VariableList', () => {
preloadFixtures('pipeline_schedules/edit.html');
preloadFixtures('pipeline_schedules/edit_with_variables.html');
let $wrapper; let $wrapper;
let variableList; let variableList;
......
...@@ -2,8 +2,6 @@ import $ from 'jquery'; ...@@ -2,8 +2,6 @@ import $ from 'jquery';
import setupNativeFormVariableList from '~/ci_variable_list/native_form_variable_list'; import setupNativeFormVariableList from '~/ci_variable_list/native_form_variable_list';
describe('NativeFormVariableList', () => { describe('NativeFormVariableList', () => {
preloadFixtures('pipeline_schedules/edit.html');
let $wrapper; let $wrapper;
beforeEach(() => { beforeEach(() => {
......
...@@ -14,9 +14,6 @@ describe('Issuable right sidebar collapsed todo toggle', () => { ...@@ -14,9 +14,6 @@ describe('Issuable right sidebar collapsed todo toggle', () => {
const jsonFixtureName = 'todos/todos.json'; const jsonFixtureName = 'todos/todos.json';
let mock; let mock;
preloadFixtures(fixtureName);
preloadFixtures(jsonFixtureName);
beforeEach(() => { beforeEach(() => {
const todoData = getJSONFixture(jsonFixtureName); const todoData = getJSONFixture(jsonFixtureName);
new Sidebar(); new Sidebar();
......
...@@ -17,8 +17,6 @@ describe('Pipelines table in Commits and Merge requests', () => { ...@@ -17,8 +17,6 @@ describe('Pipelines table in Commits and Merge requests', () => {
errorStateSvgPath: 'foo', errorStateSvgPath: 'foo',
}; };
preloadFixtures(jsonFixtureName);
const findRunPipelineBtn = () => vm.$el.querySelector('[data-testid="run_pipeline_button"]'); const findRunPipelineBtn = () => vm.$el.querySelector('[data-testid="run_pipeline_button"]');
const findRunPipelineBtnMobile = () => const findRunPipelineBtnMobile = () =>
vm.$el.querySelector('[data-testid="run_pipeline_button_mobile"]'); vm.$el.querySelector('[data-testid="run_pipeline_button_mobile"]');
......
...@@ -20,8 +20,6 @@ const DROPDOWN_ITEM_DATA = [ ...@@ -20,8 +20,6 @@ const DROPDOWN_ITEM_DATA = [
]; ];
describe('CreateItemDropdown', () => { describe('CreateItemDropdown', () => {
preloadFixtures('static/create_item_dropdown.html');
let $wrapperEl; let $wrapperEl;
let createItemDropdown; let createItemDropdown;
......
...@@ -10,8 +10,6 @@ jest.mock('~/lib/utils/url_utility', () => ({ ...@@ -10,8 +10,6 @@ jest.mock('~/lib/utils/url_utility', () => ({
})); }));
describe('deprecatedJQueryDropdown', () => { describe('deprecatedJQueryDropdown', () => {
preloadFixtures('static/deprecated_jquery_dropdown.html');
const NON_SELECTABLE_CLASSES = const NON_SELECTABLE_CLASSES =
'.divider, .separator, .dropdown-header, .dropdown-menu-empty-item'; '.divider, .separator, .dropdown-header, .dropdown-menu-empty-item';
const SEARCH_INPUT_SELECTOR = '.dropdown-input-field'; const SEARCH_INPUT_SELECTOR = '.dropdown-input-field';
......
const FIXTURE = 'merge_request_diffs/with_commit.json'; const FIXTURE = 'merge_request_diffs/with_commit.json';
preloadFixtures(FIXTURE);
export default function getDiffWithCommit() { export default function getDiffWithCommit() {
return getJSONFixture(FIXTURE); return getJSONFixture(FIXTURE);
} }
...@@ -78,7 +78,6 @@ describe('Dropdown User', () => { ...@@ -78,7 +78,6 @@ describe('Dropdown User', () => {
describe('hideCurrentUser', () => { describe('hideCurrentUser', () => {
const fixtureTemplate = 'issues/issue_list.html'; const fixtureTemplate = 'issues/issue_list.html';
preloadFixtures(fixtureTemplate);
let dropdown; let dropdown;
let authorFilterDropdownElement; let authorFilterDropdownElement;
......
...@@ -5,7 +5,6 @@ import IssuableFilteredSearchTokenKeys from '~/filtered_search/issuable_filtered ...@@ -5,7 +5,6 @@ import IssuableFilteredSearchTokenKeys from '~/filtered_search/issuable_filtered
describe('Dropdown Utils', () => { describe('Dropdown Utils', () => {
const issueListFixture = 'issues/issue_list.html'; const issueListFixture = 'issues/issue_list.html';
preloadFixtures(issueListFixture);
describe('getEscapedText', () => { describe('getEscapedText', () => {
it('should return same word when it has no space', () => { it('should return same word when it has no space', () => {
......
...@@ -133,8 +133,6 @@ describe('Filtered Search Visual Tokens', () => { ...@@ -133,8 +133,6 @@ describe('Filtered Search Visual Tokens', () => {
const jsonFixtureName = 'labels/project_labels.json'; const jsonFixtureName = 'labels/project_labels.json';
const dummyEndpoint = '/dummy/endpoint'; const dummyEndpoint = '/dummy/endpoint';
preloadFixtures(jsonFixtureName);
let labelData; let labelData;
beforeAll(() => { beforeAll(() => {
......
...@@ -8,8 +8,6 @@ describe('GL Style Field Errors', () => { ...@@ -8,8 +8,6 @@ describe('GL Style Field Errors', () => {
testContext = {}; testContext = {};
}); });
preloadFixtures('static/gl_field_errors.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('static/gl_field_errors.html'); loadFixtures('static/gl_field_errors.html');
const $form = $('form.gl-show-field-errors'); const $form = $('form.gl-show-field-errors');
......
...@@ -15,7 +15,6 @@ describe('Header', () => { ...@@ -15,7 +15,6 @@ describe('Header', () => {
$(document).trigger('todo:toggle', newCount); $(document).trigger('todo:toggle', newCount);
} }
preloadFixtures(fixtureTemplate);
beforeEach(() => { beforeEach(() => {
initTodoToggle(); initTodoToggle();
loadFixtures(fixtureTemplate); loadFixtures(fixtureTemplate);
......
...@@ -7,7 +7,6 @@ jest.mock('~/vue_shared/plugins/global_toast'); ...@@ -7,7 +7,6 @@ jest.mock('~/vue_shared/plugins/global_toast');
describe('IntegrationSettingsForm', () => { describe('IntegrationSettingsForm', () => {
const FIXTURE = 'services/edit_service.html'; const FIXTURE = 'services/edit_service.html';
preloadFixtures(FIXTURE);
beforeEach(() => { beforeEach(() => {
loadFixtures(FIXTURE); loadFixtures(FIXTURE);
......
...@@ -8,11 +8,6 @@ describe('Issue', () => { ...@@ -8,11 +8,6 @@ describe('Issue', () => {
let testContext; let testContext;
let mock; let mock;
beforeAll(() => {
preloadFixtures('issues/closed-issue.html');
preloadFixtures('issues/open-issue.html');
});
beforeEach(() => { beforeEach(() => {
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
mock.onGet(/(.*)\/related_branches$/).reply(200, {}); mock.onGet(/(.*)\/related_branches$/).reply(200, {});
......
...@@ -7,7 +7,6 @@ import LineHighlighter from '~/line_highlighter'; ...@@ -7,7 +7,6 @@ import LineHighlighter from '~/line_highlighter';
describe('LineHighlighter', () => { describe('LineHighlighter', () => {
const testContext = {}; const testContext = {};
preloadFixtures('static/line_highlighter.html');
const clickLine = (number, eventData = {}) => { const clickLine = (number, eventData = {}) => {
if ($.isEmptyObject(eventData)) { if ($.isEmptyObject(eventData)) {
return $(`#L${number}`).click(); return $(`#L${number}`).click();
......
...@@ -9,7 +9,6 @@ describe('MergeRequest', () => { ...@@ -9,7 +9,6 @@ describe('MergeRequest', () => {
describe('task lists', () => { describe('task lists', () => {
let mock; let mock;
preloadFixtures('merge_requests/merge_request_with_task_list.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('merge_requests/merge_request_with_task_list.html'); loadFixtures('merge_requests/merge_request_with_task_list.html');
......
...@@ -21,11 +21,6 @@ describe('MergeRequestTabs', () => { ...@@ -21,11 +21,6 @@ describe('MergeRequestTabs', () => {
$.extend(stubLocation, defaults, stubs || {}); $.extend(stubLocation, defaults, stubs || {});
}; };
preloadFixtures(
'merge_requests/merge_request_with_task_list.html',
'merge_requests/diff_comment.html',
);
beforeEach(() => { beforeEach(() => {
initMrPage(); initMrPage();
......
...@@ -5,8 +5,6 @@ import axios from '~/lib/utils/axios_utils'; ...@@ -5,8 +5,6 @@ import axios from '~/lib/utils/axios_utils';
import MiniPipelineGraph from '~/mini_pipeline_graph_dropdown'; import MiniPipelineGraph from '~/mini_pipeline_graph_dropdown';
describe('Mini Pipeline Graph Dropdown', () => { describe('Mini Pipeline Graph Dropdown', () => {
preloadFixtures('static/mini_dropdown_graph.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('static/mini_dropdown_graph.html'); loadFixtures('static/mini_dropdown_graph.html');
}); });
......
...@@ -9,8 +9,6 @@ describe('Branch', () => { ...@@ -9,8 +9,6 @@ describe('Branch', () => {
}); });
describe('create a new branch', () => { describe('create a new branch', () => {
preloadFixtures('branches/new_branch.html');
function fillNameWith(value) { function fillNameWith(value) {
$('.js-branch-name').val(value).trigger('blur'); $('.js-branch-name').val(value).trigger('blur');
} }
......
...@@ -6,14 +6,10 @@ import createStore from '~/notes/stores'; ...@@ -6,14 +6,10 @@ import createStore from '~/notes/stores';
import mockDiffFile from '../../diffs/mock_data/diff_discussions'; import mockDiffFile from '../../diffs/mock_data/diff_discussions';
import { discussionMock } from '../mock_data'; import { discussionMock } from '../mock_data';
const discussionWithTwoUnresolvedNotes = 'merge_requests/resolved_diff_discussion.json';
describe('diff_discussion_header component', () => { describe('diff_discussion_header component', () => {
let store; let store;
let wrapper; let wrapper;
preloadFixtures(discussionWithTwoUnresolvedNotes);
beforeEach(() => { beforeEach(() => {
window.mrTabs = {}; window.mrTabs = {};
store = createStore(); store = createStore();
......
...@@ -24,8 +24,6 @@ describe('noteable_discussion component', () => { ...@@ -24,8 +24,6 @@ describe('noteable_discussion component', () => {
let wrapper; let wrapper;
let originalGon; let originalGon;
preloadFixtures(discussionWithTwoUnresolvedNotes);
beforeEach(() => { beforeEach(() => {
window.mrTabs = {}; window.mrTabs = {};
store = createStore(); store = createStore();
......
...@@ -26,8 +26,6 @@ const createDiscussionNeighborParams = (discussionId, diffOrder, step) => ({ ...@@ -26,8 +26,6 @@ const createDiscussionNeighborParams = (discussionId, diffOrder, step) => ({
describe('Getters Notes Store', () => { describe('Getters Notes Store', () => {
let state; let state;
preloadFixtures(discussionWithTwoUnresolvedNotes);
beforeEach(() => { beforeEach(() => {
state = { state = {
discussions: [individualNote], discussions: [individualNote],
......
...@@ -6,8 +6,6 @@ describe('OAuthRememberMe', () => { ...@@ -6,8 +6,6 @@ describe('OAuthRememberMe', () => {
return $(`#oauth-container .oauth-login${selector}`).parent('form').attr('action'); return $(`#oauth-container .oauth-login${selector}`).parent('form').attr('action');
}; };
preloadFixtures('static/oauth_remember_me.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('static/oauth_remember_me.html'); loadFixtures('static/oauth_remember_me.html');
......
...@@ -14,8 +14,6 @@ describe('Abuse Reports', () => { ...@@ -14,8 +14,6 @@ describe('Abuse Reports', () => {
const findMessage = (searchText) => const findMessage = (searchText) =>
$messages.filter((index, element) => element.innerText.indexOf(searchText) > -1).first(); $messages.filter((index, element) => element.innerText.indexOf(searchText) > -1).first();
preloadFixtures(FIXTURE);
beforeEach(() => { beforeEach(() => {
loadFixtures(FIXTURE); loadFixtures(FIXTURE);
new AbuseReports(); // eslint-disable-line no-new new AbuseReports(); // eslint-disable-line no-new
......
...@@ -8,7 +8,6 @@ describe('AccountAndLimits', () => { ...@@ -8,7 +8,6 @@ describe('AccountAndLimits', () => {
const FIXTURE = 'application_settings/accounts_and_limit.html'; const FIXTURE = 'application_settings/accounts_and_limit.html';
let $userDefaultExternal; let $userDefaultExternal;
let $userInternalRegex; let $userInternalRegex;
preloadFixtures(FIXTURE);
beforeEach(() => { beforeEach(() => {
loadFixtures(FIXTURE); loadFixtures(FIXTURE);
......
...@@ -7,8 +7,6 @@ describe('UserInternalRegexHandler', () => { ...@@ -7,8 +7,6 @@ describe('UserInternalRegexHandler', () => {
let $userEmail; let $userEmail;
let $warningMessage; let $warningMessage;
preloadFixtures(FIXTURE);
beforeEach(() => { beforeEach(() => {
loadFixtures(FIXTURE); loadFixtures(FIXTURE);
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
......
...@@ -14,7 +14,6 @@ const TEST_COUNT_BIG = 2000; ...@@ -14,7 +14,6 @@ const TEST_COUNT_BIG = 2000;
const TEST_DONE_COUNT_BIG = 7300; const TEST_DONE_COUNT_BIG = 7300;
describe('Todos', () => { describe('Todos', () => {
preloadFixtures('todos/todos.html');
let todoItem; let todoItem;
let mock; let mock;
......
...@@ -6,8 +6,6 @@ import TimezoneDropdown, { ...@@ -6,8 +6,6 @@ import TimezoneDropdown, {
} from '~/pages/projects/pipeline_schedules/shared/components/timezone_dropdown'; } from '~/pages/projects/pipeline_schedules/shared/components/timezone_dropdown';
describe('Timezone Dropdown', () => { describe('Timezone Dropdown', () => {
preloadFixtures('pipeline_schedules/edit.html');
let $inputEl = null; let $inputEl = null;
let $dropdownEl = null; let $dropdownEl = null;
let $wrapper = null; let $wrapper = null;
......
...@@ -6,8 +6,6 @@ describe('preserve_url_fragment', () => { ...@@ -6,8 +6,6 @@ describe('preserve_url_fragment', () => {
return $(`.omniauth-container ${selector}`).parent('form').attr('action'); return $(`.omniauth-container ${selector}`).parent('form').attr('action');
}; };
preloadFixtures('sessions/new.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('sessions/new.html'); loadFixtures('sessions/new.html');
}); });
......
...@@ -18,8 +18,6 @@ describe('SigninTabsMemoizer', () => { ...@@ -18,8 +18,6 @@ describe('SigninTabsMemoizer', () => {
return memo; return memo;
} }
preloadFixtures(fixtureTemplate);
beforeEach(() => { beforeEach(() => {
loadFixtures(fixtureTemplate); loadFixtures(fixtureTemplate);
......
...@@ -19,8 +19,6 @@ describe('Pipelines Table Row', () => { ...@@ -19,8 +19,6 @@ describe('Pipelines Table Row', () => {
let pipelineWithoutAuthor; let pipelineWithoutAuthor;
let pipelineWithoutCommit; let pipelineWithoutCommit;
preloadFixtures(jsonFixtureName);
beforeEach(() => { beforeEach(() => {
const { pipelines } = getJSONFixture(jsonFixtureName); const { pipelines } = getJSONFixture(jsonFixtureName);
......
...@@ -52,8 +52,6 @@ describe('Pipelines Table', () => { ...@@ -52,8 +52,6 @@ describe('Pipelines Table', () => {
const findTimeAgoTh = () => wrapper.findByTestId('timeago-th'); const findTimeAgoTh = () => wrapper.findByTestId('timeago-th');
const findActionsTh = () => wrapper.findByTestId('actions-th'); const findActionsTh = () => wrapper.findByTestId('actions-th');
preloadFixtures(jsonFixtureName);
beforeEach(() => { beforeEach(() => {
const { pipelines } = getJSONFixture(jsonFixtureName); const { pipelines } = getJSONFixture(jsonFixtureName);
pipeline = pipelines.find((p) => p.user !== null && p.commit !== null); pipeline = pipelines.find((p) => p.user !== null && p.commit !== null);
......
import Pipelines from '~/pipelines'; import Pipelines from '~/pipelines';
describe('Pipelines', () => { describe('Pipelines', () => {
preloadFixtures('static/pipeline_graph.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('static/pipeline_graph.html'); loadFixtures('static/pipeline_graph.html');
}); });
......
...@@ -10,8 +10,6 @@ describe('Project Select Combo Button', () => { ...@@ -10,8 +10,6 @@ describe('Project Select Combo Button', () => {
testContext = {}; testContext = {};
}); });
preloadFixtures(fixturePath);
beforeEach(() => { beforeEach(() => {
testContext.defaults = { testContext.defaults = {
label: 'Select project to create issue', label: 'Select project to create issue',
......
...@@ -9,7 +9,6 @@ describe('PrometheusMetrics', () => { ...@@ -9,7 +9,6 @@ describe('PrometheusMetrics', () => {
const customMetricsEndpoint = const customMetricsEndpoint =
'http://test.host/frontend-fixtures/services-project/prometheus/metrics'; 'http://test.host/frontend-fixtures/services-project/prometheus/metrics';
let mock; let mock;
preloadFixtures(FIXTURE);
beforeEach(() => { beforeEach(() => {
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
......
...@@ -6,7 +6,6 @@ import { metrics2 as metrics, missingVarMetrics } from './mock_data'; ...@@ -6,7 +6,6 @@ import { metrics2 as metrics, missingVarMetrics } from './mock_data';
describe('PrometheusMetrics', () => { describe('PrometheusMetrics', () => {
const FIXTURE = 'services/prometheus/prometheus_service.html'; const FIXTURE = 'services/prometheus/prometheus_service.html';
preloadFixtures(FIXTURE);
beforeEach(() => { beforeEach(() => {
loadFixtures(FIXTURE); loadFixtures(FIXTURE);
......
...@@ -3,8 +3,6 @@ import initReadMore from '~/read_more'; ...@@ -3,8 +3,6 @@ import initReadMore from '~/read_more';
describe('Read more click-to-expand functionality', () => { describe('Read more click-to-expand functionality', () => {
const fixtureName = 'projects/overview.html'; const fixtureName = 'projects/overview.html';
preloadFixtures(fixtureName);
beforeEach(() => { beforeEach(() => {
loadFixtures(fixtureName); loadFixtures(fixtureName);
}); });
......
...@@ -27,7 +27,6 @@ const assertSidebarState = (state) => { ...@@ -27,7 +27,6 @@ const assertSidebarState = (state) => {
describe('RightSidebar', () => { describe('RightSidebar', () => {
describe('fixture tests', () => { describe('fixture tests', () => {
const fixtureName = 'issues/open-issue.html'; const fixtureName = 'issues/open-issue.html';
preloadFixtures(fixtureName);
let mock; let mock;
beforeEach(() => { beforeEach(() => {
......
...@@ -4,8 +4,6 @@ const fixture = 'search/blob_search_result.html'; ...@@ -4,8 +4,6 @@ const fixture = 'search/blob_search_result.html';
const searchKeyword = 'Send'; // spec/frontend/fixtures/search.rb#79 const searchKeyword = 'Send'; // spec/frontend/fixtures/search.rb#79
describe('search/highlight_blob_search_result', () => { describe('search/highlight_blob_search_result', () => {
preloadFixtures(fixture);
beforeEach(() => loadFixtures(fixture)); beforeEach(() => loadFixtures(fixture));
it('highlights lines with search term occurrence', () => { it('highlights lines with search term occurrence', () => {
......
...@@ -105,7 +105,6 @@ describe('Search autocomplete dropdown', () => { ...@@ -105,7 +105,6 @@ describe('Search autocomplete dropdown', () => {
expect(list.find(mrsIHaveCreatedLink).text()).toBe("Merge requests I've created"); expect(list.find(mrsIHaveCreatedLink).text()).toBe("Merge requests I've created");
}; };
preloadFixtures('static/search_autocomplete.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('static/search_autocomplete.html'); loadFixtures('static/search_autocomplete.html');
......
...@@ -2,8 +2,6 @@ import $ from 'jquery'; ...@@ -2,8 +2,6 @@ import $ from 'jquery';
import initSettingsPanels, { isExpanded } from '~/settings_panels'; import initSettingsPanels, { isExpanded } from '~/settings_panels';
describe('Settings Panels', () => { describe('Settings Panels', () => {
preloadFixtures('groups/edit.html');
beforeEach(() => { beforeEach(() => {
loadFixtures('groups/edit.html'); loadFixtures('groups/edit.html');
}); });
......
...@@ -20,8 +20,6 @@ describe('Shortcuts', () => { ...@@ -20,8 +20,6 @@ describe('Shortcuts', () => {
target, target,
}); });
preloadFixtures(fixtureName);
beforeEach(() => { beforeEach(() => {
loadFixtures(fixtureName); loadFixtures(fixtureName);
......
...@@ -44,11 +44,6 @@ Object.assign(global, { ...@@ -44,11 +44,6 @@ Object.assign(global, {
getJSONFixture, getJSONFixture,
loadFixtures: loadHTMLFixture, loadFixtures: loadHTMLFixture,
setFixtures: setHTMLFixture, setFixtures: setHTMLFixture,
// The following functions fill the fixtures cache in Karma.
// This is not necessary in Jest because we make no Ajax request.
loadJSONFixtures() {},
preloadFixtures() {},
}); });
// custom-jquery-matchers was written for an old Jest version, we need to make it compatible // custom-jquery-matchers was written for an old Jest version, we need to make it compatible
......
...@@ -3,7 +3,6 @@ import initUserPopovers from '~/user_popovers'; ...@@ -3,7 +3,6 @@ import initUserPopovers from '~/user_popovers';
describe('User Popovers', () => { describe('User Popovers', () => {
const fixtureTemplate = 'merge_requests/merge_request_with_mentions.html'; const fixtureTemplate = 'merge_requests/merge_request_with_mentions.html';
preloadFixtures(fixtureTemplate);
const selector = '.js-user-link, .gfm-project_member'; const selector = '.js-user-link, .gfm-project_member';
const findFixtureLinks = () => { const findFixtureLinks = () => {
......
...@@ -18,7 +18,6 @@ const DEFAULT_PROPS = { ...@@ -18,7 +18,6 @@ const DEFAULT_PROPS = {
describe('User Popover Component', () => { describe('User Popover Component', () => {
const fixtureTemplate = 'merge_requests/diff_comment.html'; const fixtureTemplate = 'merge_requests/diff_comment.html';
preloadFixtures(fixtureTemplate);
let wrapper; let wrapper;
......
...@@ -13,8 +13,6 @@ describe('ZenMode', () => { ...@@ -13,8 +13,6 @@ describe('ZenMode', () => {
let dropzoneForElementSpy; let dropzoneForElementSpy;
const fixtureName = 'snippets/show.html'; const fixtureName = 'snippets/show.html';
preloadFixtures(fixtureName);
function enterZen() { function enterZen() {
$('.notes-form .js-zen-enter').click(); $('.notes-form .js-zen-enter').click();
} }
......
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