Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix: TT-443 Test for start timeEntry from timeClock
  • Loading branch information
gcobena-dev committed Dec 20, 2021
commit a13fb9047707e0993194e81e4b61bf9794cc04aa
17 changes: 10 additions & 7 deletions src/app/modules/time-clock/services/entry.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,18 @@ describe('EntryService', () => {
});

it('loads an activeEntry with /running', () => {
service.showOptionInDevelopment = true;
service.loadActiveEntry().subscribe();

const loadEntryRequest = httpMock.expectOne(`${service.baseUrl}/running`);
expect(loadEntryRequest.request.method).toBe('GET');
});

it('loads an activeEntry with /active/{userId}', () => {
service.showOptionInDevelopment = false;
service.loadActiveEntry().subscribe();
let path = '';
if (service.showOptionInDevelopment){
path = `${service.baseUrl}}/running`;
}else{
path = `${service.baseUrl}/active/2`;
}

const loadEntryRequest = httpMock.expectOne(path);
const loadEntryRequest = httpMock.expectOne(`${service.baseUrl}/active/2`);
expect(loadEntryRequest.request.method).toBe('GET');
});

Expand Down