From 1ec8e1714caa4333481112083b5ea3022929b453 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Thu, 2 Feb 2017 13:44:50 -0600 Subject: fix eslint violations in issuable_time_tracker_spec.js.es6 --- spec/javascripts/issuable_time_tracker_spec.js.es6 | 74 +++++++++++----------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/spec/javascripts/issuable_time_tracker_spec.js.es6 b/spec/javascripts/issuable_time_tracker_spec.js.es6 index a1e979e8d09..c46aa208523 100644 --- a/spec/javascripts/issuable_time_tracker_spec.js.es6 +++ b/spec/javascripts/issuable_time_tracker_spec.js.es6 @@ -1,10 +1,12 @@ -/* eslint-disable */ +/* eslint-disable max-len */ +/* global Vue */ + //= require jquery //= require vue //= require issuable/time_tracking/components/time_tracker function initTimeTrackingComponent(opts) { - fixture.set(` + setFixtures(`
@@ -25,24 +27,24 @@ function initTimeTrackingComponent(opts) { }); } -((gl) => { - describe('Issuable Time Tracker', function() { - describe('Initialization', function() { - beforeEach(function() { +(() => { + describe('Issuable Time Tracker', function () { + describe('Initialization', function () { + beforeEach(function () { initTimeTrackingComponent.call(this, { timeEstimate: 100000, timeSpent: 5000, timeEstimateHumanReadable: '2h 46m', timeSpentHumanReadable: '1h 23m' }); }); - it('should return something defined', function() { + it('should return something defined', function () { expect(this.timeTracker).toBeDefined(); }); - it ('should correctly set timeEstimate', function(done) { + it('should correctly set timeEstimate', function (done) { Vue.nextTick(() => { expect(this.timeTracker.timeEstimate).toBe(this.initialData.time_estimate); done(); }); }); - it ('should correctly set time_spent', function(done) { + it('should correctly set time_spent', function (done) { Vue.nextTick(() => { expect(this.timeTracker.timeSpent).toBe(this.initialData.time_spent); done(); @@ -50,41 +52,40 @@ function initTimeTrackingComponent(opts) { }); }); - describe('Content Display', function() { - describe('Panes', function() { - describe('Comparison pane', function() { - beforeEach(function() { + describe('Content Display', function () { + describe('Panes', function () { + describe('Comparison pane', function () { + beforeEach(function () { initTimeTrackingComponent.call(this, { timeEstimate: 100000, timeSpent: 5000, timeEstimateHumanReadable: '', timeSpentHumanReadable: '' }); }); - it('should show the "Comparison" pane when timeEstimate and time_spent are truthy', function(done) { + it('should show the "Comparison" pane when timeEstimate and time_spent are truthy', function (done) { Vue.nextTick(() => { - const $comparisonPane = this.timeTracker.$el.querySelector('.time-tracking-comparison-pane'); expect(this.timeTracker.showComparisonState).toBe(true); done(); }); }); - describe('Remaining meter', function() { - it('should display the remaining meter with the correct width', function(done) { + describe('Remaining meter', function () { + it('should display the remaining meter with the correct width', function (done) { Vue.nextTick(() => { const meterWidth = this.timeTracker.$el.querySelector('.time-tracking-comparison-pane .meter-fill').style.width; const correctWidth = '5%'; expect(meterWidth).toBe(correctWidth); done(); - }) + }); }); - it('should display the remaining meter with the correct background color when within estimate', function(done) { + it('should display the remaining meter with the correct background color when within estimate', function (done) { Vue.nextTick(() => { const styledMeter = $(this.timeTracker.$el).find('.time-tracking-comparison-pane .within_estimate .meter-fill'); expect(styledMeter.length).toBe(1); - done() + done(); }); }); - it('should display the remaining meter with the correct background color when over estimate', function(done) { + it('should display the remaining meter with the correct background color when over estimate', function (done) { this.timeTracker.time_estimate = 100000; this.timeTracker.time_spent = 20000000; Vue.nextTick(() => { @@ -96,12 +97,12 @@ function initTimeTrackingComponent(opts) { }); }); - describe("Estimate only pane", function() { - beforeEach(function() { + describe('Estimate only pane', function () { + beforeEach(function () { initTimeTrackingComponent.call(this, { timeEstimate: 100000, timeSpent: 0, timeEstimateHumanReadable: '2h 46m', timeSpentHumanReadable: '' }); }); - it('should display the human readable version of time estimated', function(done) { + it('should display the human readable version of time estimated', function (done) { Vue.nextTick(() => { const estimateText = this.timeTracker.$el.querySelector('.time-tracking-estimate-only-pane').innerText; const correctText = 'Estimated: 2h 46m'; @@ -112,12 +113,12 @@ function initTimeTrackingComponent(opts) { }); }); - describe('Spent only pane', function() { - beforeEach(function() { + describe('Spent only pane', function () { + beforeEach(function () { initTimeTrackingComponent.call(this, { timeEstimate: 0, timeSpent: 5000, timeEstimateHumanReadable: '2h 46m', timeSpentHumanReadable: '1h 23m' }); }); - it('should display the human readable version of time spent', function(done) { + it('should display the human readable version of time spent', function (done) { Vue.nextTick(() => { const spentText = this.timeTracker.$el.querySelector('.time-tracking-spend-only-pane').innerText; const correctText = 'Spent: 1h 23m'; @@ -128,15 +129,15 @@ function initTimeTrackingComponent(opts) { }); }); - describe('No time tracking pane', function() { - beforeEach(function() { + describe('No time tracking pane', function () { + beforeEach(function () { initTimeTrackingComponent.call(this, { timeEstimate: 0, timeSpent: 0, timeEstimateHumanReadable: 0, timeSpentHumanReadable: 0 }); }); - it('should only show the "No time tracking" pane when both timeEstimate and time_spent are falsey', function(done) { + it('should only show the "No time tracking" pane when both timeEstimate and time_spent are falsey', function (done) { Vue.nextTick(() => { const $noTrackingPane = this.timeTracker.$el.querySelector('.time-tracking-no-tracking-pane'); - const noTrackingText =$noTrackingPane.innerText; + const noTrackingText = $noTrackingPane.innerText; const correctText = 'No estimate or time spent'; expect(this.timeTracker.showNoTimeTrackingState).toBe(true); @@ -147,12 +148,12 @@ function initTimeTrackingComponent(opts) { }); }); - describe("Help pane", function() { - beforeEach(function() { + describe('Help pane', function () { + beforeEach(function () { initTimeTrackingComponent.call(this, { timeEstimate: 0, timeSpent: 0 }); }); - it('should not show the "Help" pane by default', function(done) { + it('should not show the "Help" pane by default', function (done) { Vue.nextTick(() => { const $helpPane = this.timeTracker.$el.querySelector('.time-tracking-help-state'); @@ -162,7 +163,7 @@ function initTimeTrackingComponent(opts) { }); }); - it('should show the "Help" pane when help button is clicked', function(done) { + it('should show the "Help" pane when help button is clicked', function (done) { Vue.nextTick(() => { $(this.timeTracker.$el).find('.help-button').click(); @@ -175,12 +176,11 @@ function initTimeTrackingComponent(opts) { }); }); - it('should not show the "Help" pane when help button is clicked and then closed', function(done) { + it('should not show the "Help" pane when help button is clicked and then closed', function (done) { Vue.nextTick(() => { $(this.timeTracker.$el).find('.help-button').click(); setTimeout(() => { - $(this.timeTracker.$el).find('.close-help-button').click(); setTimeout(() => { -- cgit v1.2.1