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