我試圖從父組件中獲取子組件的元素以在Karma-Jasmine中進行測試。 我有一個組件(父母)的聯繫表格,它又有一個用戶名和密碼組件(子),用於驗證表單和顯示錯誤消息。現在我需要測試父組件的子組件的警報消息。我試過以下 let parent = fixture.debugElement.query(By.css('input-component'));
let child = pare
我正在測試一個服務功能,該功能會撥打衆多$http.get()調用。被測實際功能返回一個承諾。目前,該測試未通過response is undefined。 下面是測試: it('should return the list of catalogues', inject(function ($q, bookService) {
var list;
var deferred =