当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript DebugElement.query方法代码示例

本文整理汇总了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');
 });
开发者ID:dotCMS,项目名称:core-web,代码行数:5,代码来源:dot-edit-page-info.component.spec.ts

示例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' });
 });
开发者ID:dotCMS,项目名称:core-web,代码行数:5,代码来源:dot-language-selector.component.spec.ts

示例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();
 });
开发者ID:dotCMS,项目名称:core-web,代码行数:6,代码来源:dot-nav-icon.component.spec.ts

示例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');
    });
开发者ID:dotCMS,项目名称:core-web,代码行数:6,代码来源:dot-field-helper.component.spec.ts

示例5: openSelectBox

 function openSelectBox() {
     const selectBox = debug.query(By.css(('[data-automation-id="site-my-files-option"] .mat-select-trigger')));
     selectBox.triggerEventHandler('click', null);
 }
开发者ID:Alfresco,项目名称:alfresco-ng2-components,代码行数:4,代码来源:sites-dropdown.component.spec.ts

示例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
开发者ID:AlmogShaul,项目名称:angular,代码行数:25,代码来源:by.ts

示例7: it

 it("hides the list", () => {
   let el = element.query(By.css(".hab-build-list ol"));
   expect(el).toBeNull();
 });
开发者ID:rx007,项目名称:habitat,代码行数:4,代码来源:build-list.component.spec.ts

示例8: testDialogIsOpen

    function testDialogIsOpen(debugElement: DebugElement, dialog: IgxDialogComponent, isOpen: boolean) {
        const dialogDebugElement = debugElement.query(By.css(".igx-dialog"));

        expect(dialog.isOpen).toEqual(isOpen);
    }
开发者ID:rkaraivanov,项目名称:zero-blocks,代码行数:5,代码来源:dialog.component.spec.ts

示例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();
 });
开发者ID:dotCMS,项目名称:core-web,代码行数:6,代码来源:dot-login.component.spec.ts

示例10: getEmbeddedPlunkerComponent

 function getEmbeddedPlunkerComponent() {
   const compDe = liveExampleDe.query(By.directive(EmbeddedPlunkerComponent));
   return compDe && compDe.componentInstance as EmbeddedPlunkerComponent;
 }
开发者ID:jiw0220,项目名称:jigsaw,代码行数:4,代码来源:live-example.component.spec.ts


注:本文中的@angular/core.DebugElement.query方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。