BigW Consortium Gitlab

fix illegal references to "this" in module context

parent 0b932a7f
import $ from 'jquery'; import $ from 'jquery';
import '~/behaviors/quick_submit'; import '~/behaviors/quick_submit';
describe('Quick Submit behavior', () => { describe('Quick Submit behavior', function () {
const keydownEvent = (options = { keyCode: 13, metaKey: true }) => $.Event('keydown', options); const keydownEvent = (options = { keyCode: 13, metaKey: true }) => $.Event('keydown', options);
preloadFixtures('merge_requests/merge_request_with_task_list.html.raw'); preloadFixtures('merge_requests/merge_request_with_task_list.html.raw');
......
import $ from 'jquery'; import $ from 'jquery';
import BlobFileDropzone from '~/blob/blob_file_dropzone'; import BlobFileDropzone from '~/blob/blob_file_dropzone';
describe('BlobFileDropzone', () => { describe('BlobFileDropzone', function () {
preloadFixtures('blob/show.html.raw'); preloadFixtures('blob/show.html.raw');
beforeEach(() => { beforeEach(() => {
......
...@@ -4,7 +4,7 @@ import axios from '~/lib/utils/axios_utils'; ...@@ -4,7 +4,7 @@ import axios from '~/lib/utils/axios_utils';
import pipelinesTable from '~/commit/pipelines/pipelines_table.vue'; import pipelinesTable from '~/commit/pipelines/pipelines_table.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper'; import mountComponent from 'spec/helpers/vue_mount_component_helper';
describe('Pipelines table in Commits and Merge requests', () => { describe('Pipelines table in Commits and Merge requests', function () {
const jsonFixtureName = 'pipelines/pipelines.json'; const jsonFixtureName = 'pipelines/pipelines.json';
let pipeline; let pipeline;
let PipelinesTable; let PipelinesTable;
......
...@@ -9,7 +9,7 @@ import FilteredSearchDropdownManager from '~/filtered_search/filtered_search_dro ...@@ -9,7 +9,7 @@ import FilteredSearchDropdownManager from '~/filtered_search/filtered_search_dro
import FilteredSearchManager from '~/filtered_search/filtered_search_manager'; import FilteredSearchManager from '~/filtered_search/filtered_search_manager';
import FilteredSearchSpecHelper from '../helpers/filtered_search_spec_helper'; import FilteredSearchSpecHelper from '../helpers/filtered_search_spec_helper';
describe('Filtered Search Manager', () => { describe('Filtered Search Manager', function () {
let input; let input;
let manager; let manager;
let tokensContainer; let tokensContainer;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import './class_spec_helper'; import './class_spec_helper';
describe('ClassSpecHelper', () => { describe('ClassSpecHelper', function () {
describe('itShouldBeAStaticMethod', () => { describe('itShouldBeAStaticMethod', () => {
beforeEach(() => { beforeEach(() => {
class TestClass { class TestClass {
......
import csrf from '~/lib/utils/csrf'; import csrf from '~/lib/utils/csrf';
describe('csrf', () => { describe('csrf', function () {
beforeEach(() => { beforeEach(() => {
this.tokenKey = 'X-CSRF-Token'; this.tokenKey = 'X-CSRF-Token';
this.token = 'pH1cvjnP9grx2oKlhWEDvUZnJ8x2eXsIs1qzyHkF3DugSG5yTxR76CWeEZRhML2D1IeVB7NEW0t5l/axE4iJpQ=='; this.token = 'pH1cvjnP9grx2oKlhWEDvUZnJ8x2eXsIs1qzyHkF3DugSG5yTxR76CWeEZRhML2D1IeVB7NEW0t5l/axE4iJpQ==';
......
import MonitoringStore from '~/monitoring/stores/monitoring_store'; import MonitoringStore from '~/monitoring/stores/monitoring_store';
import MonitoringMock, { deploymentData } from './mock_data'; import MonitoringMock, { deploymentData } from './mock_data';
describe('MonitoringStore', () => { describe('MonitoringStore', function () {
this.store = new MonitoringStore(); this.store = new MonitoringStore();
this.store.storeMetrics(MonitoringMock.data); this.store.storeMetrics(MonitoringMock.data);
......
...@@ -6,7 +6,7 @@ const PipelineSchedulesCalloutComponent = Vue.extend(PipelineSchedulesCallout); ...@@ -6,7 +6,7 @@ const PipelineSchedulesCalloutComponent = Vue.extend(PipelineSchedulesCallout);
const cookieKey = 'pipeline_schedules_callout_dismissed'; const cookieKey = 'pipeline_schedules_callout_dismissed';
const docsUrl = 'help/ci/scheduled_pipelines'; const docsUrl = 'help/ci/scheduled_pipelines';
describe('Pipeline Schedule Callout', () => { describe('Pipeline Schedule Callout', function () {
beforeEach(() => { beforeEach(() => {
setFixtures(` setFixtures(`
<div id='pipeline-schedules-callout' data-docs-url=${docsUrl}></div> <div id='pipeline-schedules-callout' data-docs-url=${docsUrl}></div>
......
...@@ -9,8 +9,6 @@ import Sidebar from '~/right_sidebar'; ...@@ -9,8 +9,6 @@ import Sidebar from '~/right_sidebar';
(function() { (function() {
var $aside, $icon, $labelsIcon, $page, $toggle, assertSidebarState; var $aside, $icon, $labelsIcon, $page, $toggle, assertSidebarState;
this.sidebar = null;
$aside = null; $aside = null;
$toggle = null; $toggle = null;
...@@ -43,7 +41,7 @@ import Sidebar from '~/right_sidebar'; ...@@ -43,7 +41,7 @@ import Sidebar from '~/right_sidebar';
beforeEach(function() { beforeEach(function() {
loadFixtures(fixtureName); loadFixtures(fixtureName);
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
this.sidebar = new Sidebar(); new Sidebar(); // eslint-disable-line no-new
$aside = $('.right-sidebar'); $aside = $('.right-sidebar');
$page = $('.layout-page'); $page = $('.layout-page');
$icon = $aside.find('i'); $icon = $aside.find('i');
......
...@@ -4,7 +4,7 @@ import ShortcutsIssuable from '~/shortcuts_issuable'; ...@@ -4,7 +4,7 @@ import ShortcutsIssuable from '~/shortcuts_issuable';
initCopyAsGFM(); initCopyAsGFM();
describe('ShortcutsIssuable', () => { describe('ShortcutsIssuable', function () {
const fixtureName = 'merge_requests/diff_comment.html.raw'; const fixtureName = 'merge_requests/diff_comment.html.raw';
preloadFixtures(fixtureName); preloadFixtures(fixtureName);
beforeEach(() => { beforeEach(() => {
......
...@@ -7,7 +7,7 @@ import SidebarService from '~/sidebar/services/sidebar_service'; ...@@ -7,7 +7,7 @@ import SidebarService from '~/sidebar/services/sidebar_service';
import SidebarMoveIssue from '~/sidebar/lib/sidebar_move_issue'; import SidebarMoveIssue from '~/sidebar/lib/sidebar_move_issue';
import Mock from './mock_data'; import Mock from './mock_data';
describe('SidebarMoveIssue', () => { describe('SidebarMoveIssue', function () {
beforeEach(() => { beforeEach(() => {
Vue.http.interceptors.push(Mock.sidebarMockInterceptor); Vue.http.interceptors.push(Mock.sidebarMockInterceptor);
this.mediator = new SidebarMediator(Mock.mediator); this.mediator = new SidebarMediator(Mock.mediator);
......
...@@ -31,7 +31,7 @@ const PARTICIPANT_LIST = [ ...@@ -31,7 +31,7 @@ const PARTICIPANT_LIST = [
{ ...PARTICIPANT, id: 3 }, { ...PARTICIPANT, id: 3 },
]; ];
describe('Sidebar store', () => { describe('Sidebar store', function () {
beforeEach(() => { beforeEach(() => {
this.store = new SidebarStore({ this.store = new SidebarStore({
currentUser: { currentUser: {
......
...@@ -3,7 +3,7 @@ import U2FAuthenticate from '~/u2f/authenticate'; ...@@ -3,7 +3,7 @@ import U2FAuthenticate from '~/u2f/authenticate';
import 'vendor/u2f'; import 'vendor/u2f';
import MockU2FDevice from './mock_u2f_device'; import MockU2FDevice from './mock_u2f_device';
describe('U2FAuthenticate', () => { describe('U2FAuthenticate', function () {
preloadFixtures('u2f/authenticate.html.raw'); preloadFixtures('u2f/authenticate.html.raw');
beforeEach((done) => { beforeEach((done) => {
......
...@@ -3,7 +3,7 @@ import U2FRegister from '~/u2f/register'; ...@@ -3,7 +3,7 @@ import U2FRegister from '~/u2f/register';
import 'vendor/u2f'; import 'vendor/u2f';
import MockU2FDevice from './mock_u2f_device'; import MockU2FDevice from './mock_u2f_device';
describe('U2FRegister', () => { describe('U2FRegister', function () {
preloadFixtures('u2f/register.html.raw'); preloadFixtures('u2f/register.html.raw');
beforeEach((done) => { beforeEach((done) => {
......
...@@ -523,18 +523,20 @@ describe('ReadyToMerge', () => { ...@@ -523,18 +523,20 @@ describe('ReadyToMerge', () => {
}); });
describe('when user can merge and can delete branch', () => { describe('when user can merge and can delete branch', () => {
let customVm;
beforeEach(() => { beforeEach(() => {
this.customVm = createComponent({ customVm = createComponent({
mr: { canRemoveSourceBranch: true }, mr: { canRemoveSourceBranch: true },
}); });
}); });
it('isRemoveSourceBranchButtonDisabled should be false', () => { it('isRemoveSourceBranchButtonDisabled should be false', () => {
expect(this.customVm.isRemoveSourceBranchButtonDisabled).toBe(false); expect(customVm.isRemoveSourceBranchButtonDisabled).toBe(false);
}); });
it('should be enabled in rendered output', () => { it('should be enabled in rendered output', () => {
const checkboxElement = this.customVm.$el.querySelector('#remove-source-branch-input'); const checkboxElement = customVm.$el.querySelector('#remove-source-branch-input');
expect(checkboxElement).not.toBeNull(); expect(checkboxElement).not.toBeNull();
}); });
}); });
......
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