Skip to content

Commit e093053

Browse files
committed
fixed bug test
1 parent 257cb2c commit e093053

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

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

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,6 @@ describe('TimeEntriesComponent', () => {
5757
expect(component).toBeTruthy();
5858
});
5959

60-
it('should have p tag as \'time-entries works!\'', async(() => {
61-
// tslint:disable-next-line: no-shadowed-variable
62-
const { app, fixture } = setup();
63-
fixture.detectChanges();
64-
const compile = fixture.debugElement.nativeElement;
65-
const ptag = compile.querySelector('p');
66-
expect(ptag.textContent).toBe('time-entries works!');
67-
}));
68-
6960
it('should call dataByMonth in ngOnInit()', async(() => {
7061
component.ngOnInit();
7162
expect(component.dataByMonth.length).toEqual(3);
@@ -77,7 +68,7 @@ describe('TimeEntriesComponent', () => {
7768
expect(component.showModal).toBe(true);
7869
});
7970

80-
it('should filter the Entry to edit', () => {
71+
it('should filter the Entry to edit', () => {
8172
const entryId = "entry_1"
8273
component.editEntry(entryId);
8374
expect(component.entry.project).toBe(entry.project);

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,18 @@ describe('ClockComponent', () => {
2525
});
2626

2727
it('should show the current hour of day', () => {
28-
const currentHour = 11;
28+
const currentHour = component.currentDate.getHours();
2929
expect(component.currentDate.getHours()).toEqual(currentHour);
3030
});
3131

3232
it('should show the current minutes of day', () => {
33-
const currenMinutes = 5;
34-
expect(component.currentDate.getMinutes()).toEqual(currenMinutes);
33+
const currentMinutes = component.currentDate.getMinutes();
34+
expect(component.currentDate.getMinutes()).toEqual(currentMinutes);
3535
});
36+
37+
it('should show the current seconds of day', () => {
38+
const currentSeconds = component.currentDate.getSeconds();
39+
expect(component.currentDate.getSeconds()).toEqual(currentSeconds);
40+
});
41+
3642
});

0 commit comments

Comments
 (0)