當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript DebugElement.triggerEventHandler方法代碼示例

本文整理匯總了TypeScript中@angular/core.DebugElement.triggerEventHandler方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript DebugElement.triggerEventHandler方法的具體用法?TypeScript DebugElement.triggerEventHandler怎麽用?TypeScript DebugElement.triggerEventHandler使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@angular/core.DebugElement的用法示例。


在下文中一共展示了DebugElement.triggerEventHandler方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

                it('should show confirmation dialog and handle reject', () => {
                    spyOn(dotAlertConfirmService, 'confirm').and.callFake((conf) => {
                        conf.reject();
                    });

                    dotIframeDialog.triggerEventHandler('custom', {
                        detail: {
                            name: 'edit-contentlet-data-updated',
                            payload: true
                        }
                    });

                    dotIframeDialog.triggerEventHandler('beforeClose', {
                        close: () => {}
                    });

                    expect(dotAlertConfirmService.confirm).toHaveBeenCalledWith({
                        accept: jasmine.any(Function),
                        reject: jasmine.any(Function),
                        header: 'Header',
                        message: 'Message',
                        footerLabel: {
                            accept: 'Accept'
                        }
                    });
                    expect(component.close.emit).not.toHaveBeenCalled();
                    expect(dotAddContentletService.clear).not.toHaveBeenCalled();
                });
開發者ID:dotCMS,項目名稱:core-web,代碼行數:28,代碼來源:dot-contentlet-wrapper.component.spec.ts

示例2: it

  it('should listen to native focus and blur events', () => {
    spyOn(component, 'onFocusChange');

    testElement.triggerEventHandler('focus', null);
    testElement.triggerEventHandler('blur', null);

    expect(component.onFocusChange).toHaveBeenCalledTimes(2);
  });
開發者ID:hawtio,項目名稱:hawtio-ipaas,代碼行數:8,代碼來源:syndesis-form-control.component.spec.ts

示例3: xit

    xit("should listen to native focus and blur events", () => {

        spyOn(component, "onFocusChange");

        inputElement.triggerEventHandler("focus", null);
        inputElement.triggerEventHandler("blur", null);

        expect(component.onFocusChange).toHaveBeenCalledTimes(2);
    });
開發者ID:CodeFork,項目名稱:ng2-dynamic-forms,代碼行數:9,代碼來源:dynamic-form-material.component.spec.ts

示例4: it

  it('Hover over input to check background change', () => {
    input_element.triggerEventHandler('mouseover', null);
    fixture.detectChanges();
    expect(input_element.nativeElement.style.backgroundColor).toBe('red');

    input_element.triggerEventHandler('mouseout', null);
    fixture.detectChanges();
    expect(input_element.nativeElement.style.backgroundColor).toBe('inherit');
  });
開發者ID:sbjavateam,項目名稱:TypeScript-2.x-for-Angular-Developers,代碼行數:9,代碼來源:background-changer.directive.spec.ts

示例5: it

    it('should execute the command on the selected menu item and hide the menu', () => {
        spyOn(component.model[0], 'command');

        button.triggerEventHandler('click', {
            stopPropagation: () => {}
        });
        fixture.detectChanges();

        const menuItem: DebugElement = fixture.debugElement.query(By.css('.dot-menu-item__link'));
        menuItem.triggerEventHandler('click', {
            stopPropagation: () => {}
        });

        expect(component.model[0].command).toHaveBeenCalled();
        expect(component.visible).toBeFalsy();
    });
開發者ID:dotCMS,項目名稱:core-web,代碼行數:16,代碼來源:dot-menu.component.spec.ts

示例6: it

                    it('should call close method on dot-dialog on dot-iframe escape key', () => {
                        dotIframe.triggerEventHandler('keydown', {
                            key: 'Escape'
                        });

                        expect(component.keydown.emit).toHaveBeenCalledTimes(1);
                    });
開發者ID:dotCMS,項目名稱:core-web,代碼行數:7,代碼來源:dot-iframe-dialog.component.spec.ts

示例7: beforeEach

        beforeEach(() => {
            migrationIssueService = de.injector.get(MigrationIssuesService);
            migrationIssueService.getIssuesPerFile.and.returnValue(new Observable<any>(observer => {
                let data = [
                    {
                        occurrences: 3,
                        file: {
                            fileName: 'SearchOperatorEnum.java'
                        }
                    },
                    {
                        occurrences: 3,
                        file: {
                            fileName: 'SearchOperatorEnumNoPath.java'
                        }
                    },
                    {
                        occurrences: 4,
                        file: {
                            fileName: 'DescriptionDaoImpl.java'
                        }
                    }
                ];

                observer.next(data);
                observer.complete();
            }));

            de = fixture.debugElement.query(By.css('a.issue-title'));
            el = de.nativeElement;

            de.triggerEventHandler('click', null);
            fixture.detectChanges();
        });
開發者ID:d-s,項目名稱:windup-web,代碼行數:34,代碼來源:migration-issues-table.component.spec.ts

示例8: it

 it('should transform containers raw data from component "dot-container-selector" into proper data to be saved in the BE', () => {
     const containerSelector: DebugElement = hostComponentfixture.debugElement.query(
         By.css('dot-container-selector')
     );
     const transformedValue = {
         containers: [
             {
                 identifier: mockDotContainers[0].container.identifier,
                 uuid: undefined
             },
             {
                 identifier: mockDotContainers[1].container.identifier,
                 uuid: undefined
             }
         ],
         location: 'left',
         width: 'small'
     };
     spyOn(component, 'updateAndPropagate').and.callThrough();
     spyOn(component, 'propagateChange');
     containerSelector.triggerEventHandler('change', 'mockDotContainers');
     component.updateAndPropagate(mockDotContainers);
     expect(component.updateAndPropagate).toHaveBeenCalled();
     expect(component.propagateChange).toHaveBeenCalledWith(transformedValue);
 });
開發者ID:dotCMS,項目名稱:core-web,代碼行數:25,代碼來源:dot-edit-layout-sidebar.component.spec.ts

示例9: it

 it('should close the task details dialog when close button clicked', () => {
     component.clickTask({}, new TaskDetailsModel(taskDetailsMock));
     fixture.detectChanges();
     let closeButton: DebugElement = debugElement.query(By.css('[data-automation-id="button-task-close"]'));
     closeButton.triggerEventHandler('click', null);
     expect(closeSpy).toHaveBeenCalled();
 });
開發者ID:Pokhriyal,項目名稱:alfresco-ng2-components,代碼行數:7,代碼來源:activiti-process-instance-tasks.component.spec.ts

示例10: it

 it('list another page when page was changed', fakeAsync(() => {
   pagerDebugElement.triggerEventHandler('pageChanged', {page: 2});
   advance(fixture);
   cmpDebugElement = fixture.debugElement.query(By.directive(UserListComponent));
   const cmp:UserListComponent = cmpDebugElement.componentInstance;
   expect(cmp.page).toEqual(2);
 }));
開發者ID:Angular-Reference,項目名稱:angular2-app,代碼行數:7,代碼來源:user-list.component.spec.ts


注:本文中的@angular/core.DebugElement.triggerEventHandler方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。