Skip to content

Commit

Permalink
fix(JOB-135): applies linter to projectStaffingNeededDate.spec.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Issel Parra committed Oct 16, 2017
1 parent c38496c commit 22e3f33
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions client/test/unit/specs/utils/projectStaffingNeededDate.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ import moment from 'moment';
import projectStaffingNeededDate from '@/utils/projectStaffingNeededDate';

describe.only('Unit | Utils | Project Staffing Needed Date', () => {

describe('#sort', () => {

it('should sort two jobs according to project staffing needed date', () => {
// Given
const today = moment('2017-10-04', 'YYYY-MM-DD');

const futureJob = {id: 1, activity: {staffing_needed_from: '2017-11-03'}};
const beforeYesterdayJob = {id: 2, activity: {staffing_needed_from: '2017-10-02'}};
const futureJob = { id: 1, activity: { staffing_needed_from: '2017-11-03' } };
const beforeYesterdayJob = { id: 2, activity: { staffing_needed_from: '2017-10-02' } };

const givenJobs = [futureJob, beforeYesterdayJob];
const expectedSortedJobs = [beforeYesterdayJob, futureJob];
Expand All @@ -26,11 +24,11 @@ describe.only('Unit | Utils | Project Staffing Needed Date', () => {
// Given
const today = moment('2017-10-04', 'YYYY-MM-DD');

const todayJob = {id: 1, activity: {staffing_needed_from: '2017-10-04'}};
const yesterdayJob = {id: 2, activity: {staffing_needed_from: '2017-10-03'}};
const beforeYesterdayJob = {id: 3, activity: {staffing_needed_from: '2017-10-02'}};
const oldJob = {id: 4, activity: {staffing_needed_from: '2017-10-01'}};
const tomorrowJob = {id: 5, activity: {staffing_needed_from: '2017-10-05'}};
const todayJob = { id: 1, activity: { staffing_needed_from: '2017-10-04' } };
const yesterdayJob = { id: 2, activity: { staffing_needed_from: '2017-10-03' } };
const beforeYesterdayJob = { id: 3, activity: { staffing_needed_from: '2017-10-02' } };
const oldJob = { id: 4, activity: { staffing_needed_from: '2017-10-01' } };
const tomorrowJob = { id: 5, activity: { staffing_needed_from: '2017-10-05' } };

const givenJobs = [todayJob, yesterdayJob, beforeYesterdayJob, oldJob, tomorrowJob];
const expectedSortedJobs = [todayJob, tomorrowJob, yesterdayJob, beforeYesterdayJob, oldJob];
Expand All @@ -46,11 +44,11 @@ describe.only('Unit | Utils | Project Staffing Needed Date', () => {
// Given
const today = moment('2017-10-04', 'YYYY-MM-DD');

const todayJob1 = {id: 1, activity: {staffing_needed_from: '2017-10-04'}};
const todayJob2 = {id: 2, activity: {staffing_needed_from: '2017-10-04'}};
const todayJob3 = {id: 3, activity: {staffing_needed_from: '2017-10-04'}};
const todayJob4 = {id: 4, activity: {staffing_needed_from: '2017-10-04'}};
const todayJob5 = {id: 5, activity: {staffing_needed_from: '2017-10-04'}};
const todayJob1 = { id: 1, activity: { staffing_needed_from: '2017-10-04' } };
const todayJob2 = { id: 2, activity: { staffing_needed_from: '2017-10-04' } };
const todayJob3 = { id: 3, activity: { staffing_needed_from: '2017-10-04' } };
const todayJob4 = { id: 4, activity: { staffing_needed_from: '2017-10-04' } };
const todayJob5 = { id: 5, activity: { staffing_needed_from: '2017-10-04' } };

const givenJobs = [todayJob1, todayJob2, todayJob3, todayJob4, todayJob5];
const expectedSortedJobs = [todayJob1, todayJob2, todayJob3, todayJob4, todayJob5];
Expand All @@ -65,12 +63,12 @@ describe.only('Unit | Utils | Project Staffing Needed Date', () => {
// Given
const today = moment('2017-10-04', 'YYYY-MM-DD');

const futureJob = {id: 1, activity: {staffing_needed_from: '2017-11-03'}};
const beforeYesterdayJob = {id: 2, activity: {staffing_needed_from: '2017-10-02'}};
const todayJob = {id: 3, activity: {staffing_needed_from: '2017-10-04'}};
const veryOldJob = {id: 4, activity: {staffing_needed_from: '2017-09-15'}};
const yesterdayJob = {id: 5, activity: {staffing_needed_from: '2017-10-03'}};
const oldJob = {id: 6, activity: {staffing_needed_from: '2017-09-08'}};
const futureJob = { id: 1, activity: { staffing_needed_from: '2017-11-03' } };
const beforeYesterdayJob = { id: 2, activity: { staffing_needed_from: '2017-10-02' } };
const todayJob = { id: 3, activity: { staffing_needed_from: '2017-10-04' } };
const veryOldJob = { id: 4, activity: { staffing_needed_from: '2017-09-15' } };
const yesterdayJob = { id: 5, activity: { staffing_needed_from: '2017-10-03' } };
const oldJob = { id: 6, activity: { staffing_needed_from: '2017-09-08' } };


const givenJobs = [futureJob, beforeYesterdayJob, todayJob, veryOldJob, yesterdayJob, oldJob];
Expand Down

0 comments on commit 22e3f33

Please sign in to comment.