Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
217fbb8
feat: TT-208 add new column in activity-list
thegreatyamori Apr 19, 2021
6c1c06f
feat: TT-208 add switch status button in column
thegreatyamori Apr 19, 2021
dc10fcf
feat: TT-208 remove delete button & assign openmodal to switch
thegreatyamori Apr 20, 2021
fb37b3b
feat: TT-208 connect switch btn with ngrx flux
thegreatyamori Apr 20, 2021
f0275f8
feat: TT-208 update ngrx delete flux
thegreatyamori Apr 20, 2021
e8ee50f
feat: TT-208 show active activities in entry & details fields
thegreatyamori Apr 21, 2021
a62c980
feat: TT-208 change ui-switch to button
thegreatyamori Apr 22, 2021
5c19c86
fix: TT-208 display the required activities when clicking on time en…
thegreatyamori Apr 26, 2021
a76051c
Merge branch 'master' into TT-208-don't-allow-deleting-activities
thegreatyamori Apr 26, 2021
aa698ee
feat: TT-208 add new column in activity-list
thegreatyamori Apr 26, 2021
5ca9a8f
feat: TT-208 add switch status button in column
thegreatyamori Apr 26, 2021
17d5acd
feat: TT-208 remove delete button & assign openmodal to switch
thegreatyamori Apr 26, 2021
90742ad
feat: TT-208 connect switch btn with ngrx flux
thegreatyamori Apr 26, 2021
4977dff
feat: TT-208 update ngrx delete flux
thegreatyamori Apr 26, 2021
1d0107d
feat: TT-208 show active activities in entry & details fields
thegreatyamori Apr 21, 2021
5808250
feat: TT-208 change ui-switch to button
thegreatyamori Apr 22, 2021
286033c
fix: TT-208 display the required activities when clicking on time en…
thegreatyamori Apr 26, 2021
3a5e107
feat: TT-208 rebase on latest master commit
thegreatyamori Apr 26, 2021
1c9ee96
fix: TT-208 merging conflicts
thegreatyamori Apr 26, 2021
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
Merge branch 'master' into TT-208-don't-allow-deleting-activities
  • Loading branch information
thegreatyamori authored Apr 26, 2021
commit a76051c547812265c938af4848a1af13e20768f3
Original file line number Diff line number Diff line change
Expand Up @@ -518,10 +518,9 @@ describe('DetailsFieldsComponent', () => {

it('on the input with id #start_date we could get the id and max value', () => {
fixture.detectChanges();
const expectedDate = new Date().toISOString().split('T')[0];
const expectedDate = moment(new Date()).format(DATE_FORMAT_YEAR);
const startDateInput: HTMLInputElement = fixture.debugElement.
nativeElement.querySelector(`input[id="start_date"],input[max="${component.getCurrentDate()}"]`);

nativeElement.querySelector(`input[id="start_date"],input[max="${component.getCurrentDate()}"]`);
expect(startDateInput.id).toEqual('start_date');
expect(startDateInput.max).toEqual(expectedDate);
});
Expand All @@ -535,6 +534,37 @@ describe('DetailsFieldsComponent', () => {
expect(endDateInput.max).toEqual(expectedDate);
});

const diffParams = [
{
case: 'positive should return correctly diff',
entryDates: {
start_date: '2021-04-15',
end_date: '2021-04-15',
start_hour: '18:05',
end_hour: '19:00',
},
expectedTimeDiff: '00:55',
},
{
case: 'negative should return 00:00',
entryDates: {
start_date: '2021-04-15',
end_date: '2021-04-14',
start_hour: '18:05',
end_hour: '17:00',
},
expectedTimeDiff: '00:00',
},
];
diffParams.map((param) => {
it(`if [start_date, start_hour] and [end_date, end_hour] diff is ${param.case}`, () => {
component.entryForm.setValue({ ...formValues, ...param.entryDates });
const timeDiff = component.getTimeDifference();

expect(timeDiff).toBe(param.expectedTimeDiff);
});
});

it('should find an activity with given id & status: inactive', () => {

const expectedActivity = { id: 'fc5fab41-a21e-4155-9d05-511b956ebd08', tenant_id: 'ioet_2', deleted: null, name: 'ghi', status: 'inactive' };
Expand All @@ -545,6 +575,7 @@ describe('DetailsFieldsComponent', () => {
const foundActivity = component.findInactiveActivity(state.activities.data);
expect(foundActivity).toEqual(expectedActivity);
});

/*
TODO As part of https://github.com/ioet/time-tracker-ui/issues/424 a new parameter was added to the details-field-component,
and now these couple of tests are failing. A solution to this error might be generate a Test Wrapper Component. More details here:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { ProjectSelectedEvent } from './project-selected-event';
import { get } from 'lodash';
import { DATE_FORMAT, DATE_FORMAT_YEAR } from 'src/environments/environment';
import { TechnologiesComponent } from '../technologies/technologies.component';
import { MatDatepicker } from '@angular/material/datepicker';
import { Observable } from 'rxjs';

type Merged = TechnologyState & ProjectState & ActivityState & EntryState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,9 @@ describe('EntryFieldsComponent', () => {
it('when FT "update-entries" disable for the user,the UpdateCurrentOrLastEntry function is called to update the entries', () => {
spyOn(featureToggleGeneralService, 'isActivated').and.returnValue(of(false));

const mockEntry = {
...entry,
start_date: moment().format(DATE_FORMAT_YEAR),
start_hour: moment().format('HH:mm'),
update_last_entry_if_overlap: false
const mockEntry = { ...entry,
start_date : moment().format(DATE_FORMAT_YEAR),
start_hour : moment().format('HH:mm')
};
component.newData = mockEntry;
featureToggleGeneralService.isActivated(FeatureToggle.UPDATE_ENTRIES).subscribe(() => {
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.