@@ -16,6 +16,8 @@ import { provideHttpClient } from '@angular/common/http';
1616import { NoopAnimationsModule } from '@angular/platform-browser/animations' ;
1717import { of , Subject , throwError } from 'rxjs' ;
1818
19+ import { HealthStatusResponse } from 'app/protos/health_service' ;
20+
1921import { FeatureFlagService } from '../service/feature_flag_service' ;
2022import { HealthService } from '../service/health_service' ;
2123import { SnackbarService } from '../service/snackbar_service' ;
@@ -118,7 +120,7 @@ describe('AdminPanelPage Component', () => {
118120 xidDbSchemaVersion : '1' ,
119121 } ,
120122 healthCheckTime : { seconds : 1717804800 , nanos : 0 } ,
121- } as any ) ,
123+ } as unknown as HealthStatusResponse ) ,
122124 ) ;
123125
124126 bootstrap ( AdminPanelPage ) ;
@@ -156,13 +158,13 @@ describe('AdminPanelPage Component', () => {
156158 } ,
157159 components : [ ] ,
158160 healthCheckTime : { seconds : 1717804800 , nanos : 0 } ,
159- } ;
161+ } as unknown as HealthStatusResponse ;
160162 spyOn ( healthService , 'getHealthStatus' ) . and . callFake ( ( ) => {
161163 attempts ++ ;
162164 if ( attempts === 1 ) {
163165 return throwError ( ( ) => new Error ( 'Initial load failed' ) ) ;
164166 }
165- return of ( mockStatus as any ) ;
167+ return of ( mockStatus ) ;
166168 } ) ;
167169
168170 bootstrap ( AdminPanelPage ) ;
@@ -193,9 +195,9 @@ describe('AdminPanelPage Component', () => {
193195 } ,
194196 components : [ ] ,
195197 healthCheckTime : { seconds : 1717804800 , nanos : 0 } ,
196- } ;
198+ } as unknown as HealthStatusResponse ;
197199 spyOn ( healthService , 'getHealthStatus' ) . and . returnValues (
198- of ( firstStatus as any ) ,
200+ of ( firstStatus ) ,
199201 throwError ( ( ) => new Error ( 'Refresh error' ) ) ,
200202 ) ;
201203
@@ -216,7 +218,7 @@ describe('AdminPanelPage Component', () => {
216218 it ( 'should display progress spinner while loading' , async ( ) => {
217219 const healthService = get ( HealthService ) ;
218220 // Never emit to keep isLoading true
219- spyOn ( healthService , 'getHealthStatus' ) . and . returnValue ( new Subject < any > ( ) ) ;
221+ spyOn ( healthService , 'getHealthStatus' ) . and . returnValue ( new Subject < HealthStatusResponse > ( ) ) ;
220222
221223 bootstrap ( AdminPanelPage ) ;
222224 // Flush microtasks without completing observable
@@ -322,7 +324,7 @@ describe('AdminPanelPage Component', () => {
322324 xidDbSchemaVersion : '1' ,
323325 } ,
324326 healthCheckTime : { seconds : 1717804800 , nanos : 0 } ,
325- } as any ) ,
327+ } as unknown as HealthStatusResponse ) ,
326328 ) ;
327329
328330 bootstrap ( AdminPanelPage ) ;
@@ -344,7 +346,7 @@ describe('AdminPanelPage Component', () => {
344346 xidDbSchemaVersion : '1' ,
345347 } ,
346348 healthCheckTime : { seconds : 1717804800 , nanos : 0 } ,
347- } as any ) ,
349+ } as unknown as HealthStatusResponse ) ,
348350 ) ;
349351
350352 bootstrap ( AdminPanelPage ) ;
@@ -360,7 +362,7 @@ describe('AdminPanelPage Component', () => {
360362 of ( {
361363 healthState : 'HEALTH_STATE_HEALTHY' ,
362364 healthCheckTime : { seconds : 1717804800 , nanos : 0 } ,
363- } as any ) ,
365+ } as unknown as HealthStatusResponse ) ,
364366 ) ;
365367
366368 bootstrap ( AdminPanelPage ) ;
@@ -393,7 +395,7 @@ describe('AdminPanelPage Component', () => {
393395 isSchedulingPaused : true ,
394396 } ,
395397 healthCheckTime : { seconds : 1717804800 , nanos : 0 } ,
396- } as any ) ,
398+ } as unknown as HealthStatusResponse ) ,
397399 ) ;
398400
399401 bootstrap ( AdminPanelPage ) ;
@@ -500,7 +502,7 @@ describe('AdminPanelPage Component', () => {
500502 isSchedulingPaused : pausedOnBackend ,
501503 } ,
502504 healthCheckTime : { seconds : 1717804800 , nanos : 0 } ,
503- } as any ) ;
505+ } as unknown as HealthStatusResponse ) ;
504506 } ) ;
505507
506508 bootstrap ( AdminPanelPage ) ;
@@ -551,7 +553,7 @@ describe('AdminPanelPage Component', () => {
551553
552554 it ( 'should disable toggle while pauseScheduling is in flight' , async ( ) => {
553555 const healthService = get ( HealthService ) ;
554- const pauseSubject$ = new Subject < any > ( ) ;
556+ const pauseSubject$ = new Subject < void > ( ) ;
555557 spyOn ( healthService , 'pauseScheduling' ) . and . returnValue ( pauseSubject$ ) ;
556558
557559 bootstrap ( AdminPanelPage ) ;
@@ -570,7 +572,7 @@ describe('AdminPanelPage Component', () => {
570572 // While request is pending, button is disabled
571573 expect ( await pauseBtn ! . isDisabled ( ) ) . toBeTrue ( ) ;
572574
573- pauseSubject$ . next ( { } ) ;
575+ pauseSubject$ . next ( ) ;
574576 pauseSubject$ . complete ( ) ;
575577 await flush ( ) ;
576578
@@ -592,7 +594,7 @@ describe('AdminPanelPage Component', () => {
592594 schedulingPauseError : 'spanner read timeout' ,
593595 } ,
594596 healthCheckTime : { seconds : 1717804800 , nanos : 0 } ,
595- } as any ) ,
597+ } as unknown as HealthStatusResponse ) ,
596598 ) ;
597599
598600 bootstrap ( AdminPanelPage ) ;
0 commit comments