Skip to content
Snippets Groups Projects
Commit 56e2286c authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6302 rename anfrageFormular - requestForm

parent 4ca5e317
Branches
Tags
No related merge requests found
Showing
with 45 additions and 45 deletions
...@@ -7,36 +7,36 @@ describe('CollaborationService', () => { ...@@ -7,36 +7,36 @@ describe('CollaborationService', () => {
service = new CollaborationService(); service = new CollaborationService();
}); });
describe('is anfrage formular visible', () => { describe('is request form visible', () => {
it('should return value', (done) => { it('should return value', (done) => {
service.showAnfrageFormular$.next(false); service.showRequestForm$.next(false);
service.isAnfrageFormularVisible().subscribe((isVisible: boolean) => { service.isRequestFormVisible().subscribe((isVisible: boolean) => {
expect(isVisible).toBeTruthy(); expect(isVisible).toBeTruthy();
done(); done();
}); });
service.showAnfrageFormular(); service.showRequestForm();
}); });
}); });
describe('show anfrage formular', () => { describe('show anfrage formular', () => {
it('should set "showAnfrageFormular" to true', () => { it('should set "showRequestForm" to true', () => {
service.showAnfrageFormular$.next(false); service.showRequestForm$.next(false);
service.showAnfrageFormular(); service.showRequestForm();
expect(service.showAnfrageFormular$.value).toBeTruthy(); expect(service.showRequestForm$.value).toBeTruthy();
}); });
}); });
describe('hide anfrage formular', () => { describe('hide anfrage formular', () => {
it('should set "showAnfrageFormular" to false', () => { it('should set "showRequestForm" to false', () => {
service.showAnfrageFormular$.next(true); service.showRequestForm$.next(true);
service.hideAnfrageFormular(); service.hideRequestForm();
expect(service.showAnfrageFormular$.value).toBeFalsy(); expect(service.showRequestForm$.value).toBeFalsy();
}); });
}); });
}); });
...@@ -3,17 +3,17 @@ import { BehaviorSubject, Observable } from 'rxjs'; ...@@ -3,17 +3,17 @@ import { BehaviorSubject, Observable } from 'rxjs';
@Injectable() @Injectable()
export class CollaborationService { export class CollaborationService {
showAnfrageFormular$: BehaviorSubject<boolean> = new BehaviorSubject(false); showRequestForm$: BehaviorSubject<boolean> = new BehaviorSubject(false);
public isAnfrageFormularVisible(): Observable<boolean> { public isRequestFormVisible(): Observable<boolean> {
return this.showAnfrageFormular$.asObservable(); return this.showRequestForm$.asObservable();
} }
public showAnfrageFormular(): void { public showRequestForm(): void {
this.showAnfrageFormular$.next(true); this.showRequestForm$.next(true);
} }
public hideAnfrageFormular(): void { public hideRequestForm(): void {
this.showAnfrageFormular$.next(false); this.showRequestForm$.next(false);
} }
} }
...@@ -3,15 +3,15 @@ ...@@ -3,15 +3,15 @@
variant="outline" variant="outline"
text="Anfrage erstellen" text="Anfrage erstellen"
data-test-id="anfrage-erstellen-button" data-test-id="anfrage-erstellen-button"
(clickEmitter)="showAnfrageFormular()" (clickEmitter)="showRequestForm()"
> >
<ods-collaboration-icon icon /> <ods-collaboration-icon icon />
</ods-button> </ods-button>
</ng-template> </ng-template>
<ng-container *ngIf="isAnfrageFormularVisible$ | async; else anfrageErstellenButton"> <ng-container *ngIf="isRequestFormVisible$ | async; else anfrageErstellenButton">
<alfa-collaboration-request-container <alfa-collaboration-request-container
data-test-id="collaboration-request-container" data-test-id="collaboration-request-container"
(hideFormular)="hideFormular()" (hideRequestForm)="hideRequestForm()"
></alfa-collaboration-request-container> ></alfa-collaboration-request-container>
</ng-container> </ng-container>
...@@ -23,7 +23,7 @@ describe('CollaborationInVorgangContainerComponent', () => { ...@@ -23,7 +23,7 @@ describe('CollaborationInVorgangContainerComponent', () => {
const service: Mock<CollaborationService> = { const service: Mock<CollaborationService> = {
...mock(CollaborationService), ...mock(CollaborationService),
isAnfrageFormularVisible: jest.fn().mockReturnValue(of(false)), isRequestFormVisible: jest.fn().mockReturnValue(of(false)),
}; };
beforeEach(async () => { beforeEach(async () => {
...@@ -55,14 +55,14 @@ describe('CollaborationInVorgangContainerComponent', () => { ...@@ -55,14 +55,14 @@ describe('CollaborationInVorgangContainerComponent', () => {
it('should call service', () => { it('should call service', () => {
component.ngOnInit(); component.ngOnInit();
expect(service.isAnfrageFormularVisible).toHaveBeenCalled(); expect(service.isRequestFormVisible).toHaveBeenCalled();
}); });
}); });
describe('anfrage erstellen button', () => { describe('anfrage erstellen button', () => {
describe('on anfrage formular visibility false', () => { describe('on request form visibility false', () => {
beforeEach(() => { beforeEach(() => {
component.isAnfrageFormularVisible$ = of(false); component.isRequestFormVisible$ = of(false);
}); });
it('should be shown', () => { it('should be shown', () => {
...@@ -76,12 +76,12 @@ describe('CollaborationInVorgangContainerComponent', () => { ...@@ -76,12 +76,12 @@ describe('CollaborationInVorgangContainerComponent', () => {
dispatchEventFromFixture(fixture, anfrageErstellenButton, 'clickEmitter'); dispatchEventFromFixture(fixture, anfrageErstellenButton, 'clickEmitter');
expect(service.showAnfrageFormular).toHaveBeenCalled(); expect(service.showRequestForm).toHaveBeenCalled();
}); });
}); });
it('should be hidden if formular visibility is true', () => { it('should be hidden if request form visibility is true', () => {
component.isAnfrageFormularVisible$ = of(true); component.isRequestFormVisible$ = of(true);
fixture.detectChanges(); fixture.detectChanges();
...@@ -90,9 +90,9 @@ describe('CollaborationInVorgangContainerComponent', () => { ...@@ -90,9 +90,9 @@ describe('CollaborationInVorgangContainerComponent', () => {
}); });
describe('zustaendige stelle', () => { describe('zustaendige stelle', () => {
describe('on anfrage formular visibility true', () => { describe('on request form visibility true', () => {
beforeEach(() => { beforeEach(() => {
component.isAnfrageFormularVisible$ = of(true); component.isRequestFormVisible$ = of(true);
}); });
it('should be shown', () => { it('should be shown', () => {
fixture.detectChanges(); fixture.detectChanges();
...@@ -103,14 +103,14 @@ describe('CollaborationInVorgangContainerComponent', () => { ...@@ -103,14 +103,14 @@ describe('CollaborationInVorgangContainerComponent', () => {
it('should call service on hideFormular output', () => { it('should call service on hideFormular output', () => {
fixture.detectChanges(); fixture.detectChanges();
dispatchEventFromFixture(fixture, collaborationRequestContainer, 'hideFormular'); dispatchEventFromFixture(fixture, collaborationRequestContainer, 'hideRequestForm');
expect(service.hideAnfrageFormular).toHaveBeenCalled(); expect(service.hideRequestForm).toHaveBeenCalled();
}); });
}); });
it('should be hidden if formular visibility is false', () => { it('should be hidden if request form visibility is false', () => {
component.isAnfrageFormularVisible$ = of(false); component.isRequestFormVisible$ = of(false);
fixture.detectChanges(); fixture.detectChanges();
......
...@@ -7,19 +7,19 @@ import { Observable } from 'rxjs'; ...@@ -7,19 +7,19 @@ import { Observable } from 'rxjs';
templateUrl: './collaboration-in-vorgang-container.component.html', templateUrl: './collaboration-in-vorgang-container.component.html',
}) })
export class CollaborationInVorgangContainerComponent implements OnInit { export class CollaborationInVorgangContainerComponent implements OnInit {
public isAnfrageFormularVisible$: Observable<boolean>; public isRequestFormVisible$: Observable<boolean>;
constructor(private service: CollaborationService) {} constructor(private service: CollaborationService) {}
ngOnInit(): void { ngOnInit(): void {
this.isAnfrageFormularVisible$ = this.service.isAnfrageFormularVisible(); this.isRequestFormVisible$ = this.service.isRequestFormVisible();
} }
public showAnfrageFormular(): void { public showRequestForm(): void {
this.service.showAnfrageFormular(); this.service.showRequestForm();
} }
public hideFormular(): void { public hideRequestForm(): void {
this.service.hideAnfrageFormular(); this.service.hideRequestForm();
} }
} }
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
variant="outline" variant="outline"
text="Abbrechen" text="Abbrechen"
data-test-id="collaboration-request-abbrechen-button" data-test-id="collaboration-request-abbrechen-button"
(clickEmitter)="hideFormular.emit()" (clickEmitter)="hideRequestForm.emit()"
> >
<ods-close-icon icon class="fill-primary"></ods-close-icon> <ods-close-icon icon class="fill-primary"></ods-close-icon>
</ods-button> </ods-button>
......
...@@ -34,8 +34,8 @@ describe('CollaborationRequestContainerComponent', () => { ...@@ -34,8 +34,8 @@ describe('CollaborationRequestContainerComponent', () => {
}); });
describe('abbrechen button', () => { describe('abbrechen button', () => {
it('should emit hideFormular', () => { it('should emit hideRequestForm', () => {
const emitSpy = (component.hideFormular.emit = jest.fn()); const emitSpy = (component.hideRequestForm.emit = jest.fn());
dispatchEventFromFixture(fixture, abbrechenButton, 'clickEmitter'); dispatchEventFromFixture(fixture, abbrechenButton, 'clickEmitter');
......
...@@ -5,5 +5,5 @@ import { Component, EventEmitter, Output } from '@angular/core'; ...@@ -5,5 +5,5 @@ import { Component, EventEmitter, Output } from '@angular/core';
templateUrl: './collaboration-request-container.component.html', templateUrl: './collaboration-request-container.component.html',
}) })
export class CollaborationRequestContainerComponent { export class CollaborationRequestContainerComponent {
@Output() public hideFormular: EventEmitter<void> = new EventEmitter<void>(); @Output() public hideRequestForm: EventEmitter<void> = new EventEmitter<void>();
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment