• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript ng2-mock-component.MockComponent函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中ng2-mock-component.MockComponent函数的典型用法代码示例。如果您正苦于以下问题:TypeScript MockComponent函数的具体用法?TypeScript MockComponent怎么用?TypeScript MockComponent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: beforeEach

  beforeEach(async(() => {
    const eventServiceStub = {
      event$: of(new Event({})),
      product$: null
    };

    TestBed.configureTestingModule({
      declarations: [
        ShakemapComponent,

        MockComponent({
          inputs: ['productType', 'showVersion'],
          selector: 'product-page'
        }),
        MockComponent({
          inputs: ['event'],
          selector: 'technical-origin-summary'
        }),
        MockComponent({
          inputs: ['event', 'products'],
          selector: 'impact-shakemap-summary'
        }),

        MockPipe('sharedGetProducts'),
        MockPipe('sharedProductContent')
      ],
      imports: [MatTabsModule, RouterTestingModule],
      providers: [{ provide: EventService, useValue: eventServiceStub }]
    }).compileComponents();
  }));
开发者ID:ehunter-usgs,项目名称:earthquake-eventpages,代码行数:30,代码来源:shakemap.component.spec.ts


示例2: beforeEach

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [
        StationComponent,

        MockComponent({
          inputs: ['bubble', 'intensity'],
          selector: 'shared-mmi'
        }),
        MockComponent({
          inputs: ['name', 'title'],
          selector: 'shared-bubble'
        }),
        MockComponent({
          inputs: ['flag'],
          selector: 'shared-station-flag'
        }),

        MockPipe('sharedDegrees'),
        MockPipe('sharedNumber'),
        MockPipe('sharedLocation')
      ],
      imports: [MatCardModule, MatExpansionModule, MatTableModule]
    }).compileComponents();
  }));
开发者ID:ehunter-usgs,项目名称:earthquake-eventpages,代码行数:25,代码来源:station.component.spec.ts


示例3: beforeEach

  beforeEach(async(() => {
    const eventServiceStub = {
      event$: of(new Event({})),
      product$: of(null)
    };

    const shakeAlertServiceStub = {
      getSummary: () => null,
      summary$: of(null)
    };

    TestBed.configureTestingModule({
      declarations: [
        ShakeAlertComponent,
        ShakeAlertDeletedComponent,
        ShakeAlertMissedComponent,
        ShakeAlertPendingComponent,

        MockComponent({ inputs: ['productType'], selector: 'product-page' }),
        MockComponent({
          inputs: ['summary', 'cities', 'properties'],
          selector: 'shake-alert-confirmed'
        })
      ],
      providers: [
        { provide: EventService, useValue: eventServiceStub },
        { provide: ShakeAlertService, useValue: shakeAlertServiceStub }
      ]
    }).compileComponents();
  }));
开发者ID:emartinez-usgs,项目名称:earthquake-eventpages,代码行数:30,代码来源:shake-alert.component.spec.ts


示例4: beforeEach

  beforeEach(async(() => {
    const eventServiceStub = {
      getEvent: jasmine.createSpy('eventService::getEvent'),
      getProduct: jasmine.createSpy('eventService::getProduct')
    };

    TestBed.configureTestingModule({
      declarations: [
        RegionInfoPinComponent,

        MockComponent({
          inputs: ['link', 'product', 'title'],
          selector: 'basic-pin'
        }),
        MockComponent({
          inputs: ['overlays', 'showAttributionControl'],
          selector: 'shared-map'
        }),

        MockPipe('getProduct'),
        MockPipe('regionInfoOverlays')
      ],
      imports: [RouterTestingModule],
      providers: [{ provide: EventService, useValue: eventServiceStub }]
    }).compileComponents();
  }));
开发者ID:ehunter-usgs,项目名称:earthquake-eventpages,代码行数:26,代码来源:region-info-pin.component.spec.ts


示例5: beforeEach

  beforeEach(async(() => {
    const eventServiceStub = {
      event$: of(new Event({})),
      product$: null
    };

    TestBed.configureTestingModule({
      declarations: [
        IntensityComponent,

        MockComponent({
          inputs: [
            'overlays',
            'showScaleControl',
            'showAttributionControl',
            'bounds'
          ],
          selector: 'shared-map'
        }),
        MockComponent({
          inputs: [
            'product',
            'legendType'
          ],
          selector: 'shakemap-legend'
        }),

        MockPipe('shakemapOverlays'),
        MockPipe('sharedGetMapBounds'),
        MockPipe('sharedProductContent')
      ],
      imports: [RouterTestingModule],
      providers: [{ provide: EventService, useValue: eventServiceStub }]
    }).compileComponents();
  }));
开发者ID:ehunter-usgs,项目名称:earthquake-eventpages,代码行数:35,代码来源:intensity.component.spec.ts


示例6: beforeEach

  beforeEach(async(() => {
    const contentsXmlServiceStub = {
      get: jasmine.createSpy('contentsXmlServiceStub::get')
    };
    const eventServiceStub = {
      product$: of(null)
    };

    TestBed.configureTestingModule({
      declarations: [
        DownloadComponent,

        MockComponent({
          inputs: ['expanded'],
          selector: 'mat-expansion-panel'
        }),
        MockComponent({ selector: 'mat-expansion-panel-header' }),
        MockComponent({
          inputs: ['item'],
          selector: 'product-page-download-item'
        })
      ],
      providers: [
        { provide: ContentsXmlService, useValue: contentsXmlServiceStub },
        { provide: EventService, useValue: eventServiceStub }
      ]
    }).compileComponents();
  }));
开发者ID:ehunter-usgs,项目名称:earthquake-eventpages,代码行数:28,代码来源:download.component.spec.ts


示例7: beforeEach

  beforeEach(async(() => {
    const eventServiceStub = {
      event$: of({}),
      product$: of({})
    };

    const metadataServiceStub = {
      getMetadata: jasmine.createSpy('metadataService::get'),
      metadata$: of({})
    };

    TestBed.configureTestingModule({
      declarations: [
        MetadataComponent,
        MockComponent({ selector: 'shakemap-input', inputs: ['smInput'] }),
        MockComponent({
          inputs: ['smMultiGmpe'],
          selector: 'shakemap-multigmpe'
        }),
        MockComponent({ selector: 'shakemap-output', inputs: ['smOutput'] }),
        MockComponent({
          inputs: ['smProcessing'],
          selector: 'shakemap-processing'
        })
      ],
      providers: [
        { provide: EventService, useValue: eventServiceStub },
        { provide: MetadataService, useValue: metadataServiceStub }
      ]
    }).compileComponents();
  }));
开发者ID:ehunter-usgs,项目名称:earthquake-eventpages,代码行数:31,代码来源:metadata.component.spec.ts


示例8: beforeEach

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [
        HeaderComponent,

        MockComponent({
          inputs: ['product', 'event'],
          selector: 'product-page-summary-link'
        }),
        MockComponent({
          inputs: ['product'],
          selector: 'shared-product-attribution'
        }),
        MockComponent({
          inputs: ['productType', 'event'],
          selector: 'shared-summary-link'
        }),

        MockPipe('dateTime'),
        MockPipe('isScenarioEvent'),
        MockPipe('sharedGetProducts'),
        MockPipe('sharedProductProperty'),
        MockPipe('sharedProductReviewed')
      ],
      imports: [MatExpansionModule]
    }).compileComponents();
  }));
开发者ID:ehunter-usgs,项目名称:earthquake-eventpages,代码行数:27,代码来源:header.component.spec.ts


示例9: beforeEach

  beforeEach(async(() => {
    const eventServiceStub = {
      event$: of(new Event({}))
    };
    TestBed.configureTestingModule({
      declarations: [
        MapComponent,

        MockComponent({
          inputs: [
            'bounds',
            'overlays',
            'scrollWheelZoom',
            'showLayersControl',
            'showLegendControl',
            'showScaleControl',
            'interactive'
          ],
          selector: 'shared-map'
        }),
        MockComponent({
          inputs: ['productType', 'event'],
          selector: 'shared-summary-link'
        }),
        MockPipe('interactiveMapBounds'),
        MockPipe('interactiveMapOverlays'),
        MockPipe('isScenarioEvent')
      ],
      imports: [RouterTestingModule],
      providers: [{ provide: EventService, useValue: eventServiceStub }]
    }).compileComponents();
  }));
开发者ID:ehunter-usgs,项目名称:earthquake-eventpages,代码行数:32,代码来源:map.component.spec.ts


示例10: beforeEach

  beforeEach(async(() => {
    const dialogStub = {
      close: () => {
        console.log('stubbified!');
      }
    };

    TestBed.configureTestingModule({
      declarations: [
        LocationDialogComponent,
        MockComponent({selector: 'location-input-coordinate'}),
        MockComponent({selector: 'location-input-geocode'}),
        MockComponent({selector: 'location-input-geolocate'})
      ],
      imports: [
        BrowserAnimationsModule,
        MatDialogModule,
        MatExpansionModule,
        MatFormFieldModule,
        MatIconModule,
        MatProgressBarModule
      ],
      providers: [
        {provide: MatDialogRef, useValue: dialogStub}
      ]
    })
    .compileComponents();
  }));
开发者ID:ehunter-usgs,项目名称:hazdev-location-view,代码行数:28,代码来源:location-dialog.component.spec.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript ng2-opd-popup.Popup类代码示例发布时间:2022-05-25
下一篇:
TypeScript ng2-materialize.MzModalService类代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap