Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 736870b

Browse files
committed
Unit tests for goPayLightningSupplyAmount and checkType.
1 parent 09d5baa commit 736870b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

test/unit/action/nav.spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ describe('Action Nav Unit Tests', () => {
116116
});
117117
});
118118

119+
describe('goPayLightningSupplyAmount()', () => {
120+
it('should set correct route', () => {
121+
nav.goPayLightningSupplyAmount();
122+
expect(store.route, 'to equal', 'PayLightningSupplyAmount');
123+
});
124+
});
125+
119126
describe('goPayLightningConfirm()', () => {
120127
it('should set correct route', () => {
121128
nav.goPayLightningConfirm();

test/unit/action/payment.spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,14 @@ describe('Action Payments Unit Tests', () => {
302302
expect(payment.decodeInvoice, 'was not called');
303303
});
304304

305+
it('should detect zero amount payment', async () => {
306+
store.payment.address = 'some-address';
307+
store.payment.amount = '0';
308+
payment.decodeInvoice.resolves(true);
309+
await payment.checkType();
310+
expect(nav.goPayLightningSupplyAmount, 'was called once');
311+
});
312+
305313
it('should decode successfully', async () => {
306314
store.payment.address = 'some-address';
307315
payment.decodeInvoice.resolves(true);

0 commit comments

Comments
 (0)