Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Input, OnInit } from '@angular/core';
import { OnInit } from '@angular/core';
import { Component } from '@angular/core';
import { Store, select } from '@ngrx/store';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { FormBuilder, Validators, FormGroup } from '@angular/forms';
import { Component, Input, EventEmitter, Output } from '@angular/core';
import { Store, select } from '@ngrx/store';
import { Activity } from '../../../shared/models';
import { Component } from '@angular/core';
import { Store } from '@ngrx/store';
import { ActivityState } from './../../store/activity-management.reducers';
import { CreateActivity, allActivities } from '../../store';
import { CreateActivity } from '../../store';

@Component({
selector: 'app-create-activity',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { Component, OnInit } from '@angular/core';
import { ActivityService } from '../services/activity.service';
import { Activity } from '../../shared/models';

@Component({
selector: 'app-activities-management',
templateUrl: './activities-management.component.html',
styleUrls: ['./activities-management.component.scss'],
})
export class ActivitiesManagementComponent implements OnInit {
constructor(private activityService: ActivityService) {}
constructor() {}

ngOnInit(): void {}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';

import { environment } from './../../../../environments/environment';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
CreateActivitySuccess,
CreateActivityFail,
CreateActivity,
DeleteActivity,
DeleteActivitySuccess,
} from './activity-management.actions';
import { LoadActivitiesSuccess } from './activity-management.actions';
Expand Down
23 changes: 8 additions & 15 deletions src/app/modules/login/services/azure.ad.b2c.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,24 @@ import { UserAgentApplication, Account } from 'msal';

describe('AzureAdB2CService', () => {
let service: AzureAdB2CService;
const msalStub = {
loginPopup() {
return {};
}
};

beforeEach(() => {
TestBed.configureTestingModule({
imports: []
imports: [],
});
service = TestBed.inject(AzureAdB2CService);
});

it('should be created', inject([AzureAdB2CService],
( apiService: AzureAdB2CService) => {
expect(apiService).toBeTruthy();
it('should be created', inject([AzureAdB2CService], (apiService: AzureAdB2CService) => {
expect(apiService).toBeTruthy();
}));

it('on signIn should call msal loginPopup', () => {
spyOn(UserAgentApplication.prototype, 'loginPopup').and.returnValue((
spyOn(UserAgentApplication.prototype, 'loginPopup').and.returnValue(
new Promise((resolve) => {
resolve();
resolve();
})
));
);
service.signIn();
expect(UserAgentApplication.prototype.loginPopup).toHaveBeenCalled();
});
Expand All @@ -47,7 +41,7 @@ describe('AzureAdB2CService', () => {
idToken: {},
idTokenClaims: {},
sid: 'abc',
environment: 'abc'
environment: 'abc',
};
spyOn(UserAgentApplication.prototype, 'getAccount').and.returnValues(account);

Expand All @@ -66,7 +60,7 @@ describe('AzureAdB2CService', () => {
idToken: {},
idTokenClaims: {},
sid: 'abc',
environment: 'abc'
environment: 'abc',
};
spyOn(UserAgentApplication.prototype, 'getAccount').and.returnValue(account);

Expand All @@ -82,5 +76,4 @@ describe('AzureAdB2CService', () => {
expect(UserAgentApplication.prototype.getAccount).toHaveBeenCalled();
expect(isLogin).toEqual(false);
});

});
10 changes: 4 additions & 6 deletions src/app/modules/reports/pages/reports.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ describe('ReportsComponent', () => {

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ReportsComponent ]
})
.compileComponents();
declarations: [ReportsComponent],
}).compileComponents();
}));

beforeEach(() => {
Expand All @@ -30,13 +29,12 @@ describe('ReportsComponent', () => {
expect(component).toBeTruthy();
});

it('should have p tag as \'reports works!\'', async(() => {
it('should have p tag as "reports works!"', async(() => {
// tslint:disable-next-line: no-shadowed-variable
const { app, fixture } = setup();
const { fixture } = setup();
fixture.detectChanges();
const compile = fixture.debugElement.nativeElement;
const ptag = compile.querySelector('p');
expect(ptag.textContent).toBe('reports works!');
}));

});
13 changes: 6 additions & 7 deletions src/app/modules/shared/components/clock/clock.component.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';
import { interval } from 'rxjs';

@Component({
selector: 'app-clock',
templateUrl: './clock.component.html',
styleUrls: ['./clock.component.scss']
styleUrls: ['./clock.component.scss'],
})
export class ClockComponent {

currentDate: Date = new Date();
hour: number;
minutes: number;
Expand All @@ -20,15 +19,15 @@ export class ClockComponent {
setTimeout(() => {
this.displayTime = true;
}, 3000);
}
}

showClock() {
showClock() {
const timenInterval = interval(1000);
timenInterval.subscribe( (data) => {
timenInterval.subscribe((data) => {
this.currentDate = new Date();
this.hour = this.currentDate.getHours();
this.minutes = this.currentDate.getMinutes();
this.seconds = this.currentDate.getSeconds();
});
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { GroupByDatePipe } from './group-by-date.pipe';
import { Pipe } from '@angular/core';

describe('GroupByDatePipe', () => {
it('create an instance', () => {
Expand All @@ -24,7 +23,7 @@ describe('GroupByDatePipe', () => {
activity: 'development',
technology: 'Angular, TypeScript',
comments: 'No comments',
ticket: 'EY-25'
ticket: 'EY-25',
},
{
id: 'entry_2',
Expand All @@ -34,7 +33,7 @@ describe('GroupByDatePipe', () => {
activity: 'development',
technology: 'Angular, TypeScript',
comments: 'No comments',
ticket: 'EY-38'
ticket: 'EY-38',
},
{
id: 'entry_3',
Expand All @@ -44,7 +43,7 @@ describe('GroupByDatePipe', () => {
activity: 'development',
technology: 'Angular, TypeScript',
comments: 'No comments',
ticket: 'EY-225'
ticket: 'EY-225',
},
{
id: 'entry_4',
Expand All @@ -54,7 +53,7 @@ describe('GroupByDatePipe', () => {
activity: 'development',
technology: 'Angular, TypeScript',
comments: 'No comments',
ticket: 'EY-89'
ticket: 'EY-89',
},
{
id: 'entry_5',
Expand All @@ -64,8 +63,8 @@ describe('GroupByDatePipe', () => {
activity: 'development',
technology: 'Angular, TypeScript',
comments: 'No comments',
ticket: 'EY-59'
}
ticket: 'EY-59',
},
];
const pipe = new GroupByDatePipe();
const result = pipe.transform(entryList);
Expand Down
21 changes: 5 additions & 16 deletions src/app/modules/time-entries/pages/time-entries.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
MonthPickerComponent,
DetailsFieldsComponent,
EmptyStateComponent,
ModalComponent
ModalComponent,
} from '../../shared/components';
import { GroupByDatePipe } from '../../shared/pipes';
import { TimeEntriesComponent } from './time-entries.component';
Expand All @@ -21,16 +21,9 @@ describe('TimeEntriesComponent', () => {
activity: 'development',
technology: 'Angular, TypeScript',
comments: 'No comments',
ticket: 'EY-25'
ticket: 'EY-25',
};

function setup() {
// tslint:disable-next-line: no-shadowed-variable
const fixture = TestBed.createComponent(TimeEntriesComponent);
const app = fixture.debugElement.componentInstance;
return { fixture, app };
}

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
Expand All @@ -39,14 +32,10 @@ describe('TimeEntriesComponent', () => {
GroupByDatePipe,
ModalComponent,
MonthPickerComponent,
TimeEntriesComponent
TimeEntriesComponent,
],
imports: [
FormsModule,
ReactiveFormsModule
]
})
.compileComponents();
imports: [FormsModule, ReactiveFormsModule],
}).compileComponents();
}));

beforeEach(() => {
Expand Down
5 changes: 4 additions & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"deprecation": {
"severity": "warning"
},
"no-unused-variable": {
"severity": "warning"
},
"component-class-suffix": true,
"contextual-lifecycle": true,
"directive-class-suffix": true,
Expand Down Expand Up @@ -88,4 +91,4 @@
"rulesDirectory": [
"codelyzer"
]
}
}