本文整理汇总了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;未经允许,请勿转载。 |
请发表评论