Commit 80c90c20 authored by Bryce Johnson's avatar Bryce Johnson

Shush eslint.

parent 705ca18e
......@@ -74,7 +74,7 @@
},
abbreviateTime(timeStr) {
return PrettyTime.abbreviateTime(timeStr);
}
},
},
template: `
<div class='time_tracker time-tracking-component-wrap' v-cloak>
......
......@@ -7,7 +7,7 @@
class PrettyTime {
/*
* Accepts seconds (Number) and returns a timeObject: { weeks: #, days: #, hours: #, minutes: # }.
* Accepts seconds and returns a timeObject { weeks: #, days: #, hours: #, minutes: # }
* Seconds can be negative or positive, zero or non-zero.
*/
static parseSeconds(seconds) {
......
//= require lib/utils/pretty_time
//= require directives/tooltip_title
(() => {
const PrettyTime = gl.PrettyTime;
describe('PrettyTime methods', function() {
describe('parseSeconds', function() {
it('should correctly parse a negative value', function() {
describe('PrettyTime methods', function () {
describe('parseSeconds', function () {
it('should correctly parse a negative value', function () {
const parser = PrettyTime.parseSeconds;
const zeroSeconds = parser(-1000);
......@@ -16,7 +16,7 @@
expect(zeroSeconds.weeks).toBe(0);
});
it('should correctly parse a zero value', function() {
it('should correctly parse a zero value', function () {
const parser = PrettyTime.parseSeconds;
const zeroSeconds = parser(0);
......@@ -27,7 +27,7 @@
expect(zeroSeconds.weeks).toBe(0);
});
it('should correctly parse a small non-zero second values', function() {
it('should correctly parse a small non-zero second values', function () {
const parser = PrettyTime.parseSeconds;
const subOneMinute = parser(10);
......@@ -52,7 +52,7 @@
expect(manyMinutes.weeks).toBe(0);
});
it('should correctly parse large second values', function() {
it('should correctly parse large second values', function () {
const parser = PrettyTime.parseSeconds;
const aboveOneHour = parser(4800);
......@@ -78,14 +78,13 @@
});
});
describe('stringifyTime', function() {
it('should stringify values with all non-zero units', function() {
describe('stringifyTime', function () {
it('should stringify values with all non-zero units', function () {
const timeObject = {
weeks: 1,
days: 4,
hours: 7,
minutes: 20
minutes: 20,
};
const timeString = PrettyTime.stringifyTime(timeObject);
......@@ -93,12 +92,12 @@
expect(timeString).toBe('1w 4d 7h 20m');
});
it('should stringify values with some non-zero units', function() {
it('should stringify values with some non-zero units', function () {
const timeObject = {
weeks: 0,
days: 4,
hours: 0,
minutes: 20
minutes: 20,
};
const timeString = PrettyTime.stringifyTime(timeObject);
......@@ -106,12 +105,12 @@
expect(timeString).toBe('4d 20m');
});
it('should stringify values with no non-zero units', function() {
it('should stringify values with no non-zero units', function () {
const timeObject = {
weeks: 0,
days: 0,
hours: 0,
minutes: 0
minutes: 0,
};
const timeString = PrettyTime.stringifyTime(timeObject);
......@@ -120,13 +119,13 @@
});
});
describe('abbreviateTime', function() {
it('should abbreviate stringified times for weeks', function() {
describe('abbreviateTime', function () {
it('should abbreviate stringified times for weeks', function () {
const fullTimeString = '1w 3d 4h 5m';
expect(PrettyTime.abbreviateTime(fullTimeString)).toBe('1w');
});
it('should abbreviate stringified times for non-weeks', function() {
it('should abbreviate stringified times for non-weeks', function () {
const fullTimeString = '0w 3d 4h 5m';
expect(PrettyTime.abbreviateTime(fullTimeString)).toBe('3d');
});
......
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