本文整理汇总了TypeScript中@angular/platform-browser.By.css方法的典型用法代码示例。如果您正苦于以下问题:TypeScript By.css方法的具体用法?TypeScript By.css怎么用?TypeScript By.css使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/platform-browser.By
的用法示例。
在下文中一共展示了By.css方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: xit
xit('should highlight query for item match', () => {
const im = fixture.debugElement.queryAll(By.css('.dropdown-menu li:not(.dropdown-header) span'));
expect(im[1].nativeElement.innerHTML).toBe('<strong>a</strong>pple');
});
示例2: it
it('should have dot-icon', () => {
comp.icon = 'test';
fixture.detectChanges();
const dotIconComponent: DotIconComponent = de.query(By.css('dot-icon')).componentInstance;
expect(dotIconComponent).toBeDefined();
});
示例3: it
it('should show the impressions', () => {
const impressions = fixture.debugElement.query(By.css('.m-boost-card--impressions'));
expect(impressions).not.toBeNull();
expect(impressions.nativeElement.textContent).toContain('3,000 views');
});
示例4:
const getSaveRemoteResultMessageEl = (): HTMLElement =>
fixture.debugElement.query(By.css('.VcsSettings__saveRemoteResultMessage')).nativeElement as HTMLElement;
示例5: it
it('should display the users name', () => {
let de = fixture.debugElement.query(By.css('button'));
let el = de.nativeElement;
expect(el.textContent).toContain('nameymcnameface');
});
示例6: expect
fixture.whenStable().then(() => {
button = fixture.debugElement.query(By.css('#findOrder'));
button.triggerEventHandler('click',null);
expect(fixture.componentInstance.findOrderByOrderNumber).toHaveBeenCalled();
});
示例7: it
it('should displays a warning message', () => {
const page: HTMLElement = fixture.debugElement.query(By.css('#app-versions')).nativeElement;
expect(page.textContent).toContain('Application unavailable.');
expect(page.textContent).toContain('You have to set a default version for this application.');
});