@@ -7,10 +7,10 @@ import { MatDialogModule } from '@angular/material/dialog';
77import { Router } from '@angular/router' ;
88import { RouterTestingModule } from '@angular/router/testing' ;
99import { NoopAnimationsModule } from '@angular/platform-browser/animations' ;
10- import { NightPlanService } from '../../services/night-plan.service' ;
1110import { provideHttpClient } from '@angular/common/http' ;
1211import { provideHttpClientTesting } from '@angular/common/http/testing' ;
13- import { BehaviorSubject } from 'rxjs' ;
12+ import { LoginService } from '../../services/login.service' ;
13+ import { of } from 'rxjs' ;
1414
1515describe ( 'LayoutComponent' , ( ) => {
1616 let component : LayoutComponent ;
@@ -21,13 +21,7 @@ describe('LayoutComponent', () => {
2121 /* eslint-disable @typescript-eslint/no-unused-vars */
2222 let router : Router ;
2323 /* eslint-enable @typescript-eslint/no-unused-vars */
24- let nightPlanService : { getTaskCount : ReturnType < typeof vi . fn > } ;
25-
2624 beforeEach ( async ( ) => {
27- nightPlanService = {
28- getTaskCount : vi . fn ( ) . mockReturnValue ( new BehaviorSubject ( 0 ) ) ,
29- } ;
30-
3125 await TestBed . configureTestingModule ( {
3226 imports : [
3327 RouterTestingModule ,
@@ -39,7 +33,10 @@ describe('LayoutComponent', () => {
3933 LayoutComponent
4034 ] ,
4135 providers : [
42- { provide : NightPlanService , useValue : nightPlanService } ,
36+ {
37+ provide : LoginService ,
38+ useValue : { currentUser$ : of ( null ) , logout : vi . fn ( ) }
39+ } ,
4340 provideHttpClient ( ) ,
4441 provideHttpClientTesting ( )
4542 ]
0 commit comments