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

OZG-6185 show create document error

Sub task: OZG-6188
parent 8e848f95
Branches
Tags
2 merge requests!43Bescheid refactoring Schritte 2 und 3,!33OZG-6185 refactor dokumente hochladen
...@@ -42,7 +42,7 @@ import { createBescheid, createBescheidResource } from '../test/bescheid'; ...@@ -42,7 +42,7 @@ import { createBescheid, createBescheidResource } from '../test/bescheid';
import { createDocumentResource } from '../test/document'; import { createDocumentResource } from '../test/document';
import { BescheidFacade } from './+state/bescheid.facade'; import { BescheidFacade } from './+state/bescheid.facade';
import { BescheidLinkRel } from './bescheid.linkrel'; import { BescheidLinkRel } from './bescheid.linkrel';
import { Bescheid, BescheidAttachments, BescheidResource, BescheidWizardStep, createEmptyBescheidAttachments, createEmptyBescheidDocument, createEmptyUploadInProgress, } from './bescheid.model'; import { Bescheid, BescheidAttachments, BescheidDocument, BescheidResource, BescheidWizardStep, createEmptyBescheidAttachments, createEmptyBescheidDocument, createEmptyUploadInProgress, } from './bescheid.model';
import { DocumentLinkRel } from './document.linkrel'; import { DocumentLinkRel } from './document.linkrel';
import { DocumentResource } from './document.model'; import { DocumentResource } from './document.model';
...@@ -316,17 +316,13 @@ describe('BescheidService', () => { ...@@ -316,17 +316,13 @@ describe('BescheidService', () => {
}); });
it('should emit error', () => { it('should emit error', () => {
const commandError: StateResource<CommandResource> = createCommandErrorStateResource(); const commandErrorStateResource: StateResource<CommandResource> = createCommandErrorStateResource();
service.handleCreateBescheidDocumentResponse(commandError);
expect(service.emitBescheidDocumentError).toHaveBeenCalledWith(commandError); service.handleCreateBescheidDocumentResponse(commandErrorStateResource);
});
it('should NOT emit error', () => { expect(service.getBescheidDocument()).toBeObservable(
service.handleCreateBescheidDocumentResponse(commandStateResource); singleCold({ ...createEmptyBescheidDocument(), create: commandErrorStateResource } as BescheidDocument),
);
expect(service.emitBescheidDocumentError).not.toHaveBeenCalled();
}); });
it('should emit bescheid document state', () => { it('should emit bescheid document state', () => {
......
...@@ -147,7 +147,7 @@ export class BescheidService2 { ...@@ -147,7 +147,7 @@ export class BescheidService2 {
this.bescheidDocument$.next({ ...this.bescheidDocument$.value, documentUri }); this.bescheidDocument$.next({ ...this.bescheidDocument$.value, documentUri });
this.loadBescheidDocumentByUri(documentUri); this.loadBescheidDocumentByUri(documentUri);
} else { } else {
this.emitBescheidDocumentError(commandStateResource); this.bescheidDocument$.next({ ...this.bescheidDocument$.value, create: commandStateResource });
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment