Commit 283f968e authored by Mike Greiling's avatar Mike Greiling

update frontend specs to use ES module syntax

parent 6c695c52
require('~/lib/utils/text_utility'); import '~/lib/utils/text_utility';
require('~/abuse_reports'); import '~/abuse_reports';
((global) => { ((global) => {
describe('Abuse Reports', () => { describe('Abuse Reports', () => {
......
/* eslint-disable no-unused-expressions, no-prototype-builtins, no-new, no-shadow, max-len */ /* eslint-disable no-unused-expressions, no-prototype-builtins, no-new, no-shadow, max-len */
require('vendor/jquery.endless-scroll.js'); import 'vendor/jquery.endless-scroll.js';
require('~/pager'); import '~/pager';
require('~/activities'); import '~/activities';
(() => { (() => {
window.gon || (window.gon = {}); window.gon || (window.gon = {});
......
require('~/extensions/array'); import '~/extensions/array';
require('jquery'); import 'jquery';
require('jquery-ujs'); import 'jquery-ujs';
require('~/ajax_loading_spinner'); import '~/ajax_loading_spinner';
describe('Ajax Loading Spinner', () => { describe('Ajax Loading Spinner', () => {
const fixtureTemplate = 'static/ajax_loading_spinner.html.raw'; const fixtureTemplate = 'static/ajax_loading_spinner.html.raw';
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import AwardsHandler from '~/awards_handler'; import AwardsHandler from '~/awards_handler';
require('~/lib/utils/common_utils'); import '~/lib/utils/common_utils';
(function() { (function() {
var awardsHandler, lazyAssert, urlRoot, openAndWaitForEmojiMenu; var awardsHandler, lazyAssert, urlRoot, openAndWaitForEmojiMenu;
......
/* eslint-disable space-before-function-paren, no-var, comma-dangle, no-return-assign, max-len */ /* eslint-disable space-before-function-paren, no-var, comma-dangle, no-return-assign, max-len */
require('~/behaviors/autosize'); import '~/behaviors/autosize';
(function() { (function() {
describe('Autosize behavior', function() { describe('Autosize behavior', function() {
......
/* eslint-disable space-before-function-paren, no-var, no-return-assign, comma-dangle, jasmine/no-spec-dupes, new-cap, max-len */ /* eslint-disable space-before-function-paren, no-var, no-return-assign, comma-dangle, jasmine/no-spec-dupes, new-cap, max-len */
require('~/behaviors/quick_submit'); import '~/behaviors/quick_submit';
(function() { (function() {
describe('Quick Submit behavior', function() { describe('Quick Submit behavior', function() {
......
/* eslint-disable space-before-function-paren, no-var */ /* eslint-disable space-before-function-paren, no-var */
require('~/behaviors/requires_input'); import '~/behaviors/requires_input';
(function() { (function() {
describe('requiresInput', function() { describe('requiresInput', function() {
......
require('~/gl_dropdown'); import '~/gl_dropdown';
require('~/blob/create_branch_dropdown'); import '~/blob/create_branch_dropdown';
require('~/blob/target_branch_dropdown'); import '~/blob/target_branch_dropdown';
describe('CreateBranchDropdown', () => { describe('CreateBranchDropdown', () => {
const fixtureTemplate = 'static/target_branch_dropdown.html.raw'; const fixtureTemplate = 'static/target_branch_dropdown.html.raw';
......
require('~/gl_dropdown'); import '~/gl_dropdown';
require('~/blob/create_branch_dropdown'); import '~/blob/create_branch_dropdown';
require('~/blob/target_branch_dropdown'); import '~/blob/target_branch_dropdown';
describe('TargetBranchDropdown', () => { describe('TargetBranchDropdown', () => {
const fixtureTemplate = 'static/target_branch_dropdown.html.raw'; const fixtureTemplate = 'static/target_branch_dropdown.html.raw';
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
import Vue from 'vue'; import Vue from 'vue';
import '~/boards/models/assignee'; import '~/boards/models/assignee';
require('~/boards/models/list'); import '~/boards/models/list';
require('~/boards/models/label'); import '~/boards/models/label';
require('~/boards/stores/boards_store'); import '~/boards/stores/boards_store';
const boardCard = require('~/boards/components/board_card').default; const boardCard = require('~/boards/components/board_card').default;
require('./mock_data'); import './mock_data';
describe('Issue card', () => { describe('Issue card', () => {
let vm; let vm;
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
import Vue from 'vue'; import Vue from 'vue';
import boardNewIssue from '~/boards/components/board_new_issue'; import boardNewIssue from '~/boards/components/board_new_issue';
require('~/boards/models/list'); import '~/boards/models/list';
require('./mock_data'); import './mock_data';
describe('Issue boards new issue form', () => { describe('Issue boards new issue form', () => {
let vm; let vm;
......
/* global CommitsList */ /* global CommitsList */
require('vendor/jquery.endless-scroll'); import 'vendor/jquery.endless-scroll';
require('~/pager'); import '~/pager';
require('~/commits'); import '~/commits';
(() => { (() => {
// TODO: remove this hack! // TODO: remove this hack!
......
require('~/lib/utils/datetime_utility'); import '~/lib/utils/datetime_utility';
(() => { (() => {
describe('Date time utils', () => { describe('Date time utils', () => {
......
/* eslint-disable jasmine/no-global-setup, dot-notation, jasmine/no-expect-in-setup-teardown, max-len */ /* eslint-disable jasmine/no-global-setup, dot-notation, jasmine/no-expect-in-setup-teardown, max-len */
/* global CommentsStore */ /* global CommentsStore */
require('~/diff_notes/models/discussion'); import '~/diff_notes/models/discussion';
require('~/diff_notes/models/note'); import '~/diff_notes/models/note';
require('~/diff_notes/stores/comments'); import '~/diff_notes/stores/comments';
function createDiscussion(noteId = 1, resolved = true) { function createDiscussion(noteId = 1, resolved = true) {
CommentsStore.create({ CommentsStore.create({
......
/* eslint-disable space-before-function-paren, no-var */ /* eslint-disable space-before-function-paren, no-var */
require('~/extensions/array'); import '~/extensions/array';
(function() { (function() {
describe('Array extensions', function() { describe('Array extensions', function() {
......
require('~/filtered_search/dropdown_utils'); import '~/filtered_search/dropdown_utils';
require('~/filtered_search/filtered_search_tokenizer'); import '~/filtered_search/filtered_search_tokenizer';
require('~/filtered_search/filtered_search_dropdown'); import '~/filtered_search/filtered_search_dropdown';
require('~/filtered_search/dropdown_user'); import '~/filtered_search/dropdown_user';
describe('Dropdown User', () => { describe('Dropdown User', () => {
describe('getSearchInput', () => { describe('getSearchInput', () => {
......
require('~/extensions/array'); import '~/extensions/array';
require('~/filtered_search/dropdown_utils'); import '~/filtered_search/dropdown_utils';
require('~/filtered_search/filtered_search_tokenizer'); import '~/filtered_search/filtered_search_tokenizer';
require('~/filtered_search/filtered_search_dropdown_manager'); import '~/filtered_search/filtered_search_dropdown_manager';
describe('Dropdown Utils', () => { describe('Dropdown Utils', () => {
describe('getEscapedText', () => { describe('getEscapedText', () => {
......
require('~/extensions/array'); import '~/extensions/array';
require('~/filtered_search/filtered_search_visual_tokens'); import '~/filtered_search/filtered_search_visual_tokens';
require('~/filtered_search/filtered_search_tokenizer'); import '~/filtered_search/filtered_search_tokenizer';
require('~/filtered_search/filtered_search_dropdown_manager'); import '~/filtered_search/filtered_search_dropdown_manager';
describe('Filtered Search Dropdown Manager', () => { describe('Filtered Search Dropdown Manager', () => {
describe('addWordToInput', () => { describe('addWordToInput', () => {
......
import * as recentSearchesStoreSrc from '~/filtered_search/stores/recent_searches_store'; import * as recentSearchesStoreSrc from '~/filtered_search/stores/recent_searches_store';
import RecentSearchesService from '~/filtered_search/services/recent_searches_service'; import RecentSearchesService from '~/filtered_search/services/recent_searches_service';
import RecentSearchesServiceError from '~/filtered_search/services/recent_searches_service_error'; import RecentSearchesServiceError from '~/filtered_search/services/recent_searches_service_error';
import '~/lib/utils/url_utility';
require('~/lib/utils/url_utility'); import '~/lib/utils/common_utils';
require('~/lib/utils/common_utils'); import '~/filtered_search/filtered_search_token_keys';
require('~/filtered_search/filtered_search_token_keys'); import '~/filtered_search/filtered_search_tokenizer';
require('~/filtered_search/filtered_search_tokenizer'); import '~/filtered_search/filtered_search_dropdown_manager';
require('~/filtered_search/filtered_search_dropdown_manager'); import '~/filtered_search/filtered_search_manager';
require('~/filtered_search/filtered_search_manager'); import FilteredSearchSpecHelper from '../helpers/filtered_search_spec_helper';
const FilteredSearchSpecHelper = require('../helpers/filtered_search_spec_helper');
describe('Filtered Search Manager', () => { describe('Filtered Search Manager', () => {
let input; let input;
......
require('~/extensions/array'); import '~/extensions/array';
require('~/filtered_search/filtered_search_token_keys'); import '~/filtered_search/filtered_search_token_keys';
describe('Filtered Search Token Keys', () => { describe('Filtered Search Token Keys', () => {
describe('get', () => { describe('get', () => {
......
require('~/extensions/array'); import '~/extensions/array';
require('~/filtered_search/filtered_search_token_keys'); import '~/filtered_search/filtered_search_token_keys';
require('~/filtered_search/filtered_search_tokenizer'); import '~/filtered_search/filtered_search_tokenizer';
describe('Filtered Search Tokenizer', () => { describe('Filtered Search Tokenizer', () => {
describe('processTokens', () => { describe('processTokens', () => {
......
import AjaxCache from '~/lib/utils/ajax_cache'; import AjaxCache from '~/lib/utils/ajax_cache';
require('~/filtered_search/filtered_search_visual_tokens'); import '~/filtered_search/filtered_search_visual_tokens';
const FilteredSearchSpecHelper = require('../helpers/filtered_search_spec_helper'); import FilteredSearchSpecHelper from '../helpers/filtered_search_spec_helper';
describe('Filtered Search Visual Tokens', () => { describe('Filtered Search Visual Tokens', () => {
let tokensContainer; let tokensContainer;
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
import GfmAutoComplete from '~/gfm_auto_complete'; import GfmAutoComplete from '~/gfm_auto_complete';
require('vendor/jquery.caret'); import 'vendor/jquery.caret';
require('vendor/jquery.atwho'); import 'vendor/jquery.atwho';
describe('GfmAutoComplete', function () { describe('GfmAutoComplete', function () {
const gfmAutoCompleteCallbacks = GfmAutoComplete.prototype.getDefaultCallbacks.call({ const gfmAutoCompleteCallbacks = GfmAutoComplete.prototype.getDefaultCallbacks.call({
......
/* eslint-disable comma-dangle, no-param-reassign, no-unused-expressions, max-len */ /* eslint-disable comma-dangle, no-param-reassign, no-unused-expressions, max-len */
require('~/gl_dropdown'); import '~/gl_dropdown';
require('~/lib/utils/common_utils'); import '~/lib/utils/common_utils';
require('~/lib/utils/url_utility'); import '~/lib/utils/url_utility';
(() => { (() => {
const NON_SELECTABLE_CLASSES = '.divider, .separator, .dropdown-header, .dropdown-menu-empty-link'; const NON_SELECTABLE_CLASSES = '.divider, .separator, .dropdown-header, .dropdown-menu-empty-link';
......
/* eslint-disable space-before-function-paren, arrow-body-style */ /* eslint-disable space-before-function-paren, arrow-body-style */
require('~/gl_field_errors'); import '~/gl_field_errors';
((global) => { ((global) => {
preloadFixtures('static/gl_field_errors.html.raw'); preloadFixtures('static/gl_field_errors.html.raw');
......
/* global autosize */ import autosize from 'vendor/autosize';
import '~/gl_form';
import '~/lib/utils/text_utility';
import '~/lib/utils/common_utils';
window.autosize = require('vendor/autosize'); window.autosize = autosize;
require('~/gl_form');
require('~/lib/utils/text_utility');
require('~/lib/utils/common_utils');
describe('GLForm', () => { describe('GLForm', () => {
const global = window.gl || (window.gl = {}); const global = window.gl || (window.gl = {});
......
/* eslint-disable space-before-function-paren, no-var */ /* eslint-disable space-before-function-paren, no-var */
require('~/header'); import '~/header';
require('~/lib/utils/text_utility'); import '~/lib/utils/text_utility';
(function() { (function() {
describe('Header', function() { describe('Header', function() {
......
/* global ClassSpecHelper */ /* global ClassSpecHelper */
require('./class_spec_helper'); import './class_spec_helper';
describe('ClassSpecHelper', () => { describe('ClassSpecHelper', () => {
describe('itShouldBeAStaticMethod', function () { describe('itShouldBeAStaticMethod', function () {
......
/* global Issuable */ /* global Issuable */
require('~/lib/utils/url_utility'); import '~/lib/utils/url_utility';
require('~/issuable'); import '~/issuable';
(() => { (() => {
const BASE_URL = '/user/project/issues?scope=all&state=closed'; const BASE_URL = '/user/project/issues?scope=all&state=closed';
......
/* eslint-disable space-before-function-paren, one-var, one-var-declaration-per-line, no-use-before-define, comma-dangle, max-len */ /* eslint-disable space-before-function-paren, one-var, one-var-declaration-per-line, no-use-before-define, comma-dangle, max-len */
import Issue from '~/issue'; import Issue from '~/issue';
require('~/lib/utils/text_utility'); import '~/lib/utils/text_utility';
describe('Issue', function() { describe('Issue', function() {
let $boxClosed, $boxOpen, $btnClose, $btnReopen; let $boxClosed, $boxOpen, $btnClose, $btnReopen;
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
/* global IssuableContext */ /* global IssuableContext */
/* global LabelsSelect */ /* global LabelsSelect */
require('~/gl_dropdown'); import '~/gl_dropdown';
require('select2'); import 'select2';
require('vendor/jquery.nicescroll'); import 'vendor/jquery.nicescroll';
require('~/api'); import '~/api';
require('~/create_label'); import '~/create_label';
require('~/issuable_context'); import '~/issuable_context';
require('~/users_select'); import '~/users_select';
require('~/labels_select'); import '~/labels_select';
(() => { (() => {
let saveLabelCount = 0; let saveLabelCount = 0;
......
/* eslint-disable promise/catch-or-return */ /* eslint-disable promise/catch-or-return */
require('~/lib/utils/common_utils'); import '~/lib/utils/common_utils';
(() => { (() => {
describe('common_utils', () => { describe('common_utils', () => {
......
require('~/lib/utils/text_utility'); import '~/lib/utils/text_utility';
describe('text_utility', () => { describe('text_utility', () => {
describe('gl.text.getTextWidth', () => { describe('gl.text.getTextWidth', () => {
......
/* eslint-disable space-before-function-paren, no-var, no-param-reassign, quotes, prefer-template, no-else-return, new-cap, dot-notation, no-return-assign, comma-dangle, no-new, one-var, one-var-declaration-per-line, jasmine/no-spec-dupes, no-underscore-dangle, max-len */ /* eslint-disable space-before-function-paren, no-var, no-param-reassign, quotes, prefer-template, no-else-return, new-cap, dot-notation, no-return-assign, comma-dangle, no-new, one-var, one-var-declaration-per-line, jasmine/no-spec-dupes, no-underscore-dangle, max-len */
/* global LineHighlighter */ /* global LineHighlighter */
require('~/line_highlighter'); import '~/line_highlighter';
(function() { (function() {
describe('LineHighlighter', function() { describe('LineHighlighter', function() {
......
/* eslint-disable space-before-function-paren, no-return-assign */ /* eslint-disable space-before-function-paren, no-return-assign */
/* global MergeRequest */ /* global MergeRequest */
require('~/merge_request'); import '~/merge_request';
(function() { (function() {
describe('MergeRequest', function() { describe('MergeRequest', function() {
......
/* eslint-disable no-var, comma-dangle, object-shorthand */ /* eslint-disable no-var, comma-dangle, object-shorthand */
require('~/merge_request_tabs'); import '~/merge_request_tabs';
require('~/commit/pipelines/pipelines_bundle.js'); import '~/commit/pipelines/pipelines_bundle.js';
require('~/breakpoints'); import '~/breakpoints';
require('~/lib/utils/common_utils'); import '~/lib/utils/common_utils';
require('~/diff'); import '~/diff';
require('~/single_file_diff'); import '~/single_file_diff';
require('~/files_comment_button'); import '~/files_comment_button';
require('vendor/jquery.scrollTo'); import 'vendor/jquery.scrollTo';
(function () { (function () {
// TODO: remove this hack! // TODO: remove this hack!
......
/* eslint-disable space-before-function-paren, one-var, no-var, one-var-declaration-per-line, no-return-assign, quotes, max-len */ /* eslint-disable space-before-function-paren, one-var, no-var, one-var-declaration-per-line, no-return-assign, quotes, max-len */
/* global NewBranchForm */ /* global NewBranchForm */
require('~/new_branch_form'); import '~/new_branch_form';
(function() { (function() {
describe('Branch', function() { describe('Branch', function() {
......
/* global fixture */ /* global fixture */
require('~/pager'); import '~/pager';
describe('pager', () => { describe('pager', () => {
const Pager = window.Pager; const Pager = window.Pager;
......
require('~/lib/utils/pretty_time'); import '~/lib/utils/pretty_time';
(() => { (() => {
const prettyTime = gl.utils.prettyTime; const prettyTime = gl.utils.prettyTime;
......
/* eslint-disable space-before-function-paren, no-unused-expressions, no-return-assign, no-param-reassign, no-var, new-cap, wrap-iife, no-unused-vars, quotes, jasmine/no-expect-in-setup-teardown, max-len */ /* eslint-disable space-before-function-paren, no-unused-expressions, no-return-assign, no-param-reassign, no-var, new-cap, wrap-iife, no-unused-vars, quotes, jasmine/no-expect-in-setup-teardown, max-len */
/* global Project */ /* global Project */
require('select2/select2.js'); import 'select2/select2.js';
require('~/gl_dropdown'); import '~/gl_dropdown';
require('~/api'); import '~/api';
require('~/project_select'); import '~/project_select';
require('~/project'); import '~/project';
(function() { (function() {
describe('Project Title', function() { describe('Project Title', function() {
......
/* eslint-disable space-before-function-paren, max-len, no-var, one-var, one-var-declaration-per-line, no-unused-expressions, consistent-return, no-param-reassign, default-case, no-return-assign, comma-dangle, object-shorthand, prefer-template, quotes, new-parens, vars-on-top, new-cap, max-len */ /* eslint-disable space-before-function-paren, max-len, no-var, one-var, one-var-declaration-per-line, no-unused-expressions, consistent-return, no-param-reassign, default-case, no-return-assign, comma-dangle, object-shorthand, prefer-template, quotes, new-parens, vars-on-top, new-cap, max-len */
require('~/gl_dropdown'); import '~/gl_dropdown';
require('~/search_autocomplete'); import '~/search_autocomplete';
require('~/lib/utils/common_utils'); import '~/lib/utils/common_utils';
require('vendor/fuzzaldrin-plus'); import 'vendor/fuzzaldrin-plus';
(function() { (function() {
var addBodyAttributes, assertLinks, dashboardIssuesPath, dashboardMRsPath, groupIssuesPath, groupMRsPath, groupName, mockDashboardOptions, mockGroupOptions, mockProjectOptions, projectIssuesPath, projectMRsPath, projectName, userId, widget; var addBodyAttributes, assertLinks, dashboardIssuesPath, dashboardMRsPath, groupIssuesPath, groupMRsPath, groupName, mockDashboardOptions, mockGroupOptions, mockProjectOptions, projectIssuesPath, projectMRsPath, projectName, userId, widget;
......
/* eslint-disable space-before-function-paren, no-return-assign, no-var, quotes */ /* eslint-disable space-before-function-paren, no-return-assign, no-var, quotes */
/* global ShortcutsIssuable */ /* global ShortcutsIssuable */
require('~/copy_as_gfm'); import '~/copy_as_gfm';
require('~/shortcuts_issuable'); import '~/shortcuts_issuable';
(function() { (function() {
describe('ShortcutsIssuable', function() { describe('ShortcutsIssuable', function() {
......
import AccessorUtilities from '~/lib/utils/accessor'; import AccessorUtilities from '~/lib/utils/accessor';
require('~/signin_tabs_memoizer'); import '~/signin_tabs_memoizer';
((global) => { ((global) => {
describe('SigninTabsMemoizer', () => { describe('SigninTabsMemoizer', () => {
......
require('~/smart_interval'); import '~/smart_interval';
(() => { (() => {
const DEFAULT_MAX_INTERVAL = 100; const DEFAULT_MAX_INTERVAL = 100;
......
/* eslint-disable space-before-function-paren, no-var, no-return-assign, quotes */ /* eslint-disable space-before-function-paren, no-var, no-return-assign, quotes */
require('~/syntax_highlight'); import '~/syntax_highlight';
(function() { (function() {
describe('Syntax Highlighter', function() { describe('Syntax Highlighter', function() {
......
require('~/todos'); import '~/todos';
require('~/lib/utils/common_utils'); import '~/lib/utils/common_utils';
describe('Todos', () => { describe('Todos', () => {
preloadFixtures('todos/todos.html.raw'); preloadFixtures('todos/todos.html.raw');
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
/* global MockU2FDevice */ /* global MockU2FDevice */
/* global U2FAuthenticate */ /* global U2FAuthenticate */
require('~/u2f/authenticate'); import '~/u2f/authenticate';
require('~/u2f/util'); import '~/u2f/util';
require('~/u2f/error'); import '~/u2f/error';
require('vendor/u2f'); import 'vendor/u2f';
require('./mock_u2f_device'); import './mock_u2f_device';
(function() { (function() {
describe('U2FAuthenticate', function() { describe('U2FAuthenticate', function() {
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
/* global MockU2FDevice */ /* global MockU2FDevice */
/* global U2FRegister */ /* global U2FRegister */
require('~/u2f/register'); import '~/u2f/register';
require('~/u2f/util'); import '~/u2f/util';
require('~/u2f/error'); import '~/u2f/error';
require('vendor/u2f'); import 'vendor/u2f';
require('./mock_u2f_device'); import './mock_u2f_device';
(function() { (function() {
describe('U2FRegister', function() { describe('U2FRegister', function() {
......
const ClassSpecHelper = require('./helpers/class_spec_helper'); import VersionCheckImage from '~/version_check_image';
const VersionCheckImage = require('~/version_check_image'); import ClassSpecHelper from './helpers/class_spec_helper';
require('jquery');
describe('VersionCheckImage', function () { describe('VersionCheckImage', function () {
describe('bindErrorEvent', function () { describe('bindErrorEvent', function () {
......
require('~/visibility_select'); import '~/visibility_select';
(() => { (() => {
const VisibilitySelect = gl.VisibilitySelect; const VisibilitySelect = gl.VisibilitySelect;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
/* global Mousetrap */ /* global Mousetrap */
/* global ZenMode */ /* global ZenMode */
require('~/zen_mode'); import '~/zen_mode';
(function() { (function() {
var enterZen, escapeKeydown, exitZen; var enterZen, escapeKeydown, exitZen;
......
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