Skip to content

Commit

Permalink
chore(spa-dashboard): fix actual NzModalService impl used
Browse files Browse the repository at this point in the history
  • Loading branch information
timonmasberg committed Feb 20, 2024
1 parent 864459b commit 8ac0996
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions libs/spa/dashboard/src/lib/dashboard/dashboard.component.spec.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -14,21 +14,20 @@ describe('DashboardComponent', () => {
const authServiceMock = createMock<AuthService>({
user$: of(null),
});
const modalServiceMock = createMock<NzModalService>({
create: () => ({}),
});
const modalServiceMock = createMock<NzModalService>();

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();
Expand Down

0 comments on commit 8ac0996

Please sign in to comment.