From 89d8a4416486b6eb4cc8e83ce53bfeda3b2d1cb2 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Tue, 3 Oct 2023 18:16:33 -0700 Subject: [PATCH] Jasmin test fix --- src/app/shared/test-helpers/mock-services.ts | 3 ++- src/app/store/rtl.effects.spec.ts | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app/shared/test-helpers/mock-services.ts b/src/app/shared/test-helpers/mock-services.ts index 8b73f56f..db4c5089 100644 --- a/src/app/shared/test-helpers/mock-services.ts +++ b/src/app/shared/test-helpers/mock-services.ts @@ -1,5 +1,5 @@ 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 { mockResponseData } from './test-data'; @@ -154,6 +154,7 @@ export class mockSessionService { export class mockLoopService { public swapsChanged = new BehaviorSubject([]); + getLoopInfo() { return new Observable(null); }; getSwapsList() { }; listSwaps() { }; loopOut(amount: number, chanId: string, targetConf: number, swapRoutingFee: number, minerFee: number, prepayRoutingFee: number, prepayAmt: number, swapFee: number, swapPublicationDeadline: number, destAddress: string) { }; diff --git a/src/app/store/rtl.effects.spec.ts b/src/app/store/rtl.effects.spec.ts index ad8b55ae..eb406c21 100644 --- a/src/app/store/rtl.effects.spec.ts +++ b/src/app/store/rtl.effects.spec.ts @@ -26,7 +26,7 @@ import { API_END_POINTS, APICallStatusEnum, RTLActions, UI_MESSAGES } from '../s import { RTLEffects } from './rtl.effects'; import { RTLState } from './rtl.state'; 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 { 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()[6].args[0]).toEqual(resetCLNStore({ 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).toHaveBeenCalledTimes(9); + expect(storeDispatchSpy.calls.all()[8].args[0]).toEqual(fetchPageSettingsLND()); + expect(storeDispatchSpy.calls.all()[9].args[0]).toEqual(fetchInfoLND({ payload: { loadPage: 'HOME' } })); + expect(storeDispatchSpy).toHaveBeenCalledTimes(10); done(); setTimeout(() => sub.unsubscribe()); });