本文整理汇总了TypeScript中@angular/core.DebugElement.query方法的典型用法代码示例。如果您正苦于以下问题:TypeScript DebugElement.query方法的具体用法?TypeScript DebugElement.query怎么用?TypeScript DebugElement.query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/core.DebugElement
的用法示例。
在下文中一共展示了DebugElement.query方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should have copy button', () => {
const button: DebugElement = de.query(By.css('dot-copy-button '));
expect(button.componentInstance.copy).toBe('http://demo.dotcms.com:9876/an/url/test');
expect(button.componentInstance.tooltipText).toBe('Copy url page');
});
示例2: it
it('shoudl set fixed width to dropdown', () => {
fixture.detectChanges();
const pDropDown: Dropdown = de.query(By.css('p-dropdown')).componentInstance;
expect(pDropDown.style).toEqual({ width: '100px' });
});
示例3: it
it('should have font awesome icon', () => {
comp.icon = 'fa-test';
fixture.detectChanges();
const faIcon: HTMLElement = de.query(By.css('.fa')).componentInstance;
expect(faIcon).toBeDefined();
});
示例4: it
it('should have correct attributes on button', () => {
const iconButton: DotIconButtonComponent = de.query(By.css('dot-icon-button'))
.componentInstance;
expect(iconButton.icon).toEqual('help_outline');
});
示例5: openSelectBox
function openSelectBox() {
const selectBox = debug.query(By.css(('[data-automation-id="site-my-files-option"] .mat-select-trigger')));
selectBox.triggerEventHandler('click', null);
}
示例6:
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {DebugElement} from '@angular/core';
import {By} from '@angular/platform-browser';
let debugElement: DebugElement;
class MyDirective {}
// #docregion by_all
debugElement.query(By.all());
// #enddocregion
// #docregion by_css
debugElement.query(By.css('[attribute]'));
// #enddocregion
// #docregion by_directive
debugElement.query(By.directive(MyDirective));
// #enddocregion
示例7: it
it("hides the list", () => {
let el = element.query(By.css(".hab-build-list ol"));
expect(el).toBeNull();
});
示例8: testDialogIsOpen
function testDialogIsOpen(debugElement: DebugElement, dialog: IgxDialogComponent, isOpen: boolean) {
const dialogDebugElement = debugElement.query(By.css(".igx-dialog"));
expect(dialog.isOpen).toEqual(isOpen);
}
示例9: it
it('should show messages', () => {
component.message = 'Authentication failed. Please try again.';
fixture.detectChanges();
const messageElemement = de.query(By.css('.error-message'));
expect(messageElemement).not.toBeNull();
});
示例10: getEmbeddedPlunkerComponent
function getEmbeddedPlunkerComponent() {
const compDe = liveExampleDe.query(By.directive(EmbeddedPlunkerComponent));
return compDe && compDe.componentInstance as EmbeddedPlunkerComponent;
}