Skip to content

Commit a13fb90

Browse files
committed
fix: TT-443 Test for start timeEntry from timeClock
1 parent 7af6317 commit a13fb90

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/app/modules/time-clock/services/entry.service.spec.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,18 @@ describe('EntryService', () => {
4040
});
4141

4242
it('loads an activeEntry with /running', () => {
43+
service.showOptionInDevelopment = true;
44+
service.loadActiveEntry().subscribe();
45+
46+
const loadEntryRequest = httpMock.expectOne(`${service.baseUrl}/running`);
47+
expect(loadEntryRequest.request.method).toBe('GET');
48+
});
49+
50+
it('loads an activeEntry with /active/{userId}', () => {
51+
service.showOptionInDevelopment = false;
4352
service.loadActiveEntry().subscribe();
44-
let path = '';
45-
if (service.showOptionInDevelopment){
46-
path = `${service.baseUrl}}/running`;
47-
}else{
48-
path = `${service.baseUrl}/active/2`;
49-
}
5053

51-
const loadEntryRequest = httpMock.expectOne(path);
54+
const loadEntryRequest = httpMock.expectOne(`${service.baseUrl}/active/2`);
5255
expect(loadEntryRequest.request.method).toBe('GET');
5356
});
5457

0 commit comments

Comments
 (0)