本文整理匯總了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.');
});