ngOnInit() { // this my onit function in dropdown.ts file
this.getDivisions = [];
this.service.getDivisions().subscribe(data =>{
this.getDivisions = data;
});
}
//下面是我的第二个下拉onchange函数,它给我的值取决于我从部门下拉列表中选择的部门
getRegionForSelectedDivision(selectedDivision) {
this.selectedRegion = "Select Region";
this.isDropdowndisabled = false;
this.getRegions = this.selectedDivision.regionList;
}
实际上我想使用jasmine在spec文件中测试这个依赖的下拉功能,那么如何在spec文件中模拟DataService来测试呢?