diff --git a/alfa-client/libs/bescheid-shared/src/lib/bescheid.service.spec.ts b/alfa-client/libs/bescheid-shared/src/lib/bescheid.service.spec.ts index d22faf648e3d30b95e5d957b99673a29579e619b..ae974499af8180747f7915423b75c4e91a4a48a5 100644 --- a/alfa-client/libs/bescheid-shared/src/lib/bescheid.service.spec.ts +++ b/alfa-client/libs/bescheid-shared/src/lib/bescheid.service.spec.ts @@ -21,10 +21,31 @@ * Die sprachspezifischen Genehmigungen und Beschränkungen * unter der Lizenz sind dem Lizenztext zu entnehmen. */ -import { BinaryFileListLinkRel, BinaryFileListResource, BinaryFileResource, BinaryFileService, } from '@alfa-client/binary-file-shared'; -import { CommandOrder, CommandResource, CommandResourceService, CommandService, CreateCommandProps, getEffectedResourceUrl, } from '@alfa-client/command-shared'; +import { + BinaryFileListLinkRel, + BinaryFileListResource, + BinaryFileResource, + BinaryFileService, +} from '@alfa-client/binary-file-shared'; +import { + CommandOrder, + CommandResource, + CommandResourceService, + CommandService, + CreateCommandProps, + getEffectedResourceUrl, +} from '@alfa-client/command-shared'; import { PostfachService } from '@alfa-client/postfach-shared'; -import { createEmptyStateResource, createErrorStateResource, createStateResource, EMPTY_STRING, getEmbeddedResources, ResourceListService, ResourceRepository, StateResource, } from '@alfa-client/tech-shared'; +import { + createEmptyStateResource, + createErrorStateResource, + createStateResource, + EMPTY_STRING, + getEmbeddedResources, + ResourceListService, + ResourceRepository, + StateResource, +} from '@alfa-client/tech-shared'; import { Mock, mock } from '@alfa-client/test-utils'; import { VorgangCommandService, VorgangService, VorgangWithEingangResource } from '@alfa-client/vorgang-shared'; import { TestBed } from '@angular/core/testing'; @@ -35,19 +56,43 @@ import { createProblemDetail } from 'libs/tech-shared/test/error'; import { createVorgangWithEingangResource } from 'libs/vorgang-shared/test/vorgang'; import { EMPTY, Observable, of } from 'rxjs'; import { createBinaryFileListResource, createBinaryFileResource } from '../../../binary-file-shared/test/binary-file'; -import { createCommandErrorStateResource, createCommandResource, createCommandStateResource, createCreateCommandProps, createSuccessfullyDoneCommandStateResource, } from '../../../command-shared/test/command'; +import { + createCommandErrorStateResource, + createCommandResource, + createCommandStateResource, + createCreateCommandProps, + createSuccessfullyDoneCommandStateResource, +} from '../../../command-shared/test/command'; import { createFile } from '../../../tech-shared/test/file'; import { singleCold, singleColdCompleted } from '../../../tech-shared/test/marbles'; import { createBescheid, createBescheidDocument, createBescheidListResource, createBescheidResource } from '../test/bescheid'; import { createDocumentResource } from '../test/document'; import { BescheidFacade } from './+state/bescheid.facade'; import { BescheidLinkRel } from './bescheid.linkrel'; -import { Bescheid, BESCHEID_UPLOADED_ATTACHMENTS, BescheidDocument, BescheidListResource, BescheidResource, BescheidStatus, BescheidWizardStep, createEmptyBescheidDocument, createEmptyUploadInProgress, createInitialWizard, } from './bescheid.model'; +import { + Bescheid, + BESCHEID_UPLOADED_ATTACHMENTS, + BescheidDocument, + BescheidListResource, + BescheidResource, + BescheidStatus, + BescheidWizardStep, + createEmptyBescheidDocument, + createEmptyUploadInProgress, + createInitialWizard, +} from './bescheid.model'; import { BescheidService } from './bescheid.service'; import { DocumentLinkRel } from './document.linkrel'; import { DocumentResource } from './document.model'; -import { BescheidListResourceService, BescheidResourceService, buildCreateBescheidDocumentFromFileProps, buildUpdateBescheidCommandProps, createBescheidListResourceService, createBescheidResourceService, } from '@alfa-client/bescheid-shared'; +import { + BescheidListResourceService, + BescheidResourceService, + buildCreateBescheidDocumentFromFileProps, + buildUpdateBescheidCommandProps, + createBescheidListResourceService, + createBescheidResourceService, +} from '@alfa-client/bescheid-shared'; import { expect } from '@jest/globals'; import { cold } from 'jest-marbles'; import * as DateUtil from '../../../tech-shared/src/lib/date.util'; @@ -147,7 +192,7 @@ describe('BescheidService', () => { it('should reload postfach list', () => { service.exit(); - expect(postfachService.setPostfachMailOnReload).toHaveBeenCalled(); + expect(postfachService._setPostfachMailOnReload).toHaveBeenCalled(); }); it('should clear uploaded files', () => { diff --git a/alfa-client/libs/bescheid-shared/src/lib/bescheid.service.ts b/alfa-client/libs/bescheid-shared/src/lib/bescheid.service.ts index f87f71938164e4d881f7999f422e5fd68446bba5..22107e92d9b6ff28981edc35f13ab3da9b8880b8 100644 --- a/alfa-client/libs/bescheid-shared/src/lib/bescheid.service.ts +++ b/alfa-client/libs/bescheid-shared/src/lib/bescheid.service.ts @@ -89,7 +89,7 @@ export class BescheidService { private readonly resourceRepository = inject(ResourceRepository); private readonly postfachService = inject(PostfachService); private readonly vorgangService = inject(VorgangService); - // The injection of this service and the one below is problematic. + // The injection of this services is problematic. // It must be analysed how to inject BescheidService via providers in BescheidSharedModule. private readonly bescheidResourceService = createBescheidResourceService( this.resourceRepository, @@ -97,7 +97,7 @@ export class BescheidService { this.vorgangService, ); private readonly bescheidListResourceService = createBescheidListResourceService(this.resourceRepository, this.vorgangService); - + // readonly _bescheidDocument$: BehaviorSubject<BescheidDocument> = new BehaviorSubject(createEmptyBescheidDocument()); readonly _wizard$: BehaviorSubject<Wizard> = new BehaviorSubject(createInitialWizard()); diff --git a/alfa-client/libs/kommentar/src/lib/kommentar-list-in-vorgang-container/kommentar-form/kommentar-form.component.spec.ts b/alfa-client/libs/kommentar/src/lib/kommentar-list-in-vorgang-container/kommentar-form/kommentar-form.component.spec.ts index 9753cc7fa2dafde144f13618d84c55a24b1bc1a3..4470d7d9b7d85481c65e909ef9e12fef63b59194 100644 --- a/alfa-client/libs/kommentar/src/lib/kommentar-list-in-vorgang-container/kommentar-form/kommentar-form.component.spec.ts +++ b/alfa-client/libs/kommentar/src/lib/kommentar-list-in-vorgang-container/kommentar-form/kommentar-form.component.spec.ts @@ -102,7 +102,7 @@ describe('KommentarFormComponent', () => { const patchSpy = jest.spyOn(KommentarFormService.prototype, 'patch').mockImplementation(); const kommentarResource = createKommentarResource([KommentarLinkRel.ATTACHMENTS]); component.kommentar = kommentarResource; - kommentarService.getAttachments.mockReturnValue(of(createStateResource(createBinaryFileListResource()))); + kommentarService._getAttachments.mockReturnValue(of(createStateResource(createBinaryFileListResource()))); component.ngOnChanges(); @@ -111,7 +111,7 @@ describe('KommentarFormComponent', () => { it('should load attachments', (done) => { component.kommentar = createKommentarResource([KommentarLinkRel.ATTACHMENTS]); - kommentarService.getAttachments.mockReturnValue(of(createStateResource(createBinaryFileListResource()))); + kommentarService._getAttachments.mockReturnValue(of(createStateResource(createBinaryFileListResource()))); component.ngOnChanges(); @@ -124,11 +124,11 @@ describe('KommentarFormComponent', () => { it('should call kommentarService', () => { const kommentarResource = createKommentarResource([KommentarLinkRel.ATTACHMENTS]); component.kommentar = kommentarResource; - kommentarService.getAttachments.mockReturnValue(of(createStateResource(createBinaryFileListResource()))); + kommentarService._getAttachments.mockReturnValue(of(createStateResource(createBinaryFileListResource()))); component.ngOnChanges(); - expect(kommentarService.getAttachments).toHaveBeenCalledWith(kommentarResource); + expect(kommentarService._getAttachments).toHaveBeenCalledWith(kommentarResource); }); describe('submit', () => { diff --git a/alfa-client/libs/kommentar/src/lib/kommentar-list-in-vorgang-container/kommentar-list-in-vorgang-container.component.spec.ts b/alfa-client/libs/kommentar/src/lib/kommentar-list-in-vorgang-container/kommentar-list-in-vorgang-container.component.spec.ts index 1fa11168673776f20130a7be5616abb0ac84380a..e27318f11b1c3ab1c1263586b23781a0f42b5606 100644 --- a/alfa-client/libs/kommentar/src/lib/kommentar-list-in-vorgang-container/kommentar-list-in-vorgang-container.component.spec.ts +++ b/alfa-client/libs/kommentar/src/lib/kommentar-list-in-vorgang-container/kommentar-list-in-vorgang-container.component.spec.ts @@ -127,7 +127,7 @@ describe('KommentarListInVorgangContainerComponent', () => { describe('reloadKommentarListOnVorgangReload', () => { beforeEach(() => { - kommentarService.setKommentarListReload.mockClear(); + kommentarService._setKommentarListReload.mockClear(); }); it('should call kommentarService', () => { @@ -138,7 +138,7 @@ describe('KommentarListInVorgangContainerComponent', () => { component.reloadKommentarListOnVorgangReload(); - expect(kommentarService.setKommentarListReload).toHaveBeenCalled(); + expect(kommentarService._setKommentarListReload).toHaveBeenCalled(); }); it('should not call kommentarService', () => { @@ -149,7 +149,7 @@ describe('KommentarListInVorgangContainerComponent', () => { component.reloadKommentarListOnVorgangReload(); - expect(kommentarService.setKommentarListReload).not.toHaveBeenCalled(); + expect(kommentarService._setKommentarListReload).not.toHaveBeenCalled(); }); }); diff --git a/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list-container.component.spec.ts b/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list-container.component.spec.ts index f2b47f34a70349440a1b12df07830044472fc724..62804bcc27411f45fac774d32995f4267b2162f7 100644 --- a/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list-container.component.spec.ts +++ b/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list-container.component.spec.ts @@ -82,7 +82,7 @@ describe('PostfachMailListContainerComponent', () => { describe('reloadPostfachMailListOnVorgangReload', () => { beforeEach(() => { - postfachService.setPostfachMailOnReload.mockClear(); + postfachService._setPostfachMailOnReload.mockClear(); }); it('should call postfachService', () => { @@ -93,7 +93,7 @@ describe('PostfachMailListContainerComponent', () => { component.reloadPostfachMailListOnVorgangReload(); - expect(postfachService.setPostfachMailOnReload).toHaveBeenCalled(); + expect(postfachService._setPostfachMailOnReload).toHaveBeenCalled(); }); it('should not call postfachService', () => { @@ -104,7 +104,7 @@ describe('PostfachMailListContainerComponent', () => { component.reloadPostfachMailListOnVorgangReload(); - expect(postfachService.setPostfachMailOnReload).not.toHaveBeenCalled(); + expect(postfachService._setPostfachMailOnReload).not.toHaveBeenCalled(); }); }); }); diff --git a/alfa-client/libs/wiedervorlage/src/lib/wiedervorlage-list-in-vorgang-container/wiedervorlage-list-in-vorgang-container.component.spec.ts b/alfa-client/libs/wiedervorlage/src/lib/wiedervorlage-list-in-vorgang-container/wiedervorlage-list-in-vorgang-container.component.spec.ts index 305ae85a3562debef815c485cc0820e6971e9139..533f48ef565166aac55ae5fcf355ed99f86a81ce 100644 --- a/alfa-client/libs/wiedervorlage/src/lib/wiedervorlage-list-in-vorgang-container/wiedervorlage-list-in-vorgang-container.component.spec.ts +++ b/alfa-client/libs/wiedervorlage/src/lib/wiedervorlage-list-in-vorgang-container/wiedervorlage-list-in-vorgang-container.component.spec.ts @@ -86,7 +86,7 @@ describe('WiedervorlageListInVorgangContainerComponent', () => { describe('reloadWiedervorlageListOnVorgangReload', () => { beforeEach(() => { - wiedervorlageService.setWiedervorlageListReload.mockClear(); + wiedervorlageService._setWiedervorlageListReload.mockClear(); }); it('should call wiedervorlageService', () => { @@ -97,7 +97,7 @@ describe('WiedervorlageListInVorgangContainerComponent', () => { component.reloadWiedervorlageListOnVorgangReload(); - expect(wiedervorlageService.setWiedervorlageListReload).toHaveBeenCalled(); + expect(wiedervorlageService._setWiedervorlageListReload).toHaveBeenCalled(); }); it('should not call wiedervorlageService', () => { @@ -108,7 +108,7 @@ describe('WiedervorlageListInVorgangContainerComponent', () => { component.reloadWiedervorlageListOnVorgangReload(); - expect(wiedervorlageService.setWiedervorlageListReload).not.toHaveBeenCalled(); + expect(wiedervorlageService._setWiedervorlageListReload).not.toHaveBeenCalled(); }); }); });