當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。