mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2025-02-23 06:35:19 +01:00
ng tests fix for github actions
ng tests fix for github actions
This commit is contained in:
parent
da96875acb
commit
ce3abf2fa7
2 changed files with 5 additions and 5 deletions
|
@ -12,6 +12,7 @@ import { ExperimentalSettingsComponent } from './experimental-settings.component
|
|||
import { mockDataService, mockLoggerService } from '../../../test-helpers/mock-services';
|
||||
import { LoggerService } from '../../../services/logger.service';
|
||||
import { DataService } from '../../../services/data.service';
|
||||
import { CommonService } from '../../../services/common.service';
|
||||
|
||||
describe('ExperimentalSettingsComponent', () => {
|
||||
let component: ExperimentalSettingsComponent;
|
||||
|
@ -27,6 +28,7 @@ describe('ExperimentalSettingsComponent', () => {
|
|||
StoreModule.forRoot({ root: RootReducer, lnd: LNDReducer, cln: CLNReducer, ecl: ECLReducer })
|
||||
],
|
||||
providers: [
|
||||
CommonService,
|
||||
{ provide: LoggerService, useClass: mockLoggerService },
|
||||
{ provide: DataService, useClass: mockDataService }
|
||||
]
|
||||
|
|
|
@ -97,17 +97,15 @@ describe('RTL Root Effects', () => {
|
|||
done();
|
||||
setTimeout(() => sub.unsubscribe());
|
||||
});
|
||||
|
||||
const req = httpTestingController.expectOne(environment.CONF_API + '/updateSelNode');
|
||||
const req = httpTestingController.expectOne(environment.CONF_API + '/updateSelNode/1/-1');
|
||||
const expectedResponse = mockResponseData.setSelectedNodeSuccess;
|
||||
req.flush(expectedResponse);
|
||||
expect(req.request.method).toEqual('POST');
|
||||
expect(req.request.body).toEqual({ prevNodeIndex: -1, currNodeIndex: setSelectedNodeAction.payload.currentLnNode.index });
|
||||
expect(req.request.method).toEqual('GET');
|
||||
});
|
||||
|
||||
it('should throw error on dispatch set selected node', (done) => {
|
||||
const storeDispatchSpy = spyOn(mockStore, 'dispatch').and.callThrough();
|
||||
const httpClientSpy = spyOn(httpClient, 'post').and.returnValue(throwError(() => mockResponseData.error));
|
||||
const httpClientSpy = spyOn(httpClient, 'get').and.returnValue(throwError(() => mockResponseData.error));
|
||||
actions = new ReplaySubject(1);
|
||||
const setSelectedNodeAction = {
|
||||
type: RTLActions.SET_SELECTED_NODE,
|
||||
|
|
Loading…
Add table
Reference in a new issue