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

OZG-6185 remove direct bescheiden passing wizard

parent 399782cd
Branches
Tags
1 merge request!90Ozg 6185 remove old bescheid code
......@@ -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', () => {
......
......@@ -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)
);
}
public openBescheidenWizard(): void {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment