Skip to content
Snippets Groups Projects
Commit 3478ddd8 authored by Albert Bruns's avatar Albert Bruns
Browse files

OZG-725-fix test

parent 750b9b0d
No related branches found
No related tags found
1 merge request!93OZG-725-weiterleitung-suche
<alfa-forwarding-dialog [selectedSearchResult]="selectedSearchResult$ | async"/> <alfa-forwarding-dialog [selectedSearchResult]="selectedSearchResult$ | async" data-test-id="forwarding-dialog"/>
\ No newline at end of file \ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { mock, Mock } from '@alfa-client/test-utils'; import { mock, Mock } from '@alfa-client/test-utils';
import { SearchOrganisationsEinheitContainerComponent } from '@alfa-client/zustaendige-stelle';
import { OrganisationsEinheitService, ZUSTAENDIGE_STELLE_SERVICE } from '@alfa-client/zustaendige-stelle-shared'; import { OrganisationsEinheitService, ZUSTAENDIGE_STELLE_SERVICE } from '@alfa-client/zustaendige-stelle-shared';
import { AsyncPipe } from '@angular/common';
import { MockComponent } from 'ng-mocks'; import { MockComponent } from 'ng-mocks';
import { ForwardingDialogContainerComponent } from './forwarding-dialog-container.component'; import { ForwardingDialogContainerComponent } from './forwarding-dialog-container.component';
import { ForwardingDialogComponent } from './forwarding-dialog/forwarding-dialog.component'; import { ForwardingDialogComponent } from './forwarding-dialog/forwarding-dialog.component';
...@@ -15,7 +15,12 @@ describe('ForwardingDialogContainerComponent', () => { ...@@ -15,7 +15,12 @@ describe('ForwardingDialogContainerComponent', () => {
beforeEach(async () => { beforeEach(async () => {
organisationsEinheitService = mock(OrganisationsEinheitService); organisationsEinheitService = mock(OrganisationsEinheitService);
TestBed.overrideComponent(SearchOrganisationsEinheitContainerComponent, {
await TestBed.configureTestingModule({
imports: [ForwardingDialogContainerComponent, AsyncPipe],
declarations: [MockComponent(ForwardingDialogComponent)],
})
.overrideComponent(ForwardingDialogContainerComponent, {
set: { set: {
providers: [ providers: [
{ {
...@@ -24,11 +29,8 @@ describe('ForwardingDialogContainerComponent', () => { ...@@ -24,11 +29,8 @@ describe('ForwardingDialogContainerComponent', () => {
}, },
], ],
}, },
}); })
await TestBed.configureTestingModule({ .compileComponents();
imports: [ForwardingDialogContainerComponent],
declarations: [MockComponent(ForwardingDialogComponent)],
}).compileComponents();
fixture = TestBed.createComponent(ForwardingDialogContainerComponent); fixture = TestBed.createComponent(ForwardingDialogContainerComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
......
...@@ -7,7 +7,7 @@ import { ...@@ -7,7 +7,7 @@ import {
ZUSTAENDIGE_STELLE_SERVICE, ZUSTAENDIGE_STELLE_SERVICE,
} from '@alfa-client/zustaendige-stelle-shared'; } from '@alfa-client/zustaendige-stelle-shared';
import { AsyncPipe } from '@angular/common'; import { AsyncPipe } from '@angular/common';
import { Component, inject } from '@angular/core'; import { Component, inject, OnInit } from '@angular/core';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { ForwardingDialogComponent } from './forwarding-dialog/forwarding-dialog.component'; import { ForwardingDialogComponent } from './forwarding-dialog/forwarding-dialog.component';
...@@ -24,7 +24,7 @@ import { ForwardingDialogComponent } from './forwarding-dialog/forwarding-dialog ...@@ -24,7 +24,7 @@ import { ForwardingDialogComponent } from './forwarding-dialog/forwarding-dialog
}, },
], ],
}) })
export class ForwardingDialogContainerComponent { export class ForwardingDialogContainerComponent implements OnInit {
private readonly organisationsEinheitService = inject(ZUSTAENDIGE_STELLE_SERVICE) as OrganisationsEinheitService; private readonly organisationsEinheitService = inject(ZUSTAENDIGE_STELLE_SERVICE) as OrganisationsEinheitService;
public selectedSearchResult$: Observable<OrganisationsEinheitResource>; public selectedSearchResult$: Observable<OrganisationsEinheitResource>;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment