@@ -10,6 +10,7 @@ import * as moment from 'moment';
1010describe ( 'EntryService' , ( ) => {
1111 let service : EntryService ;
1212 let httpMock : HttpTestingController ;
13+ var reportsUrl = service . urlInProductionLegacy ? service . baseUrl : service . baseUrl + '/report' ;
1314
1415 beforeEach ( ( ) => {
1516 TestBed . configureTestingModule ( { imports : [ HttpClientTestingModule ] , providers : [ DatePipe ] } ) ;
@@ -105,7 +106,6 @@ describe('EntryService', () => {
105106 const pipe : DatePipe = new DatePipe ( 'en' ) ;
106107 const timeRange : TimeEntriesTimeRange = { start_date : yesterday , end_date : today } ;
107108 const userId = '123' ;
108- const reportsUrl = service . urlInProductionLegacy ? service . baseUrl : service . baseUrl + '/report' ;
109109 service . loadEntriesByTimeRange ( timeRange , userId ) . subscribe ( ) ;
110110
111111 const loadEntryRequest = httpMock . expectOne ( req => req . method === 'GET' && req . url === reportsUrl ) ;
@@ -120,9 +120,7 @@ describe('EntryService', () => {
120120 const today = moment ( new Date ( ) ) ;
121121 const timeRange : TimeEntriesTimeRange = { start_date : yesterday , end_date : today } ;
122122 const userId = '123' ;
123- const reportsUrl = service . urlInProductionLegacy ? service . baseUrl : service . baseUrl + '/report' ;
124123 service . loadEntriesByTimeRange ( timeRange , userId ) . subscribe ( ) ;
125-
126124 const loadEntryRequest = httpMock . expectOne ( req => req . method === 'GET' && req . url === reportsUrl ) ;
127125 expect ( loadEntryRequest . request . params . get ( 'limit' ) ) . toEqual ( '9999' ) ;
128126 } ) ;
@@ -132,12 +130,8 @@ describe('EntryService', () => {
132130 const today = moment ( new Date ( ) ) ;
133131 const timeRange : TimeEntriesTimeRange = { start_date : yesterday , end_date : today } ;
134132 const userId = '123' ;
135- const reportsUrl = service . urlInProductionLegacy ? service . baseUrl : service . baseUrl + '/report' ;
136-
137133 service . loadEntriesByTimeRange ( timeRange , userId ) . subscribe ( ) ;
138-
139134 const loadEntryRequest = httpMock . expectOne ( req => req . method === 'GET' && req . url === reportsUrl ) ;
140-
141135 const timezoneOffset = new Date ( ) . getTimezoneOffset ( ) . toString ( ) ;
142136 expect ( loadEntryRequest . request . params . get ( 'timezone_offset' ) ) . toEqual ( timezoneOffset ) ;
143137 } ) ;
0 commit comments