本文整理匯總了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();
}));