Skip to content
Snippets Groups Projects
Verified Commit d612abf4 authored by Sebastian Bergandy's avatar Sebastian Bergandy :keyboard:
Browse files

OZG-6185 remove bescheid service 2

parent 105f5270
Branches
Tags
1 merge request!90Ozg 6185 remove old bescheid code
Showing
with 827 additions and 2659 deletions
...@@ -23,16 +23,18 @@ ...@@ -23,16 +23,18 @@
*/ */
import { OrganisationsEinheitContainerComponent } from '@admin-client/organisations-einheit'; import { OrganisationsEinheitContainerComponent } from '@admin-client/organisations-einheit';
import { AdminOrganisationsEinheit, AdminOrganisationsEinheitService } from '@admin-client/organisations-einheit-shared'; import { AdminOrganisationsEinheit, AdminOrganisationsEinheitService } from '@admin-client/organisations-einheit-shared';
import { createStateResource, StateResource, ToEmbeddedResourcesPipe } from '@alfa-client/tech-shared'; import { createStateResource, StateResource } from '@alfa-client/tech-shared';
import { existsAsHtmlElement, getMockComponent, Mock, mock } from '@alfa-client/test-utils'; import { existsAsHtmlElement, getMockComponent, Mock, mock } from '@alfa-client/test-utils';
import { OzgcloudDialogService } from '@alfa-client/ui'; import { OzgcloudDialogService, SpinnerComponent } from '@alfa-client/ui';
import { OrganisationsEinheitResource } from '@alfa-client/zustaendige-stelle-shared'; import { ZustaendigeStelleModule } from '@alfa-client/zustaendige-stelle';
import { OrganisationsEinheitResource, ZustaendigeStelleSharedModule } from '@alfa-client/zustaendige-stelle-shared';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { ViewContainerRef } from '@angular/core'; import { ViewContainerRef } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ButtonComponent } from '@ods/system';
import { createAdminOrganisationsEinheit } from 'libs/admin/organisations-einheit-shared/src/test/organisations-einheit'; import { createAdminOrganisationsEinheit } from 'libs/admin/organisations-einheit-shared/src/test/organisations-einheit';
import { getDataTestIdOf } from 'libs/tech-shared/test/data-test'; import { getDataTestIdOf } from 'libs/tech-shared/test/data-test';
import { MockComponent } from 'ng-mocks'; import { MockComponent, MockModule } from 'ng-mocks';
import { of } from 'rxjs'; import { of } from 'rxjs';
import { createOrganisationsEinheitResource } from '../../../../../zustaendige-stelle-shared/test/organisations-einheit'; import { createOrganisationsEinheitResource } from '../../../../../zustaendige-stelle-shared/test/organisations-einheit';
import { OrganisationsEinheitListComponent } from './organisations-einheit-list/organisations-einheit-list.component'; import { OrganisationsEinheitListComponent } from './organisations-einheit-list/organisations-einheit-list.component';
...@@ -43,7 +45,8 @@ describe('OrganisationsEinheitContainerComponent', () => { ...@@ -43,7 +45,8 @@ describe('OrganisationsEinheitContainerComponent', () => {
let organisationsEinheitService: Mock<AdminOrganisationsEinheitService>; let organisationsEinheitService: Mock<AdminOrganisationsEinheitService>;
let dialogService: Mock<OzgcloudDialogService>; let dialogService: Mock<OzgcloudDialogService>;
let vieContainerRef: Mock<ViewContainerRef>;
const viewContainerRef = <any>{};
const organisationsEinheit: AdminOrganisationsEinheit = createAdminOrganisationsEinheit(); const organisationsEinheit: AdminOrganisationsEinheit = createAdminOrganisationsEinheit();
const organisationsEinheitListStateResource: StateResource<AdminOrganisationsEinheit[]> = createStateResource([ const organisationsEinheitListStateResource: StateResource<AdminOrganisationsEinheit[]> = createStateResource([
...@@ -60,17 +63,24 @@ describe('OrganisationsEinheitContainerComponent', () => { ...@@ -60,17 +63,24 @@ describe('OrganisationsEinheitContainerComponent', () => {
refresh: jest.fn(), refresh: jest.fn(),
}; };
dialogService = mock(OzgcloudDialogService); dialogService = mock(OzgcloudDialogService);
vieContainerRef = mock(ViewContainerRef as any);
}); });
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
declarations: [ToEmbeddedResourcesPipe], declarations: [],
imports: [CommonModule, OrganisationsEinheitContainerComponent, MockComponent(OrganisationsEinheitListComponent)], imports: [
OrganisationsEinheitContainerComponent,
MockModule(CommonModule),
MockModule(ZustaendigeStelleModule),
MockModule(ZustaendigeStelleSharedModule),
MockComponent(OrganisationsEinheitListComponent),
MockComponent(ButtonComponent),
MockComponent(SpinnerComponent),
],
providers: [ providers: [
{ provide: AdminOrganisationsEinheitService, useValue: organisationsEinheitService }, { provide: AdminOrganisationsEinheitService, useValue: organisationsEinheitService },
{ provide: OzgcloudDialogService, useValue: dialogService }, { provide: OzgcloudDialogService, useValue: dialogService },
{ provide: ViewContainerRef, useValue: vieContainerRef }, { provide: ViewContainerRef, useValue: viewContainerRef },
], ],
}).compileComponents(); }).compileComponents();
......
...@@ -24,6 +24,5 @@ ...@@ -24,6 +24,5 @@
export * from './lib/bescheid-shared.module'; export * from './lib/bescheid-shared.module';
export * from './lib/bescheid.linkrel'; export * from './lib/bescheid.linkrel';
export * from './lib/bescheid.model'; export * from './lib/bescheid.model';
export * from './lib/bescheid.service';
export * from './lib/bescheid.util'; export * from './lib/bescheid.util';
export * from './lib/document.model'; export * from './lib/document.model';
import { ListResourceServiceConfig, ResourceListService, ResourceRepository } from '@alfa-client/tech-shared';
import { VorgangService, VorgangWithEingangLinkRel, VorgangWithEingangResource } from '@alfa-client/vorgang-shared';
import { BescheidListLinkRel } from './bescheid.linkrel';
import { BescheidListResource, BescheidResource } from './bescheid.model';
export class BescheidListResourceService extends ResourceListService<
VorgangWithEingangResource,
BescheidListResource,
BescheidResource
> {}
export function createBescheidListResourceService(
repository: ResourceRepository<BescheidResource>,
vorgangService: VorgangService,
): ResourceListService<VorgangWithEingangResource, BescheidListResource, BescheidResource> {
return new BescheidListResourceService(buildBescheidListServiceConfig(vorgangService), repository);
}
function buildBescheidListServiceConfig(vorgangService: VorgangService): ListResourceServiceConfig<VorgangWithEingangResource> {
return {
baseResource: vorgangService.getVorgangWithEingang(),
listLinkRel: VorgangWithEingangLinkRel.BESCHEIDE,
listResourceListLinkRel: BescheidListLinkRel.BESCHEID_LIST,
};
}
...@@ -11,7 +11,6 @@ export function createBescheidResourceService( ...@@ -11,7 +11,6 @@ export function createBescheidResourceService(
commandService: CommandService, commandService: CommandService,
vorgangService: VorgangService, vorgangService: VorgangService,
): CommandResourceService<VorgangWithEingangResource, BescheidResource> { ): CommandResourceService<VorgangWithEingangResource, BescheidResource> {
console.info('Create Bescheid Resource Service');
return new CommandResourceService(buildConfig(vorgangService), repository, commandService); return new CommandResourceService(buildConfig(vorgangService), repository, commandService);
} }
......
This diff is collapsed.
import {
Bescheid,
BESCHEID_UPLOADED_ATTACHMENTS,
BescheidDocument,
BescheidLinkRel,
BescheidResource,
BescheidSendBy,
BescheidWizardStep,
buildCreateBescheidCommand,
buildCreateBescheidDocumentCommandProps,
buildCreateBescheidDocumentFromFileProps,
buildSendBescheidCommandProps,
buildUpdateBescheidCommandProps,
createEmptyBescheidDocument,
createEmptyUploadInProgress,
createInitialWizard,
DocumentResource,
Wizard,
} from '@alfa-client/bescheid-shared';
import {
BinaryFileListLinkRel,
BinaryFileListResource,
BinaryFileResource,
BinaryFileService,
} from '@alfa-client/binary-file-shared';
import {
CommandOrder,
CommandResource,
CommandService,
getEffectedResourceUrl,
notHasCommandError,
tapOnCommandSuccessfullyDone,
} from '@alfa-client/command-shared';
import { PostfachService } from '@alfa-client/postfach-shared';
import {
createEmptyStateResource,
filterIsLoadedOrHasError,
getEmbeddedResources,
hasStateResourceError,
isLoaded,
ResourceRepository,
StateResource,
} from '@alfa-client/tech-shared';
import { VorgangCommandService, VorgangWithEingangResource } from '@alfa-client/vorgang-shared';
import { inject, Injectable } from '@angular/core';
import { getUrl, hasLink, LinkRel, Resource, ResourceUri } from '@ngxp/rest';
import { isNil } from 'lodash-es';
import { BehaviorSubject, filter, first, map, Observable, switchMap } from 'rxjs';
import { BescheidFacade } from './+state/bescheid.facade';
import { BescheidResourceService } from './bescheid-resource-service';
import { DocumentLinkRel } from './document.linkrel';
@Injectable()
export class BescheidService2 {
private readonly bescheidFacade = inject(BescheidFacade);
private readonly commandService = inject(CommandService);
private readonly vorgangCommandService = inject(VorgangCommandService);
private readonly binaryFileService = inject(BinaryFileService);
private readonly resourceRepository = inject(ResourceRepository);
private readonly postfachService = inject(PostfachService);
private readonly bescheidResourceService = inject(BescheidResourceService);
readonly _bescheidDocument$: BehaviorSubject<BescheidDocument> = new BehaviorSubject(createEmptyBescheidDocument());
readonly _wizard$: BehaviorSubject<Wizard> = new BehaviorSubject(createInitialWizard());
public init(): void {
this._wizard$.next(createInitialWizard());
this._bescheidDocument$.next(createEmptyBescheidDocument());
}
public exit(): void {
this.postfachService.setPostfachMailOnReload();
this._clearUploadedFiles();
}
public skipBescheidCreation(
vorgangWithEingangResource: VorgangWithEingangResource,
bescheidResource: BescheidResource,
): Observable<StateResource<CommandResource>> {
if (isNil(bescheidResource)) {
return this.vorgangCommandService.abschliessen(vorgangWithEingangResource);
}
return this.deleteBescheidAndCompleteVorgang(vorgangWithEingangResource);
}
deleteBescheidAndCompleteVorgang(
vorgangWithEingangResource: VorgangWithEingangResource,
): Observable<StateResource<CommandResource>> {
return this.vorgangCommandService
.abschliessen(vorgangWithEingangResource)
.pipe(tapOnCommandSuccessfullyDone(() => this.deleteBescheid()));
}
public deleteBescheid(): Observable<StateResource<CommandResource>> {
return this.bescheidResourceService.delete();
}
public loadFiles(bescheidResource: BescheidResource): void {
this.loadBescheidDocument(bescheidResource);
this.loadAttachments(bescheidResource);
}
public createBescheidDocument(bescheidResource: BescheidResource): void {
this._bescheidDocument$.next({ ...createEmptyBescheidDocument(), create: createEmptyStateResource(true) });
this.doCreateBescheidDocument(bescheidResource)
.pipe(filterIsLoadedOrHasError(), first())
.subscribe((commandStateResource: StateResource<CommandResource>) =>
this.handleCreateBescheidDocumentResponse(commandStateResource),
);
}
doCreateBescheidDocument(bescheidResource: BescheidResource): Observable<StateResource<CommandResource>> {
return this.commandService.createCommandByProps(buildCreateBescheidDocumentCommandProps(bescheidResource));
}
handleCreateBescheidDocumentResponse(commandStateResource: StateResource<CommandResource>): void {
if (notHasCommandError(commandStateResource.resource)) {
const documentUri: ResourceUri = getEffectedResourceUrl(commandStateResource.resource);
this._bescheidDocument$.next({ ...this._bescheidDocument$.value, documentUri });
this.loadBescheidDocumentByUri(documentUri);
} else {
this._bescheidDocument$.next({ ...this._bescheidDocument$.value, create: commandStateResource });
}
}
emitBescheidDocumentError(stateResource: StateResource<Resource>): void {
const value: BescheidDocument = this._bescheidDocument$.value;
this._bescheidDocument$.next({
...value,
upload: { ...value.upload, loading: false, error: stateResource.error },
});
}
loadBescheidDocument(bescheidResource: BescheidResource): void {
if (hasLink(bescheidResource, BescheidLinkRel.BESCHEID_DOCUMENT)) {
this.loadBescheidDocumentByUri(getUrl(bescheidResource, BescheidLinkRel.BESCHEID_DOCUMENT));
}
}
public loadBescheidDocumentByUri(resourceUri: ResourceUri): void {
this.resourceRepository
.getResource(resourceUri)
.pipe(first())
.subscribe((document: DocumentResource) => this.loadBescheidDocumentFile(document));
}
loadBescheidDocumentFile(document: DocumentResource): void {
this.binaryFileService
.getFile(getUrl(document, DocumentLinkRel.FILE))
.pipe(filterIsLoadedOrHasError(), first())
.subscribe((binaryFile: StateResource<BinaryFileResource>) => {
this._bescheidDocument$.next({
...this._bescheidDocument$.value,
upload: createEmptyUploadInProgress(),
create: createEmptyStateResource(),
resource: binaryFile.resource,
documentUri: getUrl(document, LinkRel.Self),
});
});
}
loadAttachments(bescheidResource: BescheidResource): void {
if (hasLink(bescheidResource, BescheidLinkRel.ATTACHMENTS)) {
this.binaryFileService
.getFiles(bescheidResource, BescheidLinkRel.ATTACHMENTS)
.pipe(
filterIsLoadedOrHasError(),
first(),
map((stateResource: StateResource<BinaryFileListResource>) =>
getEmbeddedResources<BinaryFileResource>(stateResource, BinaryFileListLinkRel.FILE_LIST),
),
)
.subscribe((files: BinaryFileResource[]) => this.binaryFileService.addFiles(BESCHEID_UPLOADED_ATTACHMENTS, files));
}
}
public uploadBescheidDocument(document: File, bescheid: BescheidResource): void {
this._bescheidDocument$.next({ ...this._bescheidDocument$.value, upload: { fileName: document.name, loading: true } });
this.binaryFileService
.uploadFile(bescheid, BescheidLinkRel.UPLOAD_BESCHEID_FILE, document, false)
.pipe(filterIsLoadedOrHasError(), first())
.subscribe((binaryFileStateResource: StateResource<BinaryFileResource>) =>
this.handleUploadBescheidDocumentResponse(bescheid, binaryFileStateResource),
);
}
handleUploadBescheidDocumentResponse(
bescheid: BescheidResource,
binaryFileStateResource: StateResource<BinaryFileResource>,
): void {
if (hasStateResourceError(binaryFileStateResource)) {
this.emitBescheidDocumentError(binaryFileStateResource);
} else {
this.createBescheidDocumentFromFile(bescheid, binaryFileStateResource.resource);
}
}
createBescheidDocumentFromFile(bescheid: BescheidResource, binaryFile: BinaryFileResource): void {
this.commandService
.createCommandByProps(buildCreateBescheidDocumentFromFileProps(bescheid, binaryFile))
.pipe(filterIsLoadedOrHasError(), first())
.subscribe((commandStateResource: StateResource<CommandResource>) =>
this.handleCreateBescheidDocumentFromFileResponse(commandStateResource, binaryFile),
);
}
handleCreateBescheidDocumentFromFileResponse(
commandStateResource: StateResource<CommandResource>,
binaryFile: BinaryFileResource,
): void {
if (hasStateResourceError(commandStateResource)) {
this.emitBescheidDocumentError(commandStateResource);
} else {
this._bescheidDocument$.next({
...this._bescheidDocument$.value,
documentUri: getEffectedResourceUrl(commandStateResource.resource),
upload: createEmptyUploadInProgress(),
resource: binaryFile,
});
}
}
public createBescheid(
vorgangWithEingang: VorgangWithEingangResource,
bescheid?: Bescheid,
): Observable<StateResource<CommandResource>> {
this.bescheidFacade.createBescheidDraft(vorgangWithEingang, buildCreateBescheidCommand(bescheid));
return this.bescheidFacade
.getBescheidCommand()
.pipe(
tapOnCommandSuccessfullyDone((commandStateResource: StateResource<CommandResource>) =>
this.updateBescheidDraft(commandStateResource.resource),
),
);
}
updateBescheidDraft(command: CommandResource): void {
this.bescheidResourceService.loadByResourceUri(getEffectedResourceUrl(command));
if (command.order === CommandOrder.CREATE_BESCHEID) {
this._wizard$.next({ ...this._wizard$.value, bescheidCreated: true });
}
}
public updateBescheid(
bescheidResource: BescheidResource,
updatedBescheid: Bescheid,
): Observable<StateResource<CommandResource>> {
return this.doUpdateBescheid(bescheidResource, updatedBescheid).pipe(
tapOnCommandSuccessfullyDone((commandStateResource: StateResource<CommandResource>) => {
this.updateBescheidDraft(commandStateResource.resource);
}),
);
}
doUpdateBescheid(bescheidResource: BescheidResource, bescheid: Bescheid): Observable<StateResource<CommandResource>> {
return this.commandService.createCommandByProps(buildUpdateBescheidCommandProps(bescheidResource, bescheid));
}
public sendBescheidManually(): Observable<StateResource<CommandResource>> {
return this.sendBescheid(BescheidLinkRel.BESCHEIDEN);
}
public sendBescheidMessage(): Observable<StateResource<CommandResource>> {
return this.sendBescheid(BescheidLinkRel.BESCHEIDEN_UND_SENDEN);
}
sendBescheid(linkRel: BescheidLinkRel): Observable<StateResource<CommandResource>> {
return this.getBescheidDraft().pipe(
filter(isLoaded),
map((stateResource: StateResource<BescheidResource>) => stateResource.resource),
switchMap((bescheidResource: BescheidResource) =>
this.commandService.createCommandByProps(buildSendBescheidCommandProps(bescheidResource, linkRel)),
),
);
}
public getBescheidDraft(): Observable<StateResource<BescheidResource>> {
return this.bescheidResourceService.get();
}
public getBescheidDocument(): Observable<BescheidDocument> {
return this._bescheidDocument$.asObservable();
}
public deleteBescheidDocument(): void {
this._bescheidDocument$.next(createEmptyBescheidDocument());
}
public getActiveStep(): Observable<BescheidWizardStep> {
return this._wizard$.asObservable().pipe(map((wizard: Wizard) => wizard.activeStep));
}
public setActiveStep(step: BescheidWizardStep): void {
this._clearUploadedFiles();
this._wizard$.next({ ...this._wizard$.value, activeStep: step });
}
public getBescheidCreated(): Observable<boolean> {
return this._wizard$.asObservable().pipe(map((wizard: Wizard) => wizard.bescheidCreated));
}
public selectBescheidResource(): Observable<StateResource<BescheidResource>> {
return this.bescheidResourceService.selectResource();
}
public getWizard(): Observable<Wizard> {
return this._wizard$.asObservable();
}
public setSendBy(sendBy: BescheidSendBy): void {
this._wizard$.next({ ...this._wizard$.value, sendBy: sendBy });
}
public setNachrichtEmpfaenger(empfaenger: string): void {
this._wizard$.next({ ...this._wizard$.value, empfaenger: empfaenger });
}
public lockBescheidSending(): void {
this._wizard$.next({ ...this._wizard$.value, canBeSend: false });
}
public unlockBescheidSending(): void {
this._wizard$.next({ ...this._wizard$.value, canBeSend: true });
}
public finishAddingBescheidDocument(): void {
this._bescheidDocument$.next({
...this._bescheidDocument$.value,
upload: createEmptyUploadInProgress(),
create: createEmptyStateResource(),
});
}
_clearUploadedFiles(): void {
this.binaryFileService.clearUploadedFiles(BESCHEID_UPLOADED_ATTACHMENTS);
}
}
...@@ -21,11 +21,11 @@ ...@@ -21,11 +21,11 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen * Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen. * unter der Lizenz sind dem Lizenztext zu entnehmen.
*/ */
import { BescheidService } from '@alfa-client/bescheid-shared';
import { Mock, mock } from '@alfa-client/test-utils'; import { Mock, mock } from '@alfa-client/test-utils';
import { SpinnerComponent } from '@alfa-client/ui'; import { SpinnerComponent } from '@alfa-client/ui';
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MockComponent } from 'ng-mocks'; import { MockComponent } from 'ng-mocks';
import { BescheidService } from '../../../../bescheid-shared/src/lib/bescheid.service';
import { BescheidListInVorgangContainerComponent } from './bescheid-list-in-vorgang-container.component'; import { BescheidListInVorgangContainerComponent } from './bescheid-list-in-vorgang-container.component';
import { BescheidListInVorgangComponent } from './bescheid-list-in-vorgang/bescheid-list-in-vorgang.component'; import { BescheidListInVorgangComponent } from './bescheid-list-in-vorgang/bescheid-list-in-vorgang.component';
......
...@@ -21,10 +21,11 @@ ...@@ -21,10 +21,11 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen * Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen. * unter der Lizenz sind dem Lizenztext zu entnehmen.
*/ */
import { BescheidListResource, BescheidService } from '@alfa-client/bescheid-shared'; import { BescheidListResource } from '@alfa-client/bescheid-shared';
import { StateResource } from '@alfa-client/tech-shared'; import { StateResource } from '@alfa-client/tech-shared';
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { BescheidService } from '../../../../bescheid-shared/src/lib/bescheid.service';
@Component({ @Component({
selector: 'alfa-bescheid-list-in-vorgang-container', selector: 'alfa-bescheid-list-in-vorgang-container',
......
...@@ -21,30 +21,19 @@ ...@@ -21,30 +21,19 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen * Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen. * unter der Lizenz sind dem Lizenztext zu entnehmen.
*/ */
import { BescheidService } from '@alfa-client/bescheid-shared';
import { BinaryFileUriContainerComponent } from '@alfa-client/binary-file'; import { BinaryFileUriContainerComponent } from '@alfa-client/binary-file';
import { import { createStateResource, GetUrlPipe, HasLinkPipe, StateResource } from '@alfa-client/tech-shared';
GetUrlPipe, import { existsAsHtmlElement, getMockComponent, Mock, mock, notExistsAsHtmlElement } from '@alfa-client/test-utils';
HasLinkPipe,
StateResource,
createStateResource,
} from '@alfa-client/tech-shared';
import {
Mock,
existsAsHtmlElement,
getMockComponent,
mock,
notExistsAsHtmlElement,
} from '@alfa-client/test-utils';
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { faker } from '@faker-js/faker'; import { faker } from '@faker-js/faker';
import { ResourceUri, getUrl } from '@ngxp/rest'; import { getUrl, ResourceUri } from '@ngxp/rest';
import { AttachmentWrapperComponent } from '@ods/system'; import { AttachmentWrapperComponent } from '@ods/system';
import { DocumentLinkRel } from 'libs/bescheid-shared/src/lib/document.linkrel'; import { DocumentLinkRel } from 'libs/bescheid-shared/src/lib/document.linkrel';
import { DocumentResource } from 'libs/bescheid-shared/src/lib/document.model'; import { DocumentResource } from 'libs/bescheid-shared/src/lib/document.model';
import { getDataTestClassOf } from 'libs/tech-shared/test/data-test'; import { getDataTestClassOf } from 'libs/tech-shared/test/data-test';
import { MockComponent } from 'ng-mocks'; import { MockComponent } from 'ng-mocks';
import { of } from 'rxjs'; import { of } from 'rxjs';
import { BescheidService } from '../../../../../../bescheid-shared/src/lib/bescheid.service';
import { createDocumentResource } from '../../../../../../bescheid-shared/src/test/document'; import { createDocumentResource } from '../../../../../../bescheid-shared/src/test/document';
import { DocumentInBescheidContainerComponent } from './document-in-bescheid-container.component'; import { DocumentInBescheidContainerComponent } from './document-in-bescheid-container.component';
...@@ -81,7 +70,7 @@ describe('DocumentInBescheidContainerComponent', () => { ...@@ -81,7 +70,7 @@ describe('DocumentInBescheidContainerComponent', () => {
fixture = TestBed.createComponent(DocumentInBescheidContainerComponent); fixture = TestBed.createComponent(DocumentInBescheidContainerComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
component.documentUri = documentUri; component.documentUri = documentUri;
bescheidService.loadBescheidDocument.mockReturnValue(of(documentStateResource)); bescheidService.getBescheidDocumentByUri.mockReturnValue(of(documentStateResource));
fixture.detectChanges(); fixture.detectChanges();
}); });
...@@ -93,15 +82,13 @@ describe('DocumentInBescheidContainerComponent', () => { ...@@ -93,15 +82,13 @@ describe('DocumentInBescheidContainerComponent', () => {
it('should call service to load bescheid document', () => { it('should call service to load bescheid document', () => {
component.ngOnInit(); component.ngOnInit();
expect(bescheidService.loadBescheidDocument).toHaveBeenCalledWith(documentUri); expect(bescheidService.getBescheidDocumentByUri).toHaveBeenCalledWith(documentUri);
}); });
}); });
describe('binary file uri container', () => { describe('binary file uri container', () => {
it('should be visible if link exists on resource', () => { it('should be visible if link exists on resource', () => {
component.documentStateResource$ = of( component.documentStateResource$ = of(createStateResource(createDocumentResource([DocumentLinkRel.FILE])));
createStateResource(createDocumentResource([DocumentLinkRel.FILE])),
);
fixture.detectChanges(); fixture.detectChanges();
...@@ -117,8 +104,10 @@ describe('DocumentInBescheidContainerComponent', () => { ...@@ -117,8 +104,10 @@ describe('DocumentInBescheidContainerComponent', () => {
}); });
it('should be called with binaryFileUri', () => { it('should be called with binaryFileUri', () => {
const binaryFileUriContainer: BinaryFileUriContainerComponent = const binaryFileUriContainer: BinaryFileUriContainerComponent = getMockComponent<BinaryFileUriContainerComponent>(
getMockComponent<BinaryFileUriContainerComponent>(fixture, BinaryFileUriContainerComponent); fixture,
BinaryFileUriContainerComponent,
);
expect(binaryFileUriContainer.binaryFileUri).toBe(getUrl(document, DocumentLinkRel.FILE)); expect(binaryFileUriContainer.binaryFileUri).toBe(getUrl(document, DocumentLinkRel.FILE));
}); });
......
...@@ -21,13 +21,13 @@ ...@@ -21,13 +21,13 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen * Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen. * unter der Lizenz sind dem Lizenztext zu entnehmen.
*/ */
import { BescheidService } from '@alfa-client/bescheid-shared';
import { StateResource } from '@alfa-client/tech-shared'; import { StateResource } from '@alfa-client/tech-shared';
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { ResourceUri } from '@ngxp/rest'; import { ResourceUri } from '@ngxp/rest';
import { DocumentLinkRel } from 'libs/bescheid-shared/src/lib/document.linkrel'; import { DocumentLinkRel } from 'libs/bescheid-shared/src/lib/document.linkrel';
import { DocumentResource } from 'libs/bescheid-shared/src/lib/document.model'; import { DocumentResource } from 'libs/bescheid-shared/src/lib/document.model';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { BescheidService } from '../../../../../../bescheid-shared/src/lib/bescheid.service';
@Component({ @Component({
selector: 'alfa-document-in-bescheid-container', selector: 'alfa-document-in-bescheid-container',
...@@ -43,6 +43,6 @@ export class DocumentInBescheidContainerComponent implements OnInit { ...@@ -43,6 +43,6 @@ export class DocumentInBescheidContainerComponent implements OnInit {
constructor(private bescheidService: BescheidService) {} constructor(private bescheidService: BescheidService) {}
ngOnInit(): void { ngOnInit(): void {
this.documentStateResource$ = this.bescheidService.loadBescheidDocument(this.documentUri); this.documentStateResource$ = this.bescheidService.getBescheidDocumentByUri(this.documentUri);
} }
} }
...@@ -24,16 +24,7 @@ ...@@ -24,16 +24,7 @@
import { BescheidResource, BescheidWizardDialogResult, BescheidWizardStep } from '@alfa-client/bescheid-shared'; import { BescheidResource, BescheidWizardDialogResult, BescheidWizardStep } from '@alfa-client/bescheid-shared';
import { CommandOrder, CommandResource } from '@alfa-client/command-shared'; import { CommandOrder, CommandResource } from '@alfa-client/command-shared';
import { createEmptyStateResource, createStateResource, ESCAPE_KEY, StateResource } from '@alfa-client/tech-shared'; import { createEmptyStateResource, createStateResource, ESCAPE_KEY, StateResource } from '@alfa-client/tech-shared';
import { import { createDialogRefMock, DialogRefMock, existsAsHtmlElement, getElementFromFixtureByType, Mock, mock, triggerEvent, useFromMock, } from '@alfa-client/test-utils';
createDialogRefMock,
DialogRefMock,
existsAsHtmlElement,
getElementFromFixtureByType,
Mock,
mock,
triggerEvent,
useFromMock,
} from '@alfa-client/test-utils';
import { OzgcloudDialogService } from '@alfa-client/ui'; import { OzgcloudDialogService } from '@alfa-client/ui';
import { VorgangWithEingangLinkRel, VorgangWithEingangResource } from '@alfa-client/vorgang-shared'; import { VorgangWithEingangLinkRel, VorgangWithEingangResource } from '@alfa-client/vorgang-shared';
import { DIALOG_DATA, DialogRef } from '@angular/cdk/dialog'; import { DIALOG_DATA, DialogRef } from '@angular/cdk/dialog';
...@@ -41,7 +32,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; ...@@ -41,7 +32,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ButtonComponent, CloseIconComponent } from '@ods/system'; import { ButtonComponent, CloseIconComponent } from '@ods/system';
import { MockComponent } from 'ng-mocks'; import { MockComponent } from 'ng-mocks';
import { EMPTY, of } from 'rxjs'; import { EMPTY, of } from 'rxjs';
import { BescheidService2 } from '../../../../bescheid-shared/src/lib/bescheid2.service'; import { BescheidService } from '../../../../bescheid-shared/src/lib/bescheid.service';
import { createBescheidResource, createBescheidStateResource } from '../../../../bescheid-shared/src/test/bescheid'; import { createBescheidResource, createBescheidStateResource } from '../../../../bescheid-shared/src/test/bescheid';
import { createCommandErrorResource, createSuccessfullyDoneCommandResource } from '../../../../command-shared/test/command'; import { createCommandErrorResource, createSuccessfullyDoneCommandResource } from '../../../../command-shared/test/command';
import { getDataTestIdAttributeOf, getDataTestIdOf } from '../../../../tech-shared/test/data-test'; import { getDataTestIdAttributeOf, getDataTestIdOf } from '../../../../tech-shared/test/data-test';
...@@ -50,11 +41,7 @@ import { createKeydownKeyboardEvent } from '../../../../test-utils/src/lib/keybo ...@@ -50,11 +41,7 @@ import { createKeydownKeyboardEvent } from '../../../../test-utils/src/lib/keybo
import { createVorgangWithEingangResource } from '../../../../vorgang-shared/test/vorgang'; import { createVorgangWithEingangResource } from '../../../../vorgang-shared/test/vorgang';
import { BescheidWizardContainerComponent } from './bescheid-wizard-container.component'; import { BescheidWizardContainerComponent } from './bescheid-wizard-container.component';
import { BescheidWizardComponent } from './bescheid-wizard/bescheid-wizard.component'; import { BescheidWizardComponent } from './bescheid-wizard/bescheid-wizard.component';
import { import { BescheidWizardCancelDialogContainerComponent, CancelWizardDialogData, CancelWizardDialogResult, } from './bescheid-wizard/cancel-dialog-container/bescheid-wizard-cancel-dialog-container.component';
BescheidWizardCancelDialogContainerComponent,
CancelWizardDialogData,
CancelWizardDialogResult,
} from './bescheid-wizard/cancel-dialog-container/bescheid-wizard-cancel-dialog-container.component';
import { BescheidFormService } from './bescheid.formservice'; import { BescheidFormService } from './bescheid.formservice';
describe('BescheidWizardContainerComponent', () => { describe('BescheidWizardContainerComponent', () => {
...@@ -64,7 +51,7 @@ describe('BescheidWizardContainerComponent', () => { ...@@ -64,7 +51,7 @@ describe('BescheidWizardContainerComponent', () => {
const bescheidWizard: string = getDataTestIdOf('bescheid-wizard'); const bescheidWizard: string = getDataTestIdOf('bescheid-wizard');
const closeButton: string = getDataTestIdAttributeOf('close-bescheid'); const closeButton: string = getDataTestIdAttributeOf('close-bescheid');
let bescheidService: Mock<BescheidService2>; let bescheidService: Mock<BescheidService>;
let ozgcloudDialogService: Mock<OzgcloudDialogService>; let ozgcloudDialogService: Mock<OzgcloudDialogService>;
let formService: Mock<BescheidFormService>; let formService: Mock<BescheidFormService>;
let wizardDialogRef: DialogRefMock<BescheidWizardDialogResult>; let wizardDialogRef: DialogRefMock<BescheidWizardDialogResult>;
...@@ -72,7 +59,7 @@ describe('BescheidWizardContainerComponent', () => { ...@@ -72,7 +59,7 @@ describe('BescheidWizardContainerComponent', () => {
const vorgangWithEingangResource: VorgangWithEingangResource = createVorgangWithEingangResource(); const vorgangWithEingangResource: VorgangWithEingangResource = createVorgangWithEingangResource();
beforeEach(() => { beforeEach(() => {
bescheidService = mock(BescheidService2); bescheidService = mock(BescheidService);
bescheidService.getBescheidCreated.mockReturnValue(EMPTY); bescheidService.getBescheidCreated.mockReturnValue(EMPTY);
ozgcloudDialogService = mock(OzgcloudDialogService); ozgcloudDialogService = mock(OzgcloudDialogService);
formService = mock(BescheidFormService); formService = mock(BescheidFormService);
...@@ -105,7 +92,7 @@ describe('BescheidWizardContainerComponent', () => { ...@@ -105,7 +92,7 @@ describe('BescheidWizardContainerComponent', () => {
useValue: { vorgangWithEingangResource }, useValue: { vorgangWithEingangResource },
}, },
{ {
provide: BescheidService2, provide: BescheidService,
useValue: bescheidService, useValue: bescheidService,
}, },
{ {
......
...@@ -22,17 +22,16 @@ ...@@ -22,17 +22,16 @@
* unter der Lizenz sind dem Lizenztext zu entnehmen. * unter der Lizenz sind dem Lizenztext zu entnehmen.
*/ */
import { BescheidResource, BescheidWizardDialogResult, BescheidWizardStep } from '@alfa-client/bescheid-shared'; import { BescheidResource, BescheidWizardDialogResult, BescheidWizardStep } from '@alfa-client/bescheid-shared';
import { CommandOrder, CommandResource, CommandService, isSuccessfulDone } from '@alfa-client/command-shared'; import { CommandOrder, CommandResource, isSuccessfulDone } from '@alfa-client/command-shared';
import { createEmptyStateResource, isEscapeKey, isNotLoading, isNotNil, ResourceRepository, StateResource, } from '@alfa-client/tech-shared'; import { createEmptyStateResource, isEscapeKey, isNotLoading, isNotNil, StateResource } from '@alfa-client/tech-shared';
import { OzgcloudDialogService } from '@alfa-client/ui'; import { OzgcloudDialogService } from '@alfa-client/ui';
import { VorgangService, VorgangWithEingangLinkRel, VorgangWithEingangResource } from '@alfa-client/vorgang-shared'; import { VorgangWithEingangLinkRel, VorgangWithEingangResource } from '@alfa-client/vorgang-shared';
import { getEmpfaenger } from '@alfa-client/vorgang-shared-ui'; import { getEmpfaenger } from '@alfa-client/vorgang-shared-ui';
import { DIALOG_DATA, DialogRef } from '@angular/cdk/dialog'; import { DIALOG_DATA, DialogRef } from '@angular/cdk/dialog';
import { Component, inject, OnDestroy, OnInit, ViewContainerRef } from '@angular/core'; import { Component, inject, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';
import { hasLink } from '@ngxp/rest'; import { hasLink } from '@ngxp/rest';
import { BescheidResourceService, createBescheidResourceService } from 'libs/bescheid-shared/src/lib/bescheid-resource-service';
import { filter, first, Observable, of, Subscription, switchMap } from 'rxjs'; import { filter, first, Observable, of, Subscription, switchMap } from 'rxjs';
import { BescheidService2 } from '../../../../bescheid-shared/src/lib/bescheid2.service'; import { BescheidService } from '../../../../bescheid-shared/src/lib/bescheid.service';
import { BescheidWizardCancelDialogContainerComponent, CancelWizardDialogData, CancelWizardDialogResult, } from './bescheid-wizard/cancel-dialog-container/bescheid-wizard-cancel-dialog-container.component'; import { BescheidWizardCancelDialogContainerComponent, CancelWizardDialogData, CancelWizardDialogResult, } from './bescheid-wizard/cancel-dialog-container/bescheid-wizard-cancel-dialog-container.component';
import { BescheidFormService } from './bescheid.formservice'; import { BescheidFormService } from './bescheid.formservice';
...@@ -43,18 +42,10 @@ export interface BescheidWizardDialogData { ...@@ -43,18 +42,10 @@ export interface BescheidWizardDialogData {
@Component({ @Component({
selector: 'alfa-bescheid-wizard-container', selector: 'alfa-bescheid-wizard-container',
templateUrl: './bescheid-wizard-container.component.html', templateUrl: './bescheid-wizard-container.component.html',
providers: [ providers: [BescheidFormService],
BescheidFormService,
BescheidService2,
{
provide: BescheidResourceService,
useFactory: createBescheidResourceService,
deps: [ResourceRepository, CommandService, VorgangService],
},
],
}) })
export class BescheidWizardContainerComponent implements OnInit, OnDestroy { export class BescheidWizardContainerComponent implements OnInit, OnDestroy {
private readonly bescheidService = inject(BescheidService2); private readonly bescheidService = inject(BescheidService);
private readonly ozgcloudDialogService = inject(OzgcloudDialogService); private readonly ozgcloudDialogService = inject(OzgcloudDialogService);
private readonly dialogData: BescheidWizardDialogData = inject(DIALOG_DATA); private readonly dialogData: BescheidWizardDialogData = inject(DIALOG_DATA);
private readonly dialogRef = inject(DialogRef<BescheidWizardDialogResult>); private readonly dialogRef = inject(DialogRef<BescheidWizardDialogResult>);
......
...@@ -32,7 +32,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; ...@@ -32,7 +32,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatIcon } from '@angular/material/icon'; import { MatIcon } from '@angular/material/icon';
import { MockComponent } from 'ng-mocks'; import { MockComponent } from 'ng-mocks';
import { of } from 'rxjs'; import { of } from 'rxjs';
import { BescheidService2 } from '../../../../../../../bescheid-shared/src/lib/bescheid2.service'; import { BescheidService } from '../../../../../../../bescheid-shared/src/lib/bescheid.service';
import { createBescheidResource } from '../../../../../../../bescheid-shared/src/test/bescheid'; import { createBescheidResource } from '../../../../../../../bescheid-shared/src/test/bescheid';
import { createSuccessfullyDoneCommandStateResource } from '../../../../../../../command-shared/test/command'; import { createSuccessfullyDoneCommandStateResource } from '../../../../../../../command-shared/test/command';
import { getDataTestIdOf } from '../../../../../../../tech-shared/test/data-test'; import { getDataTestIdOf } from '../../../../../../../tech-shared/test/data-test';
...@@ -52,10 +52,10 @@ describe('BescheidWizardAbschliessenDialogContainerComponent', () => { ...@@ -52,10 +52,10 @@ describe('BescheidWizardAbschliessenDialogContainerComponent', () => {
const dialogData: AbschliessenDialogData = { vorgangWithEingangResource, bescheidResource }; const dialogData: AbschliessenDialogData = { vorgangWithEingangResource, bescheidResource };
let dialogRef: DialogRefMock; let dialogRef: DialogRefMock;
let bescheidService: Mock<BescheidService2>; let bescheidService: Mock<BescheidService>;
beforeEach(() => { beforeEach(() => {
bescheidService = mock(BescheidService2); bescheidService = mock(BescheidService);
dialogRef = createDialogRefMock(); dialogRef = createDialogRefMock();
}); });
...@@ -76,7 +76,7 @@ describe('BescheidWizardAbschliessenDialogContainerComponent', () => { ...@@ -76,7 +76,7 @@ describe('BescheidWizardAbschliessenDialogContainerComponent', () => {
useValue: dialogRef, useValue: dialogRef,
}, },
{ {
provide: BescheidService2, provide: BescheidService,
useValue: bescheidService, useValue: bescheidService,
}, },
], ],
......
...@@ -29,7 +29,7 @@ import { VorgangWithEingangResource } from '@alfa-client/vorgang-shared'; ...@@ -29,7 +29,7 @@ import { VorgangWithEingangResource } from '@alfa-client/vorgang-shared';
import { DIALOG_DATA, DialogRef } from '@angular/cdk/dialog'; import { DIALOG_DATA, DialogRef } from '@angular/cdk/dialog';
import { Component, inject } from '@angular/core'; import { Component, inject } from '@angular/core';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { BescheidService2 } from '../../../../../../../bescheid-shared/src/lib/bescheid2.service'; import { BescheidService } from '../../../../../../../bescheid-shared/src/lib/bescheid.service';
export interface AbschliessenDialogData { export interface AbschliessenDialogData {
vorgangWithEingangResource: VorgangWithEingangResource; vorgangWithEingangResource: VorgangWithEingangResource;
...@@ -43,7 +43,7 @@ export interface AbschliessenDialogData { ...@@ -43,7 +43,7 @@ export interface AbschliessenDialogData {
export class BescheidWizardAbschliessenDialogContainerComponent { export class BescheidWizardAbschliessenDialogContainerComponent {
private readonly dialogData: AbschliessenDialogData = inject(DIALOG_DATA); private readonly dialogData: AbschliessenDialogData = inject(DIALOG_DATA);
private readonly dialogRef = inject(DialogRef); private readonly dialogRef = inject(DialogRef);
private readonly bescheidService = inject(BescheidService2); private readonly bescheidService = inject(BescheidService);
public abschliessen$: Observable<StateResource<CommandResource>>; public abschliessen$: Observable<StateResource<CommandResource>>;
......
...@@ -25,7 +25,7 @@ import { existsAsHtmlElement, getElementFromFixtureByType, Mock, mock, triggerEv ...@@ -25,7 +25,7 @@ import { existsAsHtmlElement, getElementFromFixtureByType, Mock, mock, triggerEv
import { EventEmitter } from '@angular/core'; import { EventEmitter } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MockComponent } from 'ng-mocks'; import { MockComponent } from 'ng-mocks';
import { BescheidService2 } from '../../../../../../bescheid-shared/src/lib/bescheid2.service'; import { BescheidService } from '../../../../../../bescheid-shared/src/lib/bescheid.service';
import { createBescheidResource } from '../../../../../../bescheid-shared/src/test/bescheid'; import { createBescheidResource } from '../../../../../../bescheid-shared/src/test/bescheid';
import { getDataTestIdOf } from '../../../../../../tech-shared/test/data-test'; import { getDataTestIdOf } from '../../../../../../tech-shared/test/data-test';
import { createVorgangWithEingangResource } from '../../../../../../vorgang-shared/test/vorgang'; import { createVorgangWithEingangResource } from '../../../../../../vorgang-shared/test/vorgang';
...@@ -47,10 +47,10 @@ describe('BescheidWizardAntragBescheidenComponent', () => { ...@@ -47,10 +47,10 @@ describe('BescheidWizardAntragBescheidenComponent', () => {
const abschliessenButton: string = getDataTestIdOf('wizard-abschliessen-button'); const abschliessenButton: string = getDataTestIdOf('wizard-abschliessen-button');
const antragBescheidenSummary: string = getDataTestIdOf('antrag-bescheiden-summary'); const antragBescheidenSummary: string = getDataTestIdOf('antrag-bescheiden-summary');
let bescheidService: Mock<BescheidService2>; let bescheidService: Mock<BescheidService>;
beforeEach(() => { beforeEach(() => {
bescheidService = mock(BescheidService2); bescheidService = mock(BescheidService);
}); });
beforeEach(async () => { beforeEach(async () => {
...@@ -67,7 +67,7 @@ describe('BescheidWizardAntragBescheidenComponent', () => { ...@@ -67,7 +67,7 @@ describe('BescheidWizardAntragBescheidenComponent', () => {
], ],
providers: [ providers: [
{ {
provide: BescheidService2, provide: BescheidService,
useValue: bescheidService, useValue: bescheidService,
}, },
], ],
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
import { BescheidResource, BescheidWizardStep } from '@alfa-client/bescheid-shared'; import { BescheidResource, BescheidWizardStep } from '@alfa-client/bescheid-shared';
import { VorgangWithEingangResource } from '@alfa-client/vorgang-shared'; import { VorgangWithEingangResource } from '@alfa-client/vorgang-shared';
import { Component, EventEmitter, inject, Input, Output } from '@angular/core'; import { Component, EventEmitter, inject, Input, Output } from '@angular/core';
import { BescheidService2 } from '../../../../../../bescheid-shared/src/lib/bescheid2.service'; import { BescheidService } from '../../../../../../bescheid-shared/src/lib/bescheid.service';
@Component({ @Component({
selector: 'alfa-bescheid-wizard-antrag-bescheiden-container', selector: 'alfa-bescheid-wizard-antrag-bescheiden-container',
...@@ -36,7 +36,7 @@ export class BescheidWizardAntragBescheidenContainerComponent { ...@@ -36,7 +36,7 @@ export class BescheidWizardAntragBescheidenContainerComponent {
@Output() vorgangAbgeschlossen: EventEmitter<void> = new EventEmitter<void>(); @Output() vorgangAbgeschlossen: EventEmitter<void> = new EventEmitter<void>();
private readonly bescheidService = inject(BescheidService2); private readonly bescheidService = inject(BescheidService);
public readonly BescheidWizardStep = BescheidWizardStep; public readonly BescheidWizardStep = BescheidWizardStep;
......
...@@ -33,7 +33,7 @@ import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms'; ...@@ -33,7 +33,7 @@ import { ReactiveFormsModule, UntypedFormBuilder } from '@angular/forms';
import { CloseIconComponent, RadioButtonCardComponent, StampIconComponent } from '@ods/system'; import { CloseIconComponent, RadioButtonCardComponent, StampIconComponent } from '@ods/system';
import { MockComponent } from 'ng-mocks'; import { MockComponent } from 'ng-mocks';
import { EMPTY, of } from 'rxjs'; import { EMPTY, of } from 'rxjs';
import { BescheidService2 } from '../../../../../../../bescheid-shared/src/lib/bescheid2.service'; import { BescheidService } from '../../../../../../../bescheid-shared/src/lib/bescheid.service';
import { createBescheidResource } from '../../../../../../../bescheid-shared/src/test/bescheid'; import { createBescheidResource } from '../../../../../../../bescheid-shared/src/test/bescheid';
import { createSuccessfullyDoneCommandStateResource } from '../../../../../../../command-shared/test/command'; import { createSuccessfullyDoneCommandStateResource } from '../../../../../../../command-shared/test/command';
import { getDataTestIdOf } from '../../../../../../../tech-shared/test/data-test'; import { getDataTestIdOf } from '../../../../../../../tech-shared/test/data-test';
...@@ -52,7 +52,7 @@ describe('BescheidWizardAntragBescheidenFormComponent', () => { ...@@ -52,7 +52,7 @@ describe('BescheidWizardAntragBescheidenFormComponent', () => {
let formService: BescheidFormService; let formService: BescheidFormService;
beforeEach(async () => { beforeEach(async () => {
formService = new BescheidFormService(new UntypedFormBuilder(), useFromMock(mock(BescheidService2))); formService = new BescheidFormService(new UntypedFormBuilder(), useFromMock(mock(BescheidService)));
formService.submit = jest.fn().mockReturnValue(EMPTY); formService.submit = jest.fn().mockReturnValue(EMPTY);
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
......
...@@ -3,7 +3,7 @@ import { existsAsHtmlElement, getElementComponentFromFixtureByCss, mock, Mock, t ...@@ -3,7 +3,7 @@ import { existsAsHtmlElement, getElementComponentFromFixtureByCss, mock, Mock, t
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MockComponent } from 'ng-mocks'; import { MockComponent } from 'ng-mocks';
import { of } from 'rxjs'; import { of } from 'rxjs';
import { BescheidService2 } from '../../../../../../bescheid-shared/src/lib/bescheid2.service'; import { BescheidService } from '../../../../../../bescheid-shared/src/lib/bescheid.service';
import { createBescheidResource, createWizard } from '../../../../../../bescheid-shared/src/test/bescheid'; import { createBescheidResource, createWizard } from '../../../../../../bescheid-shared/src/test/bescheid';
import { getDataTestIdOf } from '../../../../../../tech-shared/test/data-test'; import { getDataTestIdOf } from '../../../../../../tech-shared/test/data-test';
import { singleColdCompleted } from '../../../../../../tech-shared/test/marbles'; import { singleColdCompleted } from '../../../../../../tech-shared/test/marbles';
...@@ -26,10 +26,10 @@ describe('BescheidWizardBescheidVersendenComponent', () => { ...@@ -26,10 +26,10 @@ describe('BescheidWizardBescheidVersendenComponent', () => {
const bescheidResource: BescheidResource = createBescheidResource(); const bescheidResource: BescheidResource = createBescheidResource();
let bescheidService: Mock<BescheidService2>; let bescheidService: Mock<BescheidService>;
beforeEach(() => { beforeEach(() => {
bescheidService = mock(BescheidService2); bescheidService = mock(BescheidService);
}); });
beforeEach(async () => { beforeEach(async () => {
...@@ -42,7 +42,7 @@ describe('BescheidWizardBescheidVersendenComponent', () => { ...@@ -42,7 +42,7 @@ describe('BescheidWizardBescheidVersendenComponent', () => {
MockComponent(BescheidWizardSummaryComponent), MockComponent(BescheidWizardSummaryComponent),
MockComponent(BescheidWizardBescheidVersendenSummaryComponent), MockComponent(BescheidWizardBescheidVersendenSummaryComponent),
], ],
providers: [{ provide: BescheidService2, useValue: bescheidService }], providers: [{ provide: BescheidService, useValue: bescheidService }],
}).compileComponents(); }).compileComponents();
createComponent(); createComponent();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment