How to do jasmine unit test case for angular 6 bootstrap 4 modal
问题 html <ng-template #content let-modal> <h1>Modal content inside this ng-template #content </h1> </ng-template> Button to open model <button (click)="open(content)" > Open modal </button> In ts file import { NgbModal, ModalDismissReasons } from '@ng-bootstrap/ng-bootstrap'; constructor( public modalService: NgbModal) { } open(content) { this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title', size: 'lg' }).result.then((result) => { this.closeResult = `Closed with: ${result}`; },