【发布时间】:2016-12-07 00:16:56
【问题描述】:
我想测试一个使用材料设计并有标题的组件。
<md-card-title>{{title}}</md-card-title>
如何查询包含标题的元素?
it('should display original title', () => {
// trigger change detection to update the view
fixture.detectChanges();
// query for the title by what ???
de = fixture.debugElement.query(By ???('md-card-title'));
// confirm the element's content
expect(de.nativeElement.textContent).toContain(comp.title);
});
【问题讨论】:
标签: angular testing material-design