Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2fd57321
Commit
2fd57321
authored
Dec 07, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix component initialization in timetracking spec.
parent
11be8bdb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
spec/javascripts/issuable_time_tracker_spec.js.es6
spec/javascripts/issuable_time_tracker_spec.js.es6
+10
-10
No files found.
spec/javascripts/issuable_time_tracker_spec.js.es6
View file @
2fd57321
/* eslint-disable */
/* eslint-disable */
//= require jquery
//= require jquery
//= require vue
//= require vue
//= require issuable/time_tracking/
time_tracking_bundle
//= require issuable/time_tracking/
components/time_tracker
function initComponent(opts = {}) {
function init
TimeTracking
Component(opts = {}) {
fixture.set(`
fixture.set(`
<div>
<div>
<div id="mock-container"></div>
<div id="mock-container"></div>
...
@@ -17,8 +17,8 @@ function initComponent(opts = {}) {
...
@@ -17,8 +17,8 @@ function initComponent(opts = {}) {
timeSpentHuman: opts.timeSpentHuman || '1h 23m',
timeSpentHuman: opts.timeSpentHuman || '1h 23m',
docsUrl: '/help/workflow/time_tracking.md',
docsUrl: '/help/workflow/time_tracking.md',
};
};
const TimeTrackingComponent = Vue.component('issuable-time-tracker');
this.timeTracker = new
gl.IssuableTimeTracker
({
this.timeTracker = new
TimeTrackingComponent
({
el: '#mock-container',
el: '#mock-container',
data: this.initialData,
data: this.initialData,
});
});
...
@@ -28,7 +28,7 @@ function initComponent(opts = {}) {
...
@@ -28,7 +28,7 @@ function initComponent(opts = {}) {
describe('Issuable Time Tracker', function() {
describe('Issuable Time Tracker', function() {
describe('Initialization', function() {
describe('Initialization', function() {
beforeEach(function() {
beforeEach(function() {
initComponent.apply(this);
init
TimeTracking
Component.apply(this);
});
});
it('should return something defined', function() {
it('should return something defined', function() {
...
@@ -47,7 +47,7 @@ function initComponent(opts = {}) {
...
@@ -47,7 +47,7 @@ function initComponent(opts = {}) {
describe('Panes', function() {
describe('Panes', function() {
describe('Comparison pane', function() {
describe('Comparison pane', function() {
beforeEach(function() {
beforeEach(function() {
initComponent.apply(this);
init
TimeTracking
Component.apply(this);
});
});
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) {
...
@@ -99,7 +99,7 @@ function initComponent(opts = {}) {
...
@@ -99,7 +99,7 @@ function initComponent(opts = {}) {
describe("Estimate only pane", function() {
describe("Estimate only pane", function() {
beforeEach(function() {
beforeEach(function() {
initComponent.apply(this, { timeEstimate: 10000, timeSpent: '0', timeEstimateHuman: '2h 46m', timeSpentHuman: '0' });
init
TimeTracking
Component.apply(this, { timeEstimate: 10000, timeSpent: '0', timeEstimateHuman: '2h 46m', timeSpentHuman: '0' });
});
});
it('should only show the "Estimate only" pane when timeEstimate is truthy and time_spent is falsey', function() {
it('should only show the "Estimate only" pane when timeEstimate is truthy and time_spent is falsey', function() {
...
@@ -123,7 +123,7 @@ function initComponent(opts = {}) {
...
@@ -123,7 +123,7 @@ function initComponent(opts = {}) {
describe('Spent only pane', function() {
describe('Spent only pane', function() {
beforeEach(function() {
beforeEach(function() {
initComponent.apply(this, { timeEstimate: 0, timeSpent: 5000 });
init
TimeTracking
Component.apply(this, { timeEstimate: 0, timeSpent: 5000 });
});
});
// Look for the value
// Look for the value
it('should only show the "Spent only" pane when timeEstimate is falsey and time_spent is truthy', function() {
it('should only show the "Spent only" pane when timeEstimate is falsey and time_spent is truthy', function() {
...
@@ -147,7 +147,7 @@ function initComponent(opts = {}) {
...
@@ -147,7 +147,7 @@ function initComponent(opts = {}) {
describe('No time tracking pane', function() {
describe('No time tracking pane', function() {
beforeEach(function() {
beforeEach(function() {
initComponent.apply(this, { timeEstimate: 0, timeSpent: 0, timeEstimateHuman: 0, timeSpentHuman: 0 });
init
TimeTracking
Component.apply(this, { timeEstimate: 0, timeSpent: 0, timeEstimateHuman: 0, timeSpentHuman: 0 });
});
});
it('should only show the "No time tracking" pane when both timeEstimate and time_spent are falsey', function() {
it('should only show the "No time tracking" pane when both timeEstimate and time_spent are falsey', function() {
...
@@ -165,7 +165,7 @@ function initComponent(opts = {}) {
...
@@ -165,7 +165,7 @@ function initComponent(opts = {}) {
describe("Help pane", function() {
describe("Help pane", function() {
beforeEach(function() {
beforeEach(function() {
initComponent.apply(this, { timeEstimate: 0, timeSpent: 0 });
init
TimeTracking
Component.apply(this, { timeEstimate: 0, timeSpent: 0 });
});
});
it('should not show the "Help" pane by default', function() {
it('should not show the "Help" pane by default', function() {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment