當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ng2-mock-component.MockComponent函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。