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


TypeScript TestComponentBuilder.overrideTemplate方法代码示例

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


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

示例1: expect

           (tcb: TestComponentBuilder, async: AsyncTestCompleter) => {
             var template = `<template [ngTemplateOutlet]="null"></template>`;
             tcb.overrideTemplate(TestComponent, template)
                 .createAsync(TestComponent)
                 .then((fixture) => {

                   fixture.detectChanges();
                   expect(fixture.nativeElement).toHaveText('');

                   async.done();
                 });
           }));
开发者ID:lanting2009,项目名称:angular,代码行数:12,代码来源:ng_template_outlet_spec.ts

示例2: inject

 inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
     tcb.overrideTemplate(TestCmp, `
         <ul>
             <li *ngFor="let item of collection | paginate: config" class="list-item">{{ item }}</li>
         </ul>
         <pagination-controls autoHide="false"></pagination-controls>`)
         .createAsync(TestCmp)
         .then((fixture: ComponentFixture<TestCmp>) => {
             fixture.detectChanges();
             expect(fixture.componentInstance.directionLinks).toBe(false);
         });
 }));
开发者ID:Muthukumaruma,项目名称:ng2-pagination,代码行数:12,代码来源:pagination-controls-cmp.spec.ts

示例3: it

 it('should define default values for value and bufferValue attributes', (done: () => void) => {
   builder
     .overrideTemplate(TestApp, '<md-progress-bar></md-progress-bar>')
     .createAsync(TestApp)
     .then((fixture) => {
       fixture.detectChanges();
       let progressElement = fixture.debugElement.query(By.css('md-progress-bar'));
       expect(progressElement.componentInstance.value).toBe(0);
       expect(progressElement.componentInstance.bufferValue).toBe(0);
       done();
     });
 });
开发者ID:CodeStrider35,项目名称:material2,代码行数:12,代码来源:progress-bar.spec.ts

示例4: it

		it('should detect and apply changes to model', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
			var template = '<div><ig-grid [(widgetId)]="gridID" [(options)]="opts"></ig-grid></div>';
			return tcb.overrideTemplate(TestComponent, template)
				.createAsync(TestComponent)
				.then((fixture) => {
					fixture.detectChanges();
					$(fixture.debugElement.nativeElement).find("#grid1 tr[data-id='2'] td[aria-describedby='grid1_Name']").click();
					$(fixture.debugElement.nativeElement).find("#grid1").igGridUpdating("setCellValue", 2, "Name", "Mary Jackson");
					$(fixture.debugElement.nativeElement).find("#grid1_container #grid1_updating_done").click();
					expect(fixture.debugElement.componentInstance.data[1].Name)
					.toBe("Mary Jackson");
				});
		}));
开发者ID:wsw2008new,项目名称:igniteui-angular2,代码行数:13,代码来源:grid.spec.ts

示例5: Promise

 return new Promise((resolve, reject) => {
     tcb.overrideTemplate(TestComponent, template)
         .createAsync(TestComponent)
         .then((fixture) => {
             fixture.detectChanges();
             fixture.componentInstance.data = "<span>Test Update</span>";
             setTimeout(function () {
                 fixture.detectChanges();
                 expect($("#htmlEditor").igHtmlEditor("getContent", "html")).toBe("<span>Test Update</span>");
                 resolve();
             }, 10);
         });
 });
开发者ID:wsw2008new,项目名称:igniteui-angular2,代码行数:13,代码来源:htmleditor.spec.ts

示例6: it

  it('should set the correct list height in fixed mode', async(() => {
    var template = `
      <md-grid-list cols="1" rowHeight="100px">
        <md-grid-tile></md-grid-tile>
        <md-grid-tile></md-grid-tile>
      </md-grid-list>`;

    builder.overrideTemplate(TestGridList, template).createAsync(TestGridList).then(fixture => {
      fixture.detectChanges();
      let list = fixture.debugElement.query(By.directive(MdGridList));
      expect(getProp(list, 'height')).toBe('201px');
    });
  }));
开发者ID:2947721120,项目名称:material2,代码行数:13,代码来源:grid-list.spec.ts

示例7: it

 it('should throw error if tile colspan is wider than total cols', () => {
   var template = `
     <md-grid-list cols="4">
       <md-grid-tile colspan="5"></md-grid-tile>
     </md-grid-list>
   `;
   return builder.overrideTemplate(TestGridList, template)
       .createAsync(TestGridList).then((fixture: ComponentFixture<TestGridList>) => {
         expect(() => {
           fixture.detectChanges();
         }).toThrowError(/tile with colspan 5 is wider than grid/);
       });
 });
开发者ID:C2Cmall,项目名称:material2,代码行数:13,代码来源:grid-list.spec.ts

示例8: async

   async(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
      var template = '<ig-tab-bar></ig-tab-bar>';
        return tcb.overrideTemplate(TestComponentDI, template)
        .createAsync(TestComponentDI)
        .then((fixture) => {                  
            expect(fixture.componentInstance.viewChild).toBeDefined();
            expect(fixture.componentInstance.viewChild).toBeAnInstanceOf(Infragistics.TabBar);
            //expect(fixture.componentInstance.viewChild.state).toBeAnInstanceOf(Infragistics.NavigationService);
        }).catch (reason => {
            console.log(reason);
            return Promise.reject(reason);
        });
 })));
开发者ID:QuinntyneBrown,项目名称:zero-blocks,代码行数:13,代码来源:tab.spec.ts

示例9: Promise

 return new Promise((resolve, reject) => {
     tcb.overrideTemplate(TestComponent, template)
         .createAsync(TestComponent)
         .then((fixture) => {
             fixture.detectChanges();
             fixture.componentInstance.data[0].Name = "Test";
             setTimeout(() => {
                 fixture.detectChanges();
                 expect($($("#tree1").igTree("nodeByIndex", 0)).children("a").text())
                     .toBe("Test");
                     resolve();
             }, 10);
         });
 });
开发者ID:wsw2008new,项目名称:igniteui-angular2,代码行数:14,代码来源:igtree.spec.ts


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