Skip to content
Merged
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-226 solved PR comments
  • Loading branch information
eduardisrael committed May 3, 2021
commit e9abab63d71fe30451eab64e3df2d1bf1ee7b24a
Original file line number Diff line number Diff line change
Expand Up @@ -577,10 +577,35 @@ describe('DetailsFieldsComponent', () => {
expect(foundActivity).toEqual(expectedActivity);
});

it('should return false when the start time entry is not greater than the end time', () => {
const result = component.isStartTimeEntryAfterEndedEntry();
const datesParams = [
{
case: 'should return true when the start time entry is greater than the end time',
entryDates: {
start_date: '2021-04-21',
end_date: '2021-04-21',
start_hour: '20:00',
end_hour: '08:00',
},
expected_result: true,
},
{
case: 'should return false when the start time entry is not greater than the end time',
entryDates: {
start_date: '2021-04-21',
end_date: '2021-04-21',
start_hour: '19:00',
end_hour: '20:00',
},
expected_result: false,
},
];
datesParams.map((param) => {
it(`${param.case}`, () => {
component.entryForm.setValue({ ...formValues, ...param.entryDates });
const result = component.isStartTimeEntryAfterEndedEntry();

expect(result).toBeFalse();
expect(result).toBe(param.expected_result);
});
});
/*
TODO As part of https://github.com/ioet/time-tracker-ui/issues/424 a new parameter was added to the details-field-component,
Expand Down