本文整理汇总了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();
}));
示例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();
}));
示例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();
}));
示例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();
}));
示例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();
}));
示例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();
}));
示例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();
}));
示例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();
}));
示例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();
}));
示例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();
}));