當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。