11import { HttpClientTestingModule , HttpTestingController } from '@angular/common/http/testing' ;
2- import { TestBed , inject } from '@angular/core/testing' ;
2+ import { inject , TestBed } from '@angular/core/testing' ;
33
44import { EntryService } from './entry.service' ;
55import { NewEntry } from '../../shared/models' ;
@@ -17,7 +17,6 @@ describe('EntryService', () => {
1717 httpMock = TestBed . inject ( HttpTestingController ) ;
1818 datePipe = TestBed . inject ( DatePipe ) ;
1919 service . baseUrl = 'time-entries' ;
20-
2120 } ) ;
2221
2322 it ( 'services are ready to be used' , inject (
@@ -42,24 +41,21 @@ describe('EntryService', () => {
4241 } ) ;
4342
4443 it ( 'loads an activeEntry with /running' , ( ) => {
45- service . loadActiveEntry ( ) . subscribe ( ( response ) => {
46- } ) ;
44+ service . loadActiveEntry ( ) . subscribe ( ) ;
4745
4846 const loadEntryRequest = httpMock . expectOne ( `${ service . baseUrl } /running` ) ;
4947 expect ( loadEntryRequest . request . method ) . toBe ( 'GET' ) ;
5048 } ) ;
5149
5250 it ( 'loads summary with get /summary' , ( ) => {
53- service . summary ( ) . subscribe ( ( response ) => {
54- } ) ;
51+ service . summary ( ) . subscribe ( ) ;
5552
5653 const loadEntryRequest = httpMock . expectOne ( `${ service . baseUrl } /summary` ) ;
5754 expect ( loadEntryRequest . request . method ) . toBe ( 'GET' ) ;
5855 } ) ;
5956
60- it ( 'loads all Entries' , ( ) => {
61- service . loadEntries ( new Date ( ) . getMonth ) . subscribe ( ( response ) => {
62- } ) ;
57+ it ( 'load all Entries' , ( ) => {
58+ service . loadEntries ( new Date ( ) . getMonth ) . subscribe ( ) ;
6359
6460 const loadEntryRequest = httpMock . expectOne ( `${ service . baseUrl } ` ) ;
6561 expect ( loadEntryRequest . request . method ) . toBe ( 'GET' ) ;
@@ -69,25 +65,23 @@ describe('EntryService', () => {
6965 it ( 'update an entry using PUT' , ( ) => {
7066 const updatedEntry = { foo : 'bar' , id : 'id' } ;
7167
72- service . updateActiveEntry ( updatedEntry ) . subscribe ( ( response ) => {
73-
74- } ) ;
68+ service . updateActiveEntry ( updatedEntry ) . subscribe ( ) ;
7569
7670 const updateEntryRequest = httpMock . expectOne ( `${ service . baseUrl } /id` ) ;
7771 expect ( updateEntryRequest . request . method ) . toBe ( 'PUT' ) ;
7872 } ) ;
7973
8074 it ( 'delete an entry using DELETE' , ( ) => {
8175 const entry = 'entryId' ;
82- service . deleteEntry ( entry ) . subscribe ( ( response ) => {
83- } ) ;
76+
77+ service . deleteEntry ( entry ) . subscribe ( ) ;
78+
8479 const updateEntryRequest = httpMock . expectOne ( `${ service . baseUrl } /${ entry } ` ) ;
8580 expect ( updateEntryRequest . request . method ) . toBe ( 'DELETE' ) ;
8681 } ) ;
8782
8883 it ( 'stops an entry using POST' , ( ) => {
89- service . stopEntryRunning ( 'id' ) . subscribe ( ( response ) => {
90- } ) ;
84+ service . stopEntryRunning ( 'id' ) . subscribe ( ) ;
9185
9286 const updateEntryRequest = httpMock . expectOne ( `${ service . baseUrl } /id/stop` ) ;
9387 expect ( updateEntryRequest . request . method ) . toBe ( 'POST' ) ;
0 commit comments