Jasmin test fix

This commit is contained in:
ShahanaFarooqui 2023-10-03 18:16:33 -07:00
parent 3b2f17873a
commit 89d8a44164
2 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,5 @@
import { HttpResponse } from '@angular/common/http'; import { HttpResponse } from '@angular/common/http';
import { BehaviorSubject, of, throwError } from 'rxjs'; import { BehaviorSubject, Observable, of, throwError } from 'rxjs';
import { API_URL, CLNActions } from '../services/consts-enums-functions'; import { API_URL, CLNActions } from '../services/consts-enums-functions';
import { mockResponseData } from './test-data'; import { mockResponseData } from './test-data';
@ -154,6 +154,7 @@ export class mockSessionService {
export class mockLoopService { export class mockLoopService {
public swapsChanged = new BehaviorSubject<any[]>([]); public swapsChanged = new BehaviorSubject<any[]>([]);
getLoopInfo() { return new Observable<any>(null); };
getSwapsList() { }; getSwapsList() { };
listSwaps() { }; listSwaps() { };
loopOut(amount: number, chanId: string, targetConf: number, swapRoutingFee: number, minerFee: number, prepayRoutingFee: number, prepayAmt: number, swapFee: number, swapPublicationDeadline: number, destAddress: string) { }; loopOut(amount: number, chanId: string, targetConf: number, swapRoutingFee: number, minerFee: number, prepayRoutingFee: number, prepayAmt: number, swapFee: number, swapPublicationDeadline: number, destAddress: string) { };

View File

@ -26,7 +26,7 @@ import { API_END_POINTS, APICallStatusEnum, RTLActions, UI_MESSAGES } from '../s
import { RTLEffects } from './rtl.effects'; import { RTLEffects } from './rtl.effects';
import { RTLState } from './rtl.state'; import { RTLState } from './rtl.state';
import { updateRootAPICallStatus, openSpinner, closeSpinner, openAlert, resetRootStore } from './rtl.actions'; import { updateRootAPICallStatus, openSpinner, closeSpinner, openAlert, resetRootStore } from './rtl.actions';
import { resetLNDStore, fetchInfoLND } from '../lnd/store/lnd.actions'; import { resetLNDStore, fetchInfoLND, fetchPageSettings as fetchPageSettingsLND } from '../lnd/store/lnd.actions';
import { resetCLNStore } from '../cln/store/cln.actions'; import { resetCLNStore } from '../cln/store/cln.actions';
import { resetECLStore } from '../eclair/store/ecl.actions'; import { resetECLStore } from '../eclair/store/ecl.actions';
@ -91,8 +91,9 @@ describe('RTL Root Effects', () => {
expect(storeDispatchSpy.calls.all()[5].args[0]).toEqual(resetLNDStore({ payload: mockActionsData.resetChildrenStores })); expect(storeDispatchSpy.calls.all()[5].args[0]).toEqual(resetLNDStore({ payload: mockActionsData.resetChildrenStores }));
expect(storeDispatchSpy.calls.all()[6].args[0]).toEqual(resetCLNStore({ payload: mockActionsData.resetChildrenStores })); expect(storeDispatchSpy.calls.all()[6].args[0]).toEqual(resetCLNStore({ payload: mockActionsData.resetChildrenStores }));
expect(storeDispatchSpy.calls.all()[7].args[0]).toEqual(resetECLStore({ payload: mockActionsData.resetChildrenStores })); expect(storeDispatchSpy.calls.all()[7].args[0]).toEqual(resetECLStore({ payload: mockActionsData.resetChildrenStores }));
expect(storeDispatchSpy.calls.all()[8].args[0]).toEqual(fetchInfoLND({ payload: { loadPage: 'HOME' } })); expect(storeDispatchSpy.calls.all()[8].args[0]).toEqual(fetchPageSettingsLND());
expect(storeDispatchSpy).toHaveBeenCalledTimes(9); expect(storeDispatchSpy.calls.all()[9].args[0]).toEqual(fetchInfoLND({ payload: { loadPage: 'HOME' } }));
expect(storeDispatchSpy).toHaveBeenCalledTimes(10);
done(); done();
setTimeout(() => sub.unsubscribe()); setTimeout(() => sub.unsubscribe());
}); });