Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: TT-653 Add conditions when an user is currently working on a task (
  • Loading branch information
almeida-erick authored May 12, 2022
commit b46f511db79d7c07829c02b77a6f5573e275c263
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ describe('Reports Page', () => {

it('Should populate the users with the payload from the action executed', () => {
const actionSubject = TestBed.inject(ActionsSubject) as ActionsSubject;
const usersArray = []
const usersArray = [];
const action = {
type: UserActionTypes.LOAD_USERS_SUCCESS,
payload: usersArray
Expand All @@ -201,7 +201,7 @@ describe('Reports Page', () => {

expect(component.users).toEqual(usersArray);
});

it('The sum of the data dates is equal to {"hours": 3, "minutes":20,"seconds":0}', () => {
let {hours,minutes,seconds}: TotalHours = component.sumDates(timeEntryList);
expect({hours, minutes, seconds}).toEqual({hours:3,minutes:20,seconds:0});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {

const isStartDateInTheFuture = moment(startDateToSubmit).isAfter(moment());
const isEndDateInTheFuture = moment(endDateToSubmit).isAfter(moment());
const timeEntryIsInTheFuture = isStartDateInTheFuture || isEndDateInTheFuture;
const timeEntryIsInTheFuture = isStartDateInTheFuture || (isEndDateInTheFuture && !this.goingToWorkOnThis);

if (timeEntryIsInTheFuture) {
this.toastrService.error('You cannot start a time-entry in the future');
Expand Down