From 90d93a55668d32c9d4fb2b6c146fded7ab78a386 Mon Sep 17 00:00:00 2001 From: Cristina Guncay Date: Wed, 1 Apr 2020 19:25:16 -0500 Subject: [PATCH] #3 Time Clock - find project --- src/app/app.module.ts | 20 ++--- .../project-list/project-list.component.html | 42 +++++++--- .../project-list.component.spec.ts | 10 +-- .../project-list/project-list.component.ts | 17 ++--- .../project-management.component.spec.ts | 76 +++++++++---------- .../search-project.component.html | 3 + .../search-project.component.scss | 0 .../search-project.component.spec.ts | 31 ++++++++ .../search-project.component.ts | 22 ++++++ .../filter-project.pipe.spec.ts | 40 ++++++++++ .../filter-project/filter-project.pipe.ts | 17 +++++ src/app/modules/shared/pipes/index.ts | 1 + .../project-list-hover.component.html | 13 ++-- .../project-list-hover.component.scss | 5 ++ .../project-list-hover.component.spec.ts | 22 ++++-- .../project-list-hover.component.ts | 12 ++- .../pages/time-clock.component.html | 49 ++++++------ .../pages/time-clock.component.spec.ts | 61 ++++++++------- src/assets/project.json | 28 +++++++ 19 files changed, 323 insertions(+), 146 deletions(-) create mode 100644 src/app/modules/shared/components/search-project/search-project.component.html create mode 100644 src/app/modules/shared/components/search-project/search-project.component.scss create mode 100644 src/app/modules/shared/components/search-project/search-project.component.spec.ts create mode 100644 src/app/modules/shared/components/search-project/search-project.component.ts create mode 100644 src/app/modules/shared/pipes/filter-project/filter-project.pipe.spec.ts create mode 100644 src/app/modules/shared/pipes/filter-project/filter-project.pipe.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index f310c20ff..7bdac1471 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -24,7 +24,8 @@ import { GroupByDatePipe } from './modules/shared/pipes/group-by-date/group-by-d import { ActivitiesManagementComponent } from './modules/activities-management/pages/activities-management.component'; import { ActivityListComponent } from './modules/activities-management/components/activity-list/activity-list.component'; import { CreateActivityComponent } from './modules/activities-management/components/create-activity/create-activity.component'; - +import { FilterProjectPipe } from './modules/shared/pipes/filter-project/filter-project.pipe'; +import { SearchProjectComponent } from './modules/shared/components/search-project/search-project.component'; import { HomeComponent } from './modules/home/home.component'; import { LoginComponent } from './modules/login/login.component'; @@ -51,17 +52,12 @@ import { LoginComponent } from './modules/login/login.component'; CreateActivityComponent, ActivityListComponent, HomeComponent, - LoginComponent - ], - imports: [ - CommonModule, - BrowserModule, - AppRoutingModule, - FormsModule, - ReactiveFormsModule, - HttpClientModule + LoginComponent, + FilterProjectPipe, + SearchProjectComponent, ], + imports: [CommonModule, BrowserModule, AppRoutingModule, FormsModule, ReactiveFormsModule, HttpClientModule], providers: [], - bootstrap: [AppComponent] + bootstrap: [AppComponent], }) -export class AppModule { } +export class AppModule {} diff --git a/src/app/modules/project-management/components/project-list/project-list.component.html b/src/app/modules/project-management/components/project-list/project-list.component.html index e89f60631..4765d5255 100644 --- a/src/app/modules/project-management/components/project-list/project-list.component.html +++ b/src/app/modules/project-management/components/project-list/project-list.component.html @@ -1,28 +1,40 @@
+ +
-
+
-
+
Details:
-

{{project.details}}

+

{{ project.details }}

Status:
-

{{project.status}}

+

{{ project.status }}

Completed project:
-

{{project.completed ? 'Yes' : 'No'}}

+

{{ project.completed ? 'Yes' : 'No' }}

@@ -34,8 +46,14 @@
Completed project:
- diff --git a/src/app/modules/project-management/components/project-list/project-list.component.spec.ts b/src/app/modules/project-management/components/project-list/project-list.component.spec.ts index 71168eb8a..82394f593 100644 --- a/src/app/modules/project-management/components/project-list/project-list.component.spec.ts +++ b/src/app/modules/project-management/components/project-list/project-list.component.spec.ts @@ -1,6 +1,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ProjectListComponent } from './project-list.component'; +import { FilterProjectPipe } from '../../../shared/pipes'; describe('ProjectListComponent', () => { let component: ProjectListComponent; @@ -8,9 +9,8 @@ describe('ProjectListComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ProjectListComponent ] - }) - .compileComponents(); + declarations: [ProjectListComponent, FilterProjectPipe], + }).compileComponents(); })); beforeEach(() => { @@ -29,7 +29,7 @@ describe('ProjectListComponent', () => { name: 'app 4', details: 'It is a good app', status: 'inactive', - completed: true + completed: true, }; component.projectToDelete = project; @@ -45,7 +45,7 @@ describe('ProjectListComponent', () => { name: 'app 4', details: 'It is a good app', status: 'inactive', - completed: true + completed: true, }; component.openModal(project); diff --git a/src/app/modules/project-management/components/project-list/project-list.component.ts b/src/app/modules/project-management/components/project-list/project-list.component.ts index 047b981e3..c1372d3e3 100644 --- a/src/app/modules/project-management/components/project-list/project-list.component.ts +++ b/src/app/modules/project-management/components/project-list/project-list.component.ts @@ -1,30 +1,23 @@ -import { - Component, - OnInit, - Input, - Output, - EventEmitter -} from '@angular/core'; +import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; import { Project } from '../../../shared/models'; @Component({ selector: 'app-project-list', templateUrl: './project-list.component.html', - styleUrls: ['./project-list.component.scss'] + styleUrls: ['./project-list.component.scss'], }) export class ProjectListComponent implements OnInit { - @Input() projects: Project[] = []; @Output() editProject = new EventEmitter(); @Output() deleteProject = new EventEmitter(); projectToDelete: Project; openDeleteModal = false; + filterProjects = ''; - constructor() { } + constructor() {} - ngOnInit(): void { - } + ngOnInit(): void {} openModal(projectData) { this.projectToDelete = projectData; diff --git a/src/app/modules/project-management/pages/project-management.component.spec.ts b/src/app/modules/project-management/pages/project-management.component.spec.ts index 6caae8b40..f7b2c0eb2 100644 --- a/src/app/modules/project-management/pages/project-management.component.spec.ts +++ b/src/app/modules/project-management/pages/project-management.component.spec.ts @@ -6,52 +6,50 @@ import { CreateProjectComponent, ProjectListComponent } from '../components'; import { Project } from '../../shared/models'; import { ProjectManagementComponent } from './project-management.component'; import { ProjectService } from '../services/project.service'; +import { FilterProjectPipe } from '../../shared/pipes'; describe('ProjectManagementComponent', () => { let component: ProjectManagementComponent; let fixture: ComponentFixture; let projectService: ProjectService; - const projects: Project[] = [{ - id: '1', - name: 'app 1', - details: 'It is a good app', - status: 'inactive', - completed: true - }, - { - id: '2', - name: 'app 2', - details: 'It is a good app', - status: 'inactive', - completed: false - }, - { - id: '3', - name: 'app 3', - details: 'It is a good app', - status: 'active', - completed: true - } + const projects: Project[] = [ + { + id: '1', + name: 'app 1', + details: 'It is a good app', + status: 'inactive', + completed: true, + }, + { + id: '2', + name: 'app 2', + details: 'It is a good app', + status: 'inactive', + completed: false, + }, + { + id: '3', + name: 'app 3', + details: 'It is a good app', + status: 'active', + completed: true, + }, ]; const projectServiceStub = { getProjects() { const projectsMock = projects; return of(projectsMock); - } + }, }; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ProjectManagementComponent, CreateProjectComponent, ProjectListComponent ], - providers: [ { provide: ProjectService, useValue: projectServiceStub }], - imports: [ - FormsModule, - ReactiveFormsModule - ] - }) - .compileComponents(); + declarations: [ProjectManagementComponent, CreateProjectComponent, ProjectListComponent, FilterProjectPipe], + providers: [{ provide: ProjectService, useValue: projectServiceStub }], + imports: [FormsModule, ReactiveFormsModule], + }).compileComponents(); })); beforeEach(() => { @@ -63,12 +61,12 @@ describe('ProjectManagementComponent', () => { component.projects = projects; }); - - it('Service injected via inject(...) and TestBed.get(...) should be the same instance', - inject([ProjectService], (injectService: ProjectService) => { + it('Service injected via inject(...) and TestBed.get(...) should be the same instance', inject( + [ProjectService], + (injectService: ProjectService) => { expect(injectService).toBe(projectService); - }) - ); + } + )); it('should create', () => { expect(component).toBeTruthy(); @@ -79,7 +77,7 @@ describe('ProjectManagementComponent', () => { name: 'app 4', details: 'It is a good app', status: 'inactive', - completed: true + completed: true, }; component.editedProjectId = null; @@ -93,7 +91,7 @@ describe('ProjectManagementComponent', () => { name: 'app test', details: 'It is a excelent app', status: 'inactive', - completed: true + completed: true, }; component.editedProjectId = '1'; @@ -117,7 +115,7 @@ describe('ProjectManagementComponent', () => { name: 'app 1', details: 'It is a good app', status: 'inactive', - completed: true + completed: true, }; component.project = project; @@ -138,9 +136,7 @@ describe('ProjectManagementComponent', () => { expect(componentSpy).toHaveBeenCalledTimes(1); }); - it('should call getProjects and return a list of projects', async(() => { - spyOn(projectService, 'getProjects').and.returnValue(of(projects)); component.ngOnInit(); diff --git a/src/app/modules/shared/components/search-project/search-project.component.html b/src/app/modules/shared/components/search-project/search-project.component.html new file mode 100644 index 000000000..f473bc821 --- /dev/null +++ b/src/app/modules/shared/components/search-project/search-project.component.html @@ -0,0 +1,3 @@ +
+ +
\ No newline at end of file diff --git a/src/app/modules/shared/components/search-project/search-project.component.scss b/src/app/modules/shared/components/search-project/search-project.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/modules/shared/components/search-project/search-project.component.spec.ts b/src/app/modules/shared/components/search-project/search-project.component.spec.ts new file mode 100644 index 000000000..72133452f --- /dev/null +++ b/src/app/modules/shared/components/search-project/search-project.component.spec.ts @@ -0,0 +1,31 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SearchProjectComponent } from './search-project.component'; + +describe('SearchProjectComponent', () => { + let component: SearchProjectComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [SearchProjectComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SearchProjectComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); + + it('should emit changeFilterProject event #changeFilterValue', () => { + component.filterProject = 'angular'; + spyOn(component.changeFilterProject, 'emit'); + component.changeFilterValue(); + expect(component.changeFilterProject.emit).toHaveBeenCalled(); + }); +}); diff --git a/src/app/modules/shared/components/search-project/search-project.component.ts b/src/app/modules/shared/components/search-project/search-project.component.ts new file mode 100644 index 000000000..921bed28b --- /dev/null +++ b/src/app/modules/shared/components/search-project/search-project.component.ts @@ -0,0 +1,22 @@ +import { Component, OnInit, Output, EventEmitter } from '@angular/core'; + +@Component({ + selector: 'app-search-project', + templateUrl: './search-project.component.html', + styleUrls: ['./search-project.component.scss'] +}) +export class SearchProjectComponent implements OnInit { + + filterProject: string; + @Output() changeFilterProject = new EventEmitter(); + + constructor() { } + + ngOnInit(): void { + } + + changeFilterValue() { + this.changeFilterProject.emit(this.filterProject); + } + +} diff --git a/src/app/modules/shared/pipes/filter-project/filter-project.pipe.spec.ts b/src/app/modules/shared/pipes/filter-project/filter-project.pipe.spec.ts new file mode 100644 index 000000000..014bb53ba --- /dev/null +++ b/src/app/modules/shared/pipes/filter-project/filter-project.pipe.spec.ts @@ -0,0 +1,40 @@ +import { FilterProjectPipe } from './filter-project.pipe'; +import { Project } from '../../../shared/models'; + +describe('FilterProjectPipe', () => { + const projects: Project[] = [ + { + id: '1', + name: 'app 1', + details: 'It is a good app', + status: 'inactive', + completed: true, + }, + { + id: '2', + name: 'app 2', + details: 'It is a good app', + status: 'inactive', + completed: false, + }, + { + id: '3', + name: 'app 3', + details: 'It is a good app', + status: 'active', + completed: true, + }, + ]; + + it('create an instance', () => { + const pipe = new FilterProjectPipe(); + expect(pipe).toBeTruthy(); + }); + + it('test method of pipe #transform', () => { + const restultProjects = projects; + const searchProject = 'app 1'; + const result = new FilterProjectPipe().transform(restultProjects, searchProject); + expect(result.length).toEqual(1); + }); +}); diff --git a/src/app/modules/shared/pipes/filter-project/filter-project.pipe.ts b/src/app/modules/shared/pipes/filter-project/filter-project.pipe.ts new file mode 100644 index 000000000..e0337a24a --- /dev/null +++ b/src/app/modules/shared/pipes/filter-project/filter-project.pipe.ts @@ -0,0 +1,17 @@ +import { Pipe, PipeTransform } from '@angular/core'; +import { Project } from 'src/app/modules/shared/models/project.model'; + +@Pipe({ + name: 'filterProject', +}) +export class FilterProjectPipe implements PipeTransform { + transform(value: Project[] = [], arg: string): string[] { + const restultProjects = []; + for (const project of value) { + if (project.name.toLowerCase().indexOf(arg.toLowerCase()) > -1) { + restultProjects.push(project); + } + } + return restultProjects; + } +} diff --git a/src/app/modules/shared/pipes/index.ts b/src/app/modules/shared/pipes/index.ts index ee3b350d2..909e1dd29 100644 --- a/src/app/modules/shared/pipes/index.ts +++ b/src/app/modules/shared/pipes/index.ts @@ -1 +1,2 @@ export * from './group-by-date/group-by-date.pipe'; +export * from './filter-project/filter-project.pipe'; diff --git a/src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.html b/src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.html index 212bf4d2d..d4516ae96 100644 --- a/src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.html +++ b/src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.html @@ -1,17 +1,14 @@ +
  • {{ item.name }} - Clock In + Clock In
diff --git a/src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.scss b/src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.scss index a715a449b..a00b3fcc1 100644 --- a/src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.scss +++ b/src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.scss @@ -3,10 +3,15 @@ overflow-x: auto; li { + display: flex; cursor: pointer; font-size: 0.8rem; padding: 0.5rem 0.8rem; } + + .hiddenList { + display: none; + } } .button-clockIn { diff --git a/src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.spec.ts b/src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.spec.ts index 9b097131e..926037e2f 100644 --- a/src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.spec.ts +++ b/src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.spec.ts @@ -1,14 +1,20 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { async, ComponentFixture, TestBed, inject } from '@angular/core/testing'; +import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { ProjectListHoverComponent } from './project-list-hover.component'; +import { ProjectService } from '../../../project-management/services/project.service'; +import { FilterProjectPipe } from '../../../shared/pipes'; describe('ProjectListHoverComponent', () => { let component: ProjectListHoverComponent; let fixture: ComponentFixture; + let projectService: ProjectService; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ProjectListHoverComponent] + declarations: [ProjectListHoverComponent, FilterProjectPipe], + imports: [HttpClientTestingModule], + providers: [ProjectService], }).compileComponents(); })); @@ -16,6 +22,7 @@ describe('ProjectListHoverComponent', () => { fixture = TestBed.createComponent(ProjectListHoverComponent); component = fixture.componentInstance; fixture.detectChanges(); + projectService = TestBed.inject(ProjectService); }); it('should create', () => { @@ -30,9 +37,14 @@ describe('ProjectListHoverComponent', () => { it('should emit showFields event', () => { const id = 'P1'; - component.showFields.subscribe((showFields: boolean) => - expect(showFields).toEqual(true) - ); + component.showFields.subscribe((showFields: boolean) => expect(showFields).toEqual(true)); component.clockIn(id); }); + + it('Service injected via inject(...) and TestBed.get(...) should be the same instance', inject( + [ProjectService], + (injectService: ProjectService) => { + expect(injectService).toBe(projectService); + } + )); }); diff --git a/src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.ts b/src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.ts index df6c79908..9ed01fe11 100644 --- a/src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.ts +++ b/src/app/modules/time-clock/components/project-list-hover/project-list-hover.component.ts @@ -1,9 +1,11 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; +import { Project } from 'src/app/modules/shared/models'; +import { ProjectService } from 'src/app/modules/project-management/services/project.service'; @Component({ selector: 'app-project-list-hover', templateUrl: './project-list-hover.component.html', - styleUrls: ['./project-list-hover.component.scss'] + styleUrls: ['./project-list-hover.component.scss'], }) export class ProjectListHoverComponent implements OnInit { @Input() projects: any; @@ -11,12 +13,16 @@ export class ProjectListHoverComponent implements OnInit { selectedId: string; showButton: number; + filterProjects = ''; + listProjects: Project[] = []; - constructor() { + constructor(private projectService: ProjectService) { this.showButton = -1; } - ngOnInit(): void {} + ngOnInit(): void { + this.projectService.getProjects().subscribe((data) => (this.listProjects = data)); + } clockIn(id: string) { this.selectedId = id; diff --git a/src/app/modules/time-clock/pages/time-clock.component.html b/src/app/modules/time-clock/pages/time-clock.component.html index b7dfb02f9..2b2cdb92b 100644 --- a/src/app/modules/time-clock/pages/time-clock.component.html +++ b/src/app/modules/time-clock/pages/time-clock.component.html @@ -1,5 +1,4 @@
- @@ -17,10 +16,16 @@
-

{{ username }} clocked in at {{ hour | number: '2.0-2' }}:{{ minute | number: '2.0-2' }}:{{ seconds | number: '2.0-2' }}

-

{{ username }} clocked out at {{ hour | number: '2.0-2' }}:{{ minute | number: '2.0-2' }}:{{ seconds | number: '2.0-2' }}

+

+ {{ username }} clocked in at + {{ hour | number: '2.0-2' }}:{{ minute | number: '2.0-2' }}:{{ seconds | number: '2.0-2' }} +

+

+ {{ username }} clocked out at + {{ hour | number: '2.0-2' }}:{{ minute | number: '2.0-2' }}:{{ seconds | number: '2.0-2' }} +

Totals
-
+
Current
@@ -36,51 +41,51 @@

14:00

Projects
-
-
- -
-
-

Top

-
+
- +
- +
- +
-
+
-
- - + +
diff --git a/src/app/modules/time-clock/pages/time-clock.component.spec.ts b/src/app/modules/time-clock/pages/time-clock.component.spec.ts index 22efae704..0a5ddc159 100644 --- a/src/app/modules/time-clock/pages/time-clock.component.spec.ts +++ b/src/app/modules/time-clock/pages/time-clock.component.spec.ts @@ -1,17 +1,24 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { async, ComponentFixture, TestBed, inject } from '@angular/core/testing'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; import { DebugElement } from '@angular/core'; import { By } from '@angular/platform-browser'; + import { TimeClockComponent } from './time-clock.component'; import { ProjectListHoverComponent } from '../components'; +import { ProjectService } from '../../project-management/services/project.service'; +import { FilterProjectPipe } from '../../shared/pipes'; describe('TimeClockComponent', () => { let component: TimeClockComponent; let fixture: ComponentFixture; let de: DebugElement; + let projectService: ProjectService; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [TimeClockComponent, ProjectListHoverComponent] + imports: [HttpClientTestingModule], + declarations: [TimeClockComponent, ProjectListHoverComponent, FilterProjectPipe], + providers: [ProjectService], }).compileComponents(); })); @@ -20,12 +27,20 @@ describe('TimeClockComponent', () => { component = fixture.componentInstance; de = fixture.debugElement; fixture.detectChanges(); + projectService = TestBed.inject(ProjectService); }); it('should be created', () => { expect(component).toBeTruthy(); }); + it('Service injected via inject(...) and TestBed.get(...) should be the same instance', inject( + [ProjectService], + (injectService: ProjectService) => { + expect(injectService).toBe(projectService); + } + )); + it('should set showfileds as true', () => { const show = true; component.setShowFields(show); @@ -40,16 +55,8 @@ describe('TimeClockComponent', () => { expect(component.setShowFields).toHaveBeenCalledWith(true); }); - it('should be called the setShowFields event #2', () => { - spyOn(component, 'setShowFields'); - const showFields = de.query(By.directive(ProjectListHoverComponent)); - const li = showFields.query(By.css('li')); - li.nativeElement.click(); - expect(component.setShowFields).toHaveBeenCalledWith(true); - }); - /* ---------------------- EMPLOYE CLOCK IN ------------------------------------- */ - it('should be verify the init state of vars' , () => { + it('should be verify the init state of vars', () => { expect(component.isClockIn).toBeTruthy(); expect(component.isEnterTechnology).toBeFalsy(); expect(component.showAlertEnterTecnology).toBeFalsy(); @@ -68,17 +75,17 @@ describe('TimeClockComponent', () => { expect(component.seconds).toEqual(0); }); - it('should be change state of isClockInEnale, isClockIn, isHidenForm when function is called' , () => { + it('should be change state of isClockInEnale, isClockIn, isHidenForm when function is called', () => { component.employeClockIn(); expect(component.isClockInEnable).toBeTruthy(); expect(component.isClockIn).toBeFalsy(); }); - it('the function should return false' , () => { + it('the function should return false', () => { expect(component.employeClockIn()).toEqual(false); }); - it('should be called to intern methods of employeClockIn' , () => { + it('should be called to intern methods of employeClockIn', () => { spyOn(component, 'startTimer'); spyOn(component, 'setArrivalAndDepartureTimes'); @@ -89,14 +96,14 @@ describe('TimeClockComponent', () => { }); /* ---------------------- EMPLOYE CLOCK OUT ------------------------------------- */ - it('should enter if and assign the value to vars' , () => { + it('should enter if and assign the value to vars', () => { component.isEnterTechnology = false; component.employeClockOut(); expect(component.isClockIn).toBeFalsy(); expect(component.showAlertEnterTecnology).toBeTruthy(); }); - it('should enter if and not called to intern methods' , () => { + it('should enter if and not called to intern methods', () => { component.isEnterTechnology = false; spyOn(component, 'setDefaultValuesToFields'); spyOn(component, 'pauseTimer'); @@ -107,7 +114,7 @@ describe('TimeClockComponent', () => { expect(component.setArrivalAndDepartureTimes).not.toHaveBeenCalled(); }); - it('should enter else and execute internal methods' , () => { + it('should enter else and execute internal methods', () => { component.isEnterTechnology = true; spyOn(component, 'setDefaultValuesToFields'); @@ -121,21 +128,21 @@ describe('TimeClockComponent', () => { expect(component.setArrivalAndDepartureTimes).toHaveBeenCalled(); }); -/* ---------------------- ENTER TECHNOLOGY ------------------------------------- */ - it('should enter if and assign the value to var' , () => { + /* ---------------------- ENTER TECHNOLOGY ------------------------------------- */ + it('should enter if and assign the value to var', () => { const dataTechnology = 'Angular'; component.enterTechnology(dataTechnology); expect(component.isEnterTechnology).toBeTruthy(); }); - it('should enter else and assign the value to var ' , () => { + it('should enter else and assign the value to var ', () => { const dataTechnology = ''; component.enterTechnology(dataTechnology); expect(component.isEnterTechnology).toBeFalsy(); }); /* ---------------------- SET SHOW FIELDS ------------------------------------- */ - it('should execute all internal methods' , () => { + it('should execute all internal methods', () => { const show = true; component.isClockInEnable = false; component.execOnlyOneTimeCounter = false; @@ -153,7 +160,7 @@ describe('TimeClockComponent', () => { expect(component.setArrivalAndDepartureTimes).toHaveBeenCalled(); }); - it('should not call nested if internal methods' , () => { + it('should not call nested if internal methods', () => { const show = true; component.isClockInEnable = false; component.execOnlyOneTimeCounter = true; @@ -171,7 +178,7 @@ describe('TimeClockComponent', () => { expect(component.setArrivalAndDepartureTimes).toHaveBeenCalled(); }); - it('shouldn not execute any main if method' , () => { + it('shouldn not execute any main if method', () => { const show = true; component.isClockInEnable = true; component.execOnlyOneTimeCounter = true; @@ -190,13 +197,13 @@ describe('TimeClockComponent', () => { }); /* ---------------------- TIMER ------------------------------------- */ - it('should be var not equal to zero' , () => { + it('should be var not equal to zero', () => { component.timer(); expect(component.secondsCounterRealTime).not.toEqual(0); }); /* ---------------------- ARRIVALS ------------------------------------- */ - it('should execute intern methods of arrivals' , () => { + it('should execute intern methods of arrivals', () => { const currentDate = new Date(); component.execOnlyOneTimeClockIn = false; component.setArrivalAndDepartureTimes(); @@ -206,7 +213,7 @@ describe('TimeClockComponent', () => { expect(component.execOnlyOneTimeClockIn).toEqual(true); }); - it('should not execute intern methods of arrivals' , () => { + it('should not execute intern methods of arrivals', () => { component.execOnlyOneTimeClockIn = true; component.setArrivalAndDepartureTimes(); expect(component.hour).toEqual(0); @@ -216,7 +223,7 @@ describe('TimeClockComponent', () => { }); /* ---------------------- DEFAULT FIELDS ------------------------------------- */ - it('set values to empty' , () => { + it('set values to empty', () => { component.setDefaultValuesToFields(); expect(component.isHidenForm).toBeTruthy(); expect(component.isClockIn).toBeTruthy(); diff --git a/src/assets/project.json b/src/assets/project.json index 440418f9c..4834399c4 100644 --- a/src/assets/project.json +++ b/src/assets/project.json @@ -12,5 +12,33 @@ "details": "It's a good app to play Lottery", "status": "Inactive", "completed": true + }, + { + "id": 3, + "name": "Facebook", + "details": "It's a good app", + "status": "Active", + "completed": true + }, + { + "id": 4, + "name": "Insagram", + "details": "It's a good app", + "status": "Active", + "completed": true + }, + { + "id": 5, + "name": "Youtube", + "details": "It's a good app", + "status": "Active", + "completed": true + }, + { + "id": 6, + "name": "XDA", + "details": "It's a good app", + "status": "Active", + "completed": true } ]