Commit 52cff35e authored by Clement Ho's avatar Clement Ho

[skip ci] fix time tracking spec

parent 07ec200b
......@@ -2,7 +2,7 @@
import Vue from 'vue';
import '~/sidebar/components/time_tracking/time_tracker';
import timeTracker from '~/sidebar/components/time_tracking/time_tracker';
function initTimeTrackingComponent(opts) {
setFixtures(`
......@@ -16,18 +16,17 @@ function initTimeTrackingComponent(opts) {
time_spent: opts.timeSpent,
human_time_estimate: opts.timeEstimateHumanReadable,
human_time_spent: opts.timeSpentHumanReadable,
docsUrl: '/help/workflow/time_tracking.md',
rootPath: '/',
};
const TimeTrackingComponent = Vue.component('issuable-time-tracker');
const TimeTrackingComponent = Vue.extend(timeTracker);
this.timeTracker = new TimeTrackingComponent({
el: '#mock-container',
propsData: this.initialData,
});
}
((gl) => {
describe('Issuable Time Tracker', function() {
describe('Issuable Time Tracker', function() {
describe('Initialization', function() {
beforeEach(function() {
initTimeTrackingComponent.call(this, { timeEstimate: 100000, timeSpent: 5000, timeEstimateHumanReadable: '2h 46m', timeSpentHumanReadable: '1h 23m' });
......@@ -131,7 +130,7 @@ function initTimeTrackingComponent(opts) {
describe('No time tracking pane', function() {
beforeEach(function() {
initTimeTrackingComponent.call(this, { timeEstimate: 0, timeSpent: 0, timeEstimateHumanReadable: 0, timeSpentHumanReadable: 0 });
initTimeTrackingComponent.call(this, { timeEstimate: 0, timeSpent: 0, timeEstimateHumanReadable: '', timeSpentHumanReadable: '' });
});
it('should only show the "No time tracking" pane when both timeEstimate and time_spent are falsey', function(done) {
......@@ -198,5 +197,4 @@ function initTimeTrackingComponent(opts) {
});
});
});
});
})(window.gl || (window.gl = {}));
});
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