diff --git a/alfa-client/libs/vorgang-detail/src/lib/buttons/bescheiden-button/bescheiden-button.component.spec.ts b/alfa-client/libs/vorgang-detail/src/lib/buttons/bescheiden-button/bescheiden-button.component.spec.ts index 34b1e2377fe9e2b125d405b1412227dc9b6e3dae..728a67f0542506e2c817191447c4fce7b5400b6c 100644 --- a/alfa-client/libs/vorgang-detail/src/lib/buttons/bescheiden-button/bescheiden-button.component.spec.ts +++ b/alfa-client/libs/vorgang-detail/src/lib/buttons/bescheiden-button/bescheiden-button.component.spec.ts @@ -24,7 +24,7 @@ import { BescheidWizardContainerComponent } from '@alfa-client/bescheid'; import { BescheidWizardDialogResult } from '@alfa-client/bescheid-shared'; import { CommandResource } from '@alfa-client/command-shared'; -import { createEmptyStateResource, createStateResource, HasLinkPipe, StateResource } from '@alfa-client/tech-shared'; +import { createStateResource, HasLinkPipe, StateResource } from '@alfa-client/tech-shared'; import { createDialogRefMock, DialogRefMock, getElementComponentFromFixtureByCss, getMockComponent, Mock, mock, notExistsAsHtmlElement, tooltipExistsWithText, triggerEvent, } from '@alfa-client/test-utils'; import { OzgcloudDialogService } from '@alfa-client/ui'; import { VorgangCommandService, VorgangService, VorgangWithEingangLinkRel } from '@alfa-client/vorgang-shared'; @@ -36,7 +36,7 @@ import { createCommandResource } from 'libs/command-shared/test/command'; import { getDataTestIdAttributeOf } from 'libs/tech-shared/test/data-test'; import { createVorgangWithEingangResource } from 'libs/vorgang-shared/test/vorgang'; import { MockComponent } from 'ng-mocks'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { BescheidenButtonComponent } from './bescheiden-button.component'; describe('BescheidenButtonComponent', () => { @@ -124,29 +124,6 @@ describe('BescheidenButtonComponent', () => { expect(component.openBescheidenWizard).toHaveBeenCalled(); }); }); - - describe('should do bescheiden', () => { - const command: CommandResource = createCommandResource(); - const comandStateResource$: Observable<StateResource<CommandResource>> = of(createStateResource(command)); - - beforeEach(() => { - vorgangCommandService.bescheiden.mockReturnValue(comandStateResource$); - }); - - it('should call vorgangCommandService.bescheiden', () => { - component.bescheiden(); - - expect(vorgangCommandService.bescheiden).toHaveBeenCalled(); - }); - - it('should assign response', () => { - component.commandStateResource$ = of(createEmptyStateResource<CommandResource>()); - - component.bescheiden(); - - expect(component.commandStateResource$).toBe(comandStateResource$); - }); - }); }); describe('bescheiden icon button', () => { diff --git a/alfa-client/libs/vorgang-detail/src/lib/buttons/bescheiden-button/bescheiden-button.component.ts b/alfa-client/libs/vorgang-detail/src/lib/buttons/bescheiden-button/bescheiden-button.component.ts index c6b90c722c890f051a37a8233a068896288d92b4..eb3496cd4e8844f34b270c19ee130fc9722639c2 100644 --- a/alfa-client/libs/vorgang-detail/src/lib/buttons/bescheiden-button/bescheiden-button.component.ts +++ b/alfa-client/libs/vorgang-detail/src/lib/buttons/bescheiden-button/bescheiden-button.component.ts @@ -65,18 +65,7 @@ export class BescheidenButtonComponent implements OnInit { } public bescheiden(): void { - if (this.shouldOpenBescheidenWizard()) { - this.openBescheidenWizard(); - } else { - this.commandStateResource$ = this.vorgangCommandService.bescheiden(this.vorgang); - } - } - - private shouldOpenBescheidenWizard(): boolean { - return ( - hasLink(this.vorgang, VorgangWithEingangLinkRel.CREATE_BESCHEID_DRAFT) || - hasLink(this.vorgang, VorgangWithEingangLinkRel.BESCHEID_DRAFT) - ); + this.openBescheidenWizard(); } public openBescheidenWizard(): void {