当前位置: 首页>>代码示例>>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;未经允许,请勿转载。