Skip to content
Prev Previous commit
Next Next commit
fix: TTL-919 debug timeRangeHeaderComponent test
  • Loading branch information
mmaquina committed Jul 12, 2023
commit 51c0dea4717b892688bc8984a2bc732b980a18d4
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import { ComponentFixture, TestBed, tick, fakeAsync } from '@angular/core/testing';
import { MatNativeDateModule } from '@angular/material/core';
import { DateAdapter, MatNativeDateModule } from '@angular/material/core';
import { MatCalendar, MatDateRangePicker } from '@angular/material/datepicker';
import { By } from '@angular/platform-browser';
import { of } from 'rxjs';
import { MatIconModule } from '@angular/material/icon';

import { TimeRangeHeaderComponent } from './time-range-header.component';
import { TimeRangeOptionsComponent } from '../time-range-options/time-range-options.component';
import { IndividualConfig, ToastrService } from 'ngx-toastr';
import { MatListModule } from '@angular/material/list';


describe('TimeRangeHeaderComponent', () => {
Expand All @@ -18,11 +23,19 @@ describe('TimeRangeHeaderComponent', () => {
activeDate: new Date()
};

const toastrServiceStub = {
error: (message?: string, title?: string, override?: Partial<IndividualConfig>) => { }
};

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [MatNativeDateModule],
declarations: [ TimeRangeHeaderComponent ],
providers: [{ provide: MatCalendar, useValue: value }, { provide: MatDateRangePicker, useValue: {} }] ,
imports: [MatNativeDateModule, MatIconModule, MatListModule],
declarations: [ TimeRangeHeaderComponent, TimeRangeOptionsComponent ],
providers: [
{ provide: MatCalendar, useValue: value },
{ provide: MatDateRangePicker, useValue: {} },
{ provide: ToastrService, useValue: toastrServiceStub },
],
})
.compileComponents();
});
Expand Down