Skip to content

Commit 7803290

Browse files
committed
fixed test
1 parent c21fc61 commit 7803290

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/app/components/options-sidebar/time-clock/time-clock.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ describe('TimeClockComponent', () => {
3333
expect(component).toBeTruthy();
3434
});
3535

36-
it('should have p tag as \'Dario clocked out at hh:mm:ss\'', async(() => {
36+
it('should have p tag as \'Dario clocked out at 00:00:00\'', async(() => {
3737
// tslint:disable-next-line: no-shadowed-variable
3838
const { app, fixture } = setup();
3939
fixture.detectChanges();
4040
const compile = fixture.debugElement.nativeElement;
4141
const ptag = compile.querySelector('p');
42-
expect(ptag.textContent).toBe('Dario clocked out at hh:mm:ss');
42+
expect(ptag.textContent).toBe('Dario clocked out at 00:00:00');
4343
}));
4444

4545
it('should set showfileds as true', () => {

src/app/components/shared/clock/clock.component.spec.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ describe('ClockComponent', () => {
66
let component: ClockComponent;
77
let fixture: ComponentFixture<ClockComponent>;
88

9-
109
beforeEach(async(() => {
1110
TestBed.configureTestingModule({
1211
declarations: [ ClockComponent ]
@@ -25,13 +24,18 @@ describe('ClockComponent', () => {
2524
});
2625

2726
it('should show the current hour of day', () => {
28-
const currentHour = 11;
29-
expect(component.currentDate.getHours()).toEqual(currentHour);
27+
const currentDate: Date = new Date();
28+
expect(component.currentDate.getHours()).toEqual(currentDate.getHours());
3029
});
3130

3231
it('should show the current minutes of day', () => {
33-
const currenMinutes = 5;
34-
expect(component.currentDate.getMinutes()).toEqual(currenMinutes);
32+
const currentDate: Date = new Date();
33+
expect(component.currentDate.getMinutes()).toEqual(currentDate.getMinutes());
34+
});
35+
36+
it('should show the current seconds of day', () => {
37+
const currentDate: Date = new Date();
38+
expect(component.currentDate.getSeconds()).toEqual(currentDate.getSeconds());
3539
});
3640

3741
});

0 commit comments

Comments
 (0)