mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2025-03-13 03:12:49 +01:00
ng test fix
ng test fix
This commit is contained in:
parent
ce3abf2fa7
commit
da405a866b
3 changed files with 876 additions and 534 deletions
1390
package-lock.json
generated
1390
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -73,11 +73,11 @@
|
|||
"@ngrx/store-devtools": "^13.0.2",
|
||||
"@types/jasmine": "~3.10.0",
|
||||
"@types/node": "^12.11.1",
|
||||
"@typescript-eslint/eslint-plugin": "~4.23.0",
|
||||
"@typescript-eslint/parser": "~4.23.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.33.0",
|
||||
"@typescript-eslint/parser": "^5.33.0",
|
||||
"crypto-browserify": "^3.12.0",
|
||||
"dotenv": "^8.2.0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint": "^8.21.0",
|
||||
"eslint-plugin-deprecation": "^1.2.1",
|
||||
"jasmine-core": "~4.0.0",
|
||||
"jasmine-spec-reporter": "~5.0.0",
|
||||
|
|
|
@ -21,12 +21,14 @@ import { mockRTLStoreState } from '../../../shared/test-helpers/test-data';
|
|||
import { RTLState } from '../../../store/rtl.state';
|
||||
import { sendPayment } from '../../store/lnd.actions';
|
||||
import { SelNodeChild } from '../../../shared/models/RTLconfig';
|
||||
import { Channel, SendPayment } from '../../../shared/models/lndModels';
|
||||
|
||||
describe('LightningSendPaymentsComponent', () => {
|
||||
let component: LightningSendPaymentsComponent;
|
||||
let fixture: ComponentFixture<LightningSendPaymentsComponent>;
|
||||
let commonService: CommonService;
|
||||
let store: Store<RTLState>;
|
||||
let storeSpyChannels;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
|
@ -57,9 +59,11 @@ describe('LightningSendPaymentsComponent', () => {
|
|||
});
|
||||
|
||||
it('should create', () => {
|
||||
const storeSpyChannels = spyOn(store, 'select').and.returnValue(of(mockRTLStoreState.lnd.channels));
|
||||
component.activeChannels = [];
|
||||
expect(component).toBeTruthy();
|
||||
storeSpyChannels = spyOn(store, 'select').and.returnValue(of(mockRTLStoreState.lnd.channels));
|
||||
component.activeChannels = storeSpyChannels;
|
||||
setTimeout(() => {
|
||||
expect(component).toBeTruthy();
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
it('should get lnd store value on ngOnInit', () => {
|
||||
|
@ -81,7 +85,7 @@ describe('LightningSendPaymentsComponent', () => {
|
|||
};
|
||||
const sendButton = fixture.debugElement.nativeElement.querySelector('#sendBtn');
|
||||
sendButton.click();
|
||||
const expectedSendPaymentPayload = {
|
||||
const expectedSendPaymentPayload: SendPayment = {
|
||||
uiMessage: UI_MESSAGES.SEND_PAYMENT, outgoingChannel: null, feeLimitType: 'none', feeLimit: null, fromDialog: true,
|
||||
paymentReq: 'lntb4u1psvdzaypp555uks3f6774kl3vdy2dfr00j847pyxtrqelsdnczuxnmtqv99srsdpy23jhxarfdenjqmn8wfuzq3txvejkxarnyq6qcqp2sp5xjzu6pz2sf8x4v8nmr58kjdm6k05etjfq9c96mwkhzl0g9j7sjkqrzjq28vwprzypa40c75myejm8s2aenkeykcnd7flvy9plp2yjq56nvrc8ss5cqqqzgqqqqqqqlgqqqqqqgq9q9qy9qsqpt6u4rwfrck3tmpn54kdxjx3xdch62t5wype2f44mmlar07y749xt9elhfhf6dnlfk2tjwg3qpy8njh6remphfcc0630aq38j0s3hrgpv4eel3'
|
||||
};
|
||||
|
@ -150,7 +154,7 @@ describe('LightningSendPaymentsComponent', () => {
|
|||
it('should decode payment when pay request changed and fiat conversion is true', () => {
|
||||
const updatedSelNode: SelNodeChild = JSON.parse(JSON.stringify(component.selNode));
|
||||
updatedSelNode.fiatConversion = true;
|
||||
updatedSelNode.currencyUnits[2] = 'USD';
|
||||
updatedSelNode.currencyUnits = ['BTC', 'SAT', 'USD'];
|
||||
Object.defineProperty(component, 'selNode', { value: updatedSelNode });
|
||||
component.onPaymentRequestEntry('lntb4u1psvdzaypp555uks3f6774kl3vdy2dfr00j847pyxtrqelsdnczuxnmtqv99srsdpy23jhxarfdenjqmn8wfuzq3txvejkxarnyq6qcqp2sp5xjzu6pz2sf8x4v8nmr58kjdm6k05etjfq9c96mwkhzl0g9j7sjkqrzjq28vwprzypa40c75myejm8s2aenkeykcnd7flvy9plp2yjq56nvrc8ss5cqqqzgqqqqqqqlgqqqqqqgq9q9qy9qsqpt6u4rwfrck3tmpn54kdxjx3xdch62t5wype2f44mmlar07y749xt9elhfhf6dnlfk2tjwg3qpy8njh6remphfcc0630aq38j0s3hrgpv4eel3');
|
||||
expect(component.paymentDecodedHint).toEqual('Sending: 400 Sats (USD 0.13) | Memo: Testing ngrx Effects 4');
|
||||
|
|
Loading…
Add table
Reference in a new issue