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


TypeScript TestComponentBuilder.overrideTemplate方法代码示例

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


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

示例1: it

 it('should initialize correctly', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
     var template = '<div><ig-upload widgetId="upload"></ig-upload></div>';
     return tcb.overrideTemplate(TestComponent, template)
         .createAsync(TestComponent)
         .then((fixture) => {
             fixture.detectChanges();
             expect(fixture.debugElement.componentInstance.viewChild instanceof Infragistics.IgUploadComponent)
                 .toBe(true);
         });
 }));
开发者ID:damyanpetev,项目名称:igniteui-angular2,代码行数:10,代码来源:upload.spec.ts

示例2: it

 it('should initialize correctly', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
     var template = '<div><ig-popover [widgetId]="\'popover\'" [(options)]="opts"></ig-popover></div>';
     return tcb.overrideTemplate(TestComponent, template)
         .createAsync(TestComponent)
         .then((fixture) => {
             fixture.detectChanges();
             expect(fixture.debugElement.componentInstance.viewChild instanceof Infragistics.IgPopoverComponent)
                 .toBe(true);
         });
 }));
开发者ID:damyanpetev,项目名称:igniteui-angular2,代码行数:10,代码来源:popover.spec.ts

示例3: expect

 (tcb: TestComponentBuilder, async: AsyncTestCompleter) => {
   tcb.overrideTemplate(
          MyComp1, `<div [class.a]="true" #el>Class: {{el.className}}</div>`)
       .createAsync(MyComp1)
       .then((fixture) => {
         fixture.detectChanges();
         expect(fixture.nativeElement).toHaveText('Class: a');
         async.done();
       });
 }));
开发者ID:AngularLovers,项目名称:angular,代码行数:10,代码来源:regression_integration_spec.ts

示例4: fakeAsync

 fakeAsync(inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
   // {{x.valid}} used to crash because valid() tried to read a property
   // from form.control before it was set. This test verifies this bug is
   // fixed.
   const t = `<form><div ngModelGroup="x" #x="ngModelGroup">
            <input type="text" name="test" ngModel></div>{{x.valid}}</form>`;
   let fixture = tcb.overrideTemplate(MyComp8, t).createFakeAsync(MyComp8);
   tick();
   fixture.detectChanges();
 })));
开发者ID:AngularLovers,项目名称:angular,代码行数:10,代码来源:template_integration_spec.ts

示例5: expect

           (tcb: TestComponentBuilder, async: AsyncTestCompleter) => {
             const t = `<form>
                      <input [(ngModel)]="name" [ngModelOptions]="{standalone: true}">
                    </form>`;

             tcb.overrideTemplate(MyComp8, t).createAsync(MyComp8).then((fixture) => {
               expect(() => fixture.detectChanges()).not.toThrow();
               async.done();
             });
           }));
开发者ID:AngularLovers,项目名称:angular,代码行数:10,代码来源:template_integration_spec.ts

示例6: it

 it('should initialize correctly', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
     var template = '<div><ig-html-editor widgetId="htmlEditor" [(options)]="opts" [changeDetectionInterval]="cdi" [(ngModel)]="data"></ig-html-editor></div>';
     return tcb.overrideTemplate(TestComponent, template)
         .createAsync(TestComponent)
         .then((fixture) => {
             fixture.detectChanges();
             expect(fixture.debugElement.componentInstance.viewChild instanceof Infragistics.IgHtmlEditorComponent)
                 .toBe(true);
         });
 }));
开发者ID:damyanpetev,项目名称:igniteui-angular2,代码行数:10,代码来源:htmleditor.spec.ts

示例7: expect

 (tcb: TestComponentBuilder, async: AsyncTestCompleter) => {
   var template = '<div>{{text}}<span ngNonBindable>{{text}}</span></div>';
   tcb.overrideTemplate(TestComponent, template)
       .createAsync(TestComponent)
       .then((fixture) => {
         fixture.detectChanges();
         expect(fixture.debugElement.nativeElement).toHaveText('foo{{text}}');
         async.done();
       });
 }));
开发者ID:AngularLovers,项目名称:angular,代码行数:10,代码来源:non_bindable_spec.ts

示例8: it

 it('should apply a mode of "determinate" if no mode is provided.', (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.mode).toBe('determinate');
       done();
     });
 });
开发者ID:billkim84,项目名称:material2,代码行数:11,代码来源:progress-bar.spec.ts

示例9: it

 it('should not modify the mode if a valid mode is provided.', (done: () => void) => {
   builder
     .overrideTemplate(TestApp, '<md-progress-circle mode="indeterminate"></md-progress-circle>')
     .createAsync(TestApp)
     .then((fixture) => {
       fixture.detectChanges();
       let progressElement = getChildDebugElement(fixture.debugElement, 'md-progress-circle');
       expect(progressElement.componentInstance.mode).toBe('indeterminate');
       done();
     });
 });
开发者ID:billkim84,项目名称:material2,代码行数:11,代码来源:progress-circle.spec.ts


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