Skip to content
Snippets Groups Projects
Commit 2aa2dedd authored by Martin's avatar Martin
Browse files

OZG-7501 rename forwardingToUri -> targetUri

parent 249a078b
No related branches found
No related tags found
1 merge request!100Ozg 7501 weiterleitung vorbereiten
......@@ -67,19 +67,19 @@ describe('ForwardingDialogContainerComponent', () => {
});
describe('forward button', () => {
const forwardingToUri: ResourceUri = faker.internet.url();
const targetUri: ResourceUri = faker.internet.url();
it('should call forward on click', () => {
component.forward = jest.fn();
triggerEvent({ fixture, elementSelector: forwardingDialog, name: 'forward', data: forwardingToUri });
triggerEvent({ fixture, elementSelector: forwardingDialog, name: 'forward', data: targetUri });
expect(component.forward).toHaveBeenCalledWith(forwardingToUri);
expect(component.forward).toHaveBeenCalledWith(targetUri);
});
});
describe('forward', () => {
const forwardingToUri: ResourceUri = faker.internet.url();
const targetUri: ResourceUri = faker.internet.url();
const commandStateResource: StateResource<CommandResource> = createCommandStateResource([CommandLinkRel.EFFECTED_RESOURCE]);
......@@ -88,19 +88,19 @@ describe('ForwardingDialogContainerComponent', () => {
});
it('should call service with uri', () => {
component.forward(forwardingToUri);
component.forward(targetUri);
expect(service.forward).toHaveBeenCalledWith(forwardingToUri);
expect(service.forward).toHaveBeenCalledWith(targetUri);
});
it('should set service response', () => {
component.forward(forwardingToUri);
component.forward(targetUri);
expect(component.forwardCommandStateResource$).toBeObservable(singleColdCompleted(commandStateResource));
});
it('should call dialog service to close all if command is done', () => {
component.forward(forwardingToUri);
component.forward(targetUri);
component.forwardCommandStateResource$.subscribe();
expect(dialogService.closeAll).toHaveBeenCalled();
......
......@@ -41,8 +41,8 @@ export class ForwardingDialogContainerComponent implements OnInit {
this.selectedSearchResult$ = this.organisationsEinheitService.getSelectedResult();
}
public forward(forwardingToUri: ResourceUri): void {
this.forwardCommandStateResource$ = this.forwardingService.forward(forwardingToUri).pipe(
public forward(targetUri: ResourceUri): void {
this.forwardCommandStateResource$ = this.forwardingService.forward(targetUri).pipe(
tapOnCommandSuccessfullyDone(() => {
this.dialogService.closeAll();
}),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment