UNPKG

ng-mat-daterange-picker

Version:

[![CircleCI](https://circleci.com/gh/ashishgkwd/ngx-mat-daterange-picker.svg?style=shield)](https://circleci.com/gh/ashishgkwd/ngx-mat-daterange-picker) [![Maintainability](https://api.codeclimate.com/v1/badges/2b0d09a866f6d2ed139c/maintainability)](https

53 lines (45 loc) 1.64 kB
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RangeStoreService, DATE } from '../services/range-store.service'; import { ConfigStoreService } from '../services/config-store.service'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { OverlayRef } from '@angular/cdk/overlay'; import { PickerOverlayComponent } from './picker-overlay.component'; class MockOverlayRef { dispose() {} } describe('RangeComponent', () => { let component: PickerOverlayComponent; let fixture: ComponentFixture<PickerOverlayComponent>; let configStoreService:ConfigStoreService; beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ PickerOverlayComponent ], imports:[ BrowserAnimationsModule ], providers: [ {provide: DATE, useValue: new Date}, {provide: OverlayRef, useClass: MockOverlayRef}, RangeStoreService, ConfigStoreService], schemas: [NO_ERRORS_SCHEMA] }) .compileComponents(); })); beforeEach(() => { configStoreService = TestBed.get(ConfigStoreService); configStoreService.ngxDrpOptions = { presets:[], format: 'mediumDate', range: {fromDate:new Date(), toDate: new Date()}, applyLabel: "Submit" }; fixture = TestBed.createComponent(PickerOverlayComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it('should create', () => { expect(component).toBeTruthy(); }); });