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


TypeScript ComponentFixture.whenStable方法代码示例

本文整理汇总了TypeScript中@angular/core/testing.ComponentFixture.whenStable方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ComponentFixture.whenStable方法的具体用法?TypeScript ComponentFixture.whenStable怎么用?TypeScript ComponentFixture.whenStable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@angular/core/testing.ComponentFixture的用法示例。


在下文中一共展示了ComponentFixture.whenStable方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: expect

            component.success.subscribe((res) => {
                fixture.detectChanges();
                fixture.whenStable().then(() => {
                    expect(res).toBeDefined();
                    let event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]');
                    expect(event).not.toBeNull();

                    let iconEvent: any = element.querySelector('diagram-end-event > diagram-event >' +
                        ' diagram-container-icon-event > div > div > diagram-icon-error > raphael-icon-error');
                    expect(iconEvent).not.toBeNull();
                    let tooltip: any = element.querySelector('diagram-tooltip > div');
                    expect(tooltip.textContent).toContain(res.elements[0].id);
                    expect(tooltip.textContent).toContain(res.elements[0].type);
                });
            });
开发者ID:Alfresco,项目名称:alfresco-ng2-components,代码行数:15,代码来源:diagram.component.events.spec.ts

示例2: expect

    dialog.open(PizzaMsg, config).then(dialogRef => {
      viewContainerFixture.detectChanges();

      let afterCloseResult: string;
      dialogRef.afterClosed().subscribe(result => {
        afterCloseResult = result;
      });

      dialogRef.close('Charmander');

      viewContainerFixture.whenStable().then(() => {
        expect(afterCloseResult).toBe('Charmander');
        expect(overlayContainerElement.childNodes.length).toBe(0);
      });
    });
开发者ID:divyakumarjain,项目名称:material2,代码行数:15,代码来源:dialog.spec.ts

示例3: it

 it('should render a disabled attachForm button if the user select the original formId', async(() => {
     component.taskId = 1;
     component.formId = 2;
     component.attachFormControl.setValue(3);
     fixture.detectChanges();
     spyOn(taskService, 'attachFormToATask').and.returnValue(of(true));
     fixture.detectChanges();
     fixture.whenStable().then(() => {
         fixture.detectChanges();
         component.attachFormControl.setValue(2);
         fixture.detectChanges();
         let attachButton = fixture.debugElement.query(By.css('#adf-no-form-attach-form-button'));
         expect(attachButton.nativeElement.disabled).toBeTruthy();
     });
 }));
开发者ID:Alfresco,项目名称:alfresco-ng2-components,代码行数:15,代码来源:attach-form.component.spec.ts

示例4: it

  it('should show QUEUED if status is QUEUED', async(() => {
    component.state = ScanState.QUEUED;
    fixture.detectChanges();

    fixture.whenStable().then(() => { // wait for async getRecentLogs
      fixture.detectChanges();

      let el: HTMLElement = fixture.nativeElement.querySelector('.bar-state');
      expect(el).toBeTruthy();
      let el2: HTMLElement = el.querySelector('span');
      expect(el2).toBeTruthy();
      expect(el2.textContent).toEqual('VULNERABILITY.STATE.QUEUED');

    });
  }));
开发者ID:wemeya,项目名称:harbor,代码行数:15,代码来源:result-bar-chart.component.spec.ts

示例5: it

    it('on init should get all things', async () => {
        const http = TestBed.get(HttpTestingController);
        const customConfiguration = TestBed.get(Configuration);
        const expectedResponse = [{ id: 1, name: 'NetCore' }];

        const url = customConfiguration.Server + 'api/things/';

        fixture.detectChanges();

        http.expectOne(url).flush(expectedResponse);

        fixture.whenStable().then(() => {
            expect(comp.things).toEqual(expectedResponse);
        });
    })
开发者ID:1ceeeeee,项目名称:VentCalc,代码行数:15,代码来源:home.component.spec.ts

示例6: it

 it('should open to edit existing endpoint', async(()=>{
   fixture.detectChanges();
   fixture.whenStable().then(()=>{
     let de: DebugElement = fixture.debugElement.query(del=>del.classes['action-item']);
     expect(de).toBeTruthy();
     fixture.detectChanges();
     click(de);
     fixture.detectChanges();
     let deInput: DebugElement = fixture.debugElement.query(By.css('input'));
     expect(deInput).toBeTruthy();
     let elInput: HTMLElement = deInput.nativeElement;
     expect(elInput).toBeTruthy();
     expect(elInput.textContent).toEqual('target_01');
   });
 }));
开发者ID:LilyFaFa,项目名称:harbor,代码行数:15,代码来源:endpoint.component.spec.ts

示例7: it

  it('should show QUEUED if status is QUEUED', async(() => {
    component.summary.scan_status = VULNERABILITY_SCAN_STATUS.pending;
    fixture.detectChanges();

    fixture.whenStable().then(() => {
      fixture.detectChanges();

      let el: HTMLElement = fixture.nativeElement.querySelector('.bar-state');
      expect(el).toBeTruthy();
      let el2: HTMLElement = el.querySelector('span');
      expect(el2).toBeTruthy();
      expect(el2.textContent).toEqual('VULNERABILITY.STATE.QUEUED');

    });
  }));
开发者ID:lengwei2018,项目名称:harbor,代码行数:15,代码来源:result-bar-chart.component.spec.ts

示例8: it

    it('should update the property value after a successful update attempt', async(() => {
        component.editable = true;
        component.property.editable = true;
        component.property.value = null;
        const expectedDate = moment('Jul 10 2017', 'MMM DD YY');
        fixture.detectChanges();

        component.onDateChanged({ value: expectedDate });

        fixture.whenStable().then(
            (updateNotification) => {
                expect(component.property.value).toEqual(expectedDate.toDate());
            }
        );
    }));
开发者ID:Alfresco,项目名称:alfresco-ng2-components,代码行数:15,代码来源:card-view-dateitem.component.spec.ts


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