From 2f5dbd9ae23fc9120c9fa4dd32beb11c1fd9d48a Mon Sep 17 00:00:00 2001 From: saubyk <39208279+saubyk@users.noreply.github.com> Date: Tue, 21 Jul 2020 21:33:29 -0400 Subject: [PATCH] fixing tests --- .../node-info/node-info.component.spec.ts | 9 ++++++++- .../currency-unit-converter.component.spec.ts | 20 ++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/app/clightning/home/node-info/node-info.component.spec.ts b/src/app/clightning/home/node-info/node-info.component.spec.ts index d11a6fc9..ae883ca5 100644 --- a/src/app/clightning/home/node-info/node-info.component.spec.ts +++ b/src/app/clightning/home/node-info/node-info.component.spec.ts @@ -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; + 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(); })); diff --git a/src/app/shared/components/currency-unit-converter/currency-unit-converter.component.spec.ts b/src/app/shared/components/currency-unit-converter/currency-unit-converter.component.spec.ts index 1ab6a088..8593b2a5 100644 --- a/src/app/shared/components/currency-unit-converter/currency-unit-converter.component.spec.ts +++ b/src/app/shared/components/currency-unit-converter/currency-unit-converter.component.spec.ts @@ -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; + 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(); }));