2
0
mirror of https://github.com/Ride-The-Lightning/RTL synced 2024-10-31 09:20:27 +00:00
RTL/src/app/shared/components/services/loop/loop-modal/loop-modal.component.spec.ts

61 lines
2.2 KiB
TypeScript
Raw Normal View History

2021-08-28 21:03:18 +00:00
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { StoreModule } from '@ngrx/store';
import { RTLReducer } from '../../../../../store/rtl.reducers';
import { CommonService } from '../../../../../shared/services/common.service';
import { LoggerService } from '../../../../../shared/services/logger.service';
import { LoopService } from '../../../../../shared/services/loop.service';
import { LoopModalComponent } from './loop-modal.component';
2021-08-28 21:03:18 +00:00
import { SharedModule } from '../../../../shared.module';
import { mockDataService, mockLoggerService, mockLoopService, mockMatDialogRef } from '../../../../test-helpers/mock-services';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { DataService } from '../../../../services/data.service';
describe('LoopModalComponent', () => {
let component: LoopModalComponent;
let fixture: ComponentFixture<LoopModalComponent>;
2021-08-28 21:03:18 +00:00
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
2021-08-28 21:03:18 +00:00
declarations: [LoopModalComponent],
imports: [
BrowserAnimationsModule,
SharedModule,
RouterTestingModule,
StoreModule.forRoot(RTLReducer, {
runtimeChecks: {
strictStateImmutability: false,
strictActionImmutability: false
}
})
],
providers: [
CommonService,
{ provide: LoggerService, useClass: mockLoggerService },
{ provide: DataService, useClass: mockDataService },
{ provide: LoopService, useClass: mockLoopService },
{ provide: MatDialogRef, useClass: mockMatDialogRef },
{ provide: MAT_DIALOG_DATA, useValue: { channel: {}, minQuote: {}, maxQuote: {}, direction: '' } }
]
}).
compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(LoopModalComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
2021-08-28 21:03:18 +00:00
afterEach(() => {
TestBed.resetTestingModule();
});
});