fixing tests

This commit is contained in:
saubyk 2020-07-21 21:33:29 -04:00
parent 1cd61c0e22
commit 2f5dbd9ae2
No known key found for this signature in database
GPG Key ID: 00C9E2BC2E45666F
2 changed files with 27 additions and 2 deletions

View File

@ -1,14 +1,21 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CLNodeInfoComponent } from './node-info.component';
import { CommonService } from '../../../shared/services/common.service';
describe('CLNodeInfoComponent', () => {
let component: CLNodeInfoComponent;
let fixture: ComponentFixture<CLNodeInfoComponent>;
const mockCommonService = jasmine.createSpyObj("CommonService",["getScreenSize","setScreenSize",
"sortDescByKey","camelCase","titleCase","convertCurrency","convertWithoutFiat","convertWithFiat",
"convertTime","convertTimestampToDate","downloadFile","convertToCSV"]);
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CLNodeInfoComponent ]
declarations: [ CLNodeInfoComponent ],
providers: [
{ provide: CommonService, useValue: mockCommonService }
]
})
.compileComponents();
}));

View File

@ -1,14 +1,32 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CurrencyUnitConverterComponent } from './currency-unit-converter.component';
import { CommonService } from '../../services/common.service';
import { Store, StoreModule } from '@ngrx/store';
import * as fromRTLReducer from '../../../store/rtl.reducers';
import { RTLReducer } from '../../../store/rtl.reducers';
describe('CurrencyUnitConverterComponent', () => {
let component: CurrencyUnitConverterComponent;
let fixture: ComponentFixture<CurrencyUnitConverterComponent>;
const mockCommonService = jasmine.createSpyObj("CommonService",["getScreenSize","setScreenSize",
"sortDescByKey","camelCase","titleCase","convertCurrency","convertWithoutFiat","convertWithFiat",
"convertTime","convertTimestampToDate","downloadFile","convertToCSV"]);
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CurrencyUnitConverterComponent ]
declarations: [ CurrencyUnitConverterComponent ],
providers: [
{ provide: CommonService, useValue: mockCommonService }
],
imports:[
StoreModule.forRoot(RTLReducer, {
runtimeChecks: {
strictStateImmutability: false,
strictActionImmutability: false
}
})
]
})
.compileComponents();
}));