Skip to content
Closed
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
fix: TT-289 remove non-relevant anymore test cases, after fist changes
  • Loading branch information
bytesantiago committed Jul 22, 2021
commit 04aa35773a05e2b8d1ad93db75fff125c6356dbe
Original file line number Diff line number Diff line change
Expand Up @@ -418,19 +418,6 @@ describe('DetailsFieldsComponent', () => {
expect(component.saveEntry.emit).toHaveBeenCalledWith(data);
});

it('should not modify the start_date when start_hour has not been modified', () => {
const currentDate = moment().format('YYYY-MM-DD');
const startHour = moment().subtract(3, 'hours').format('HH:mm:ss');
const expectedStartDate = new Date(`${currentDate}T${startHour.trim()}`);

component.entryToEdit = { ...entryToEdit, start_date: expectedStartDate };
fixture.componentInstance.ngOnChanges();

component.entryForm.patchValue({ description: 'test' });

expect(component.dateToSubmit('start_date', 'start_hour')).toEqual(expectedStartDate);
});

it('should modify the start_date when start_hour has been modified', () => {
const startDate = new Date(mockCurrentDate);

Expand All @@ -445,19 +432,6 @@ describe('DetailsFieldsComponent', () => {
expect(component.dateToSubmit('start_date', 'start_hour')).toEqual(expectedStartDate);
});

it('should not modify the end_date when end_hour has not been modified', () => {
const currentDate = moment().format('YYYY-MM-DD');
const endHour = moment().subtract(3, 'hours').format('HH:mm:ss');
const expectedEndDate = new Date(`${currentDate}T${endHour.trim()}`);

component.entryToEdit = { ...entryToEdit, end_date: expectedEndDate };
fixture.componentInstance.ngOnChanges();

component.entryForm.patchValue({ description: 'test' });

expect(component.dateToSubmit('end_date', 'end_hour')).toEqual(expectedEndDate);
});

it('should modify the end_date when end_hour has been modified', () => {
const endDate = new Date(mockCurrentDate);

Expand Down