Skip to content

Commit f584c1c

Browse files
authored
Merge pull request #71 from synonymdev/fix/dont-edit-amt-on-fixed-amt-lightning
lightning: verify edit amt on send invoices
2 parents f54c5cb + ba0f328 commit f584c1c

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

test/helpers/lnd.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ export async function connectToLND(lndNodeID: string, { navigationClose = true }
118118
await typeText('PortInput', '9735');
119119
await confirmInputOnKeyboard();
120120
await tap('ExternalContinue');
121+
await sleep(1000);
121122
if (navigationClose) await doNavigationClose();
122123
}
123124

test/specs/lightning.e2e.ts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,13 @@ describe('@lightning - Lightning', () => {
109109
// check channel status
110110
await checkChannelStatus();
111111

112-
// send funds to LDK, 0 invoice
112+
console.info('receive 10k sats from LND (non-edited invoice)');
113113
const receive = await getReceiveAddress('lightning');
114114
await swipeFullScreen('down');
115115
const response = await lnd.sendPaymentSync({ paymentRequest: receive, amt: '10000' });
116116
console.info({ response });
117-
await elementById('ReceivedTransaction').waitForDisplayed();
118-
await tap('ReceivedTransactionButton');
119-
await sleep(1000);
117+
await acknowledgeReceivedPayment();
118+
await sleep(500);
120119
if (driver.isIOS) {
121120
await dismissBackgroundPaymentsTimedSheet({ triggerTimedSheet: driver.isIOS });
122121
await dismissQuickPayIntro({ triggerTimedSheet: driver.isIOS });
@@ -127,7 +126,7 @@ describe('@lightning - Lightning', () => {
127126
await expect(totalBalance).toHaveText('11 000'); // 1k onchain + 10k lightning
128127
await expectTextWithin('ActivitySpending', '10 000');
129128

130-
// send funds to LDK, 111 sats invoice
129+
console.info('receive 111 sats from LND, (edited invoice with amt=111, note and tag)');
131130
await tap('Receive');
132131
await sleep(1000);
133132
await tap('SpecifyInvoiceButton');
@@ -148,36 +147,42 @@ describe('@lightning - Lightning', () => {
148147
const invoice2 = await getAddressFromQRCode('lightning');
149148
await swipeFullScreen('down');
150149
await lnd.sendPaymentSync({ paymentRequest: invoice2 });
151-
await elementById('ReceivedTransaction').waitForDisplayed();
152-
await tap('ReceivedTransactionButton');
150+
await acknowledgeReceivedPayment();
153151
await sleep(500);
154152
await expect(totalBalance).toHaveText('11 111'); // 1k onchain + 10 111 lightning
155153
await expectTextWithin('ActivitySpending', '10 111');
156154

157-
// send funds to LND, 0 invoice
155+
await console.info('send lightning payment (lightning invoice with no amount and note)');
158156
const note2 = 'zero';
159157
const { paymentRequest: invoice1 } = await lnd.addInvoice({
160158
memo: note2,
161159
});
160+
await console.info({ invoice1 });
162161
await enterAddress(invoice1);
163162
await multiTap('N1', 3);
164163
await tap('ContinueAmount');
164+
await console.info('I can edit the amount on Review screen');
165+
await tap('ReviewAmount-primary');
166+
await tap('ContinueAmount');
165167
await dragOnElement('GRAB', 'right', 0.95); // Swipe to confirm
166168
await elementById('SendSuccess').waitForDisplayed();
167169
await tap('Close');
168170
await expect(totalBalance).toHaveText('11 000'); // 1k onchain + 10k lightning
169171
await expectTextWithin('ActivitySpending', '10 000');
170172

171-
// send funds to LND, 10000 invoice
173+
await console.info('send lightning payment (lightning invoice with amount = 1000) and manually added tag');
172174
const value = '1000';
173175
const { paymentRequest: invoice4 } = await lnd.addInvoice({
174176
value: value,
175177
});
176-
await enterAddress(invoice4);
178+
await console.info({ invoice4 });
179+
await enterAddress(invoice4, { acceptCameraPermission: false });
177180
// Review & Send
178181
const reviewAmt = await elementByIdWithin('ReviewAmount-primary', 'MoneyText');
179182
await reviewAmt.waitForDisplayed();
180183
await expect(reviewAmt).toHaveText('1 000');
184+
await console.info('I cannot edit the amount on Review screen');
185+
await tap('ReviewAmount-primary');
181186
await tap('TagsAddSend');
182187
await typeText('TagInputSend', 'stag');
183188
await tap('SendTagsSubmit');
@@ -234,13 +239,15 @@ describe('@lightning - Lightning', () => {
234239
// filter by receive tag
235240
await tap('Tab-all');
236241
await tap('TagsPrompt');
242+
await sleep(500);
237243
await tap('Tag-rtag');
238244
await expectTextWithin('Activity-1', '+');
239245
await elementById('Activity-2').waitForDisplayed({ reverse: true });
240246
await tap('Tag-rtag-delete');
241247

242248
// filter by send tag
243249
await tap('TagsPrompt');
250+
await sleep(500);
244251
await tap('Tag-stag');
245252
await expectTextWithin('Activity-1', '-');
246253
await elementById('Activity-2').waitForDisplayed({ reverse: true });

0 commit comments

Comments
 (0)