71712: Test fixes: eventemitter to subject in confirmation modal

This commit is contained in:
Marie Verdonck
2020-07-28 01:41:55 +02:00
parent 3e0f4a54e6
commit 26905860ba
6 changed files with 66 additions and 36 deletions

View File

@@ -1,6 +1,6 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { Component, Input, Output } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { Subject } from 'rxjs/internal/Subject';
import { DSpaceObject } from '../../core/shared/dspace-object.model';
@Component({
@@ -18,7 +18,7 @@ export class ConfirmationModalComponent {
* An event fired when the cancel or confirm button is clicked, with respectively false or true
*/
@Output()
response = new EventEmitter<boolean>();
response: Subject<boolean> = new Subject();
constructor(protected activeModal: NgbActiveModal) {
}
@@ -27,7 +27,7 @@ export class ConfirmationModalComponent {
* Confirm the action that led to the modal
*/
confirmPressed() {
this.response.emit(true);
this.response.next(true);
this.close();
}
@@ -35,7 +35,7 @@ export class ConfirmationModalComponent {
* Cancel the action that led to the modal and close modal
*/
cancelPressed() {
this.response.emit(false);
this.response.next(false);
this.close();
}