本文整理汇总了TypeScript中@angular/platform-browser.By类的典型用法代码示例。如果您正苦于以下问题:TypeScript By类的具体用法?TypeScript By怎么用?TypeScript By使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了By类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("exists", () => {
expect(element.query(By.css("section.community"))).not.toBeNull();
});
示例2: getRemoveCommunicationButton
function getRemoveCommunicationButton(fixture: ComponentFixture<GroupCardComponent>): DebugElement {
return fixture.debugElement.query(By.css(locators.removeCommunicationButton));
}
示例3: expect
.then((fixture: ComponentFixture<any>) => {
let query = fixture.debugElement.query(By.directive(HelloComponent));
expect(query).toBeTruthy();
expect(query.componentInstance).toBeTruthy();
});
示例4: it
it(': should contain content', () => {
el = fixture.debugElement.query(By.css('#software--content'));
expect(el).not.toBe(undefined);
expect(el).not.toBe(null);
});
示例5: it
it('should render today', () => {
expect(componentEl.query(By.css('.sub-title')).nativeElement.textContent).toContain('Today');
});
示例6: expect
.then((fixture: ComponentFixture<any>) => {
let query: DebugElement = fixture.debugElement.query(By.directive(AngularMaterialComponent));
expect(query).toBeTruthy();
expect(query.componentInstance).toBeTruthy();
});
示例7: beforeEach
beforeEach(() => {
fixture = TestBed.createComponent(NzTestFormTextComponent);
fixture.detectChanges();
testComponent = fixture.debugElement.componentInstance;
text = fixture.debugElement.query(By.directive(NzFormTextComponent));
});
示例8: it
it('should not have an .dl-abdtp-up-button', () => {
const upButton = fixture.debugElement.query(By.css('.dl-abdtp-up-button'));
expect(upButton).toBeFalsy();
});