From 8ac0996e7e43315039370cada148afb7a23086f8 Mon Sep 17 00:00:00 2001 From: Timon Masberg Date: Tue, 20 Feb 2024 11:50:43 +0100 Subject: [PATCH] chore(spa-dashboard): fix actual NzModalService impl used --- .../lib/dashboard/dashboard.component.spec.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/libs/spa/dashboard/src/lib/dashboard/dashboard.component.spec.ts b/libs/spa/dashboard/src/lib/dashboard/dashboard.component.spec.ts index 3d2a1c54a..f585ce4d0 100644 --- a/libs/spa/dashboard/src/lib/dashboard/dashboard.component.spec.ts +++ b/libs/spa/dashboard/src/lib/dashboard/dashboard.component.spec.ts @@ -1,7 +1,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { createMock } from '@golevelup/ts-jest'; -import { NzModalService } from 'ng-zorro-antd/modal'; +import { NzModalModule, NzModalService } from 'ng-zorro-antd/modal'; import { of } from 'rxjs'; import { AUTH_SERVICE, AuthService } from '@kordis/spa/auth'; @@ -14,21 +14,20 @@ describe('DashboardComponent', () => { const authServiceMock = createMock({ user$: of(null), }); - const modalServiceMock = createMock({ - create: () => ({}), - }); + const modalServiceMock = createMock(); beforeEach(async () => { await TestBed.configureTestingModule({ imports: [BrowserAnimationsModule], - providers: [ - { provide: AUTH_SERVICE, useValue: authServiceMock }, - { provide: NzModalService, useValue: modalServiceMock }, - ], + providers: [{ provide: AUTH_SERVICE, useValue: authServiceMock }], }).compileComponents(); - }); - beforeEach(() => { + TestBed.overrideModule(NzModalModule, { + set: { + providers: [{ provide: NzModalService, useValue: modalServiceMock }], + }, + }); + fixture = TestBed.createComponent(DashboardComponent); component = fixture.componentInstance; fixture.detectChanges();