@@ -299,10 +299,33 @@ d('Send', () => {
299299 . toHaveText ( '129 502' )
300300 . withTimeout ( 10000 ) ;
301301
302- // send to unified invoice w/ amount
302+ // can edit invoice on the review screen
303303 const { paymentRequest : invoice2 } = await lnd . addInvoice ( { value : 10000 } ) ;
304+ await enterAddress ( invoice2 ) ;
305+ let attributes = await element (
306+ by . id ( 'ReviewAmount-primary' ) ,
307+ ) . getAttributes ( ) ;
308+ let amount = attributes . label ;
309+ jestExpect ( amount ) . toBe ( '10 000' ) ;
310+ await element ( by . id ( 'ReviewUri' ) ) . tap ( ) ;
311+ await element ( by . id ( 'RecipientInput' ) ) . replaceText ( onchainAddress ) ;
312+ await element ( by . id ( 'RecipientInput' ) ) . tapReturnKey ( ) ;
313+ await element ( by . id ( 'AddressContinue' ) ) . tap ( ) ;
314+ await expect ( element ( by . id ( 'AssetButton-savings' ) ) ) . toBeVisible ( ) ;
315+ await element ( by . id ( 'N2' ) . withAncestor ( by . id ( 'SendAmountNumberPad' ) ) ) . tap ( ) ;
316+ await element (
317+ by . id ( 'N0' ) . withAncestor ( by . id ( 'SendAmountNumberPad' ) ) ,
318+ ) . multiTap ( 4 ) ;
319+ await element ( by . id ( 'ContinueAmount' ) ) . tap ( ) ;
320+ attributes = await element ( by . id ( 'ReviewAmount-primary' ) ) . getAttributes ( ) ;
321+ amount = attributes . label ;
322+ jestExpect ( amount ) . toBe ( '20 000' ) ;
323+ await element ( by . id ( 'SendSheet' ) ) . swipe ( 'down' ) ;
324+
325+ // send to unified invoice w/ amount
326+ const { paymentRequest : invoice3 } = await lnd . addInvoice ( { value : 10000 } ) ;
304327 const unified1 = encode ( onchainAddress , {
305- lightning : invoice2 ,
328+ lightning : invoice3 ,
306329 amount : 10000 ,
307330 } ) ;
308331
@@ -319,11 +342,11 @@ d('Send', () => {
319342 . withTimeout ( 10000 ) ;
320343
321344 // send to unified invoice w/ amount exceeding balance(s)
322- const { paymentRequest : invoice3 } = await lnd . addInvoice ( {
345+ const { paymentRequest : invoice4 } = await lnd . addInvoice ( {
323346 value : 200000 ,
324347 } ) ;
325348 const unified2 = encode ( onchainAddress , {
326- lightning : invoice3 ,
349+ lightning : invoice4 ,
327350 amount : 200000 ,
328351 } ) ;
329352
@@ -369,8 +392,8 @@ d('Send', () => {
369392 . withTimeout ( 10000 ) ;
370393
371394 // send to unified invoice w/o amount (lightning)
372- const { paymentRequest : invoice4 } = await lnd . addInvoice ( ) ;
373- const unified4 = encode ( onchainAddress , { lightning : invoice4 } ) ;
395+ const { paymentRequest : invoice5 } = await lnd . addInvoice ( ) ;
396+ const unified4 = encode ( onchainAddress , { lightning : invoice5 } ) ;
374397
375398 await enterAddress ( unified4 ) ;
376399 // max amount (lightning)
@@ -396,8 +419,8 @@ d('Send', () => {
396419 . withTimeout ( 10000 ) ;
397420
398421 // send to unified invoice w/o amount (switch to onchain)
399- const { paymentRequest : invoice5 } = await lnd . addInvoice ( ) ;
400- const unified5 = encode ( onchainAddress , { lightning : invoice5 } ) ;
422+ const { paymentRequest : invoice6 } = await lnd . addInvoice ( ) ;
423+ const unified5 = encode ( onchainAddress , { lightning : invoice6 } ) ;
401424
402425 await enterAddress ( unified5 ) ;
403426
@@ -434,7 +457,7 @@ d('Send', () => {
434457 . withTimeout ( 10000 ) ;
435458
436459 // send to lightning invoice w/ amount (quickpay)
437- const { paymentRequest : invoice6 } = await lnd . addInvoice ( { value : 1000 } ) ;
460+ const { paymentRequest : invoice7 } = await lnd . addInvoice ( { value : 1000 } ) ;
438461
439462 // enable quickpay
440463 await element ( by . id ( 'Settings' ) ) . tap ( ) ;
@@ -444,7 +467,7 @@ d('Send', () => {
444467 await element ( by . id ( 'QuickpayToggle' ) ) . tap ( ) ;
445468 await element ( by . id ( 'NavigationClose' ) ) . tap ( ) ;
446469
447- await enterAddress ( invoice6 ) ;
470+ await enterAddress ( invoice7 ) ;
448471 await waitFor ( element ( by . id ( 'SendSuccess' ) ) )
449472 . toBeVisible ( )
450473 . withTimeout ( 10000 ) ;
@@ -456,9 +479,9 @@ d('Send', () => {
456479 . withTimeout ( 10000 ) ;
457480
458481 // send to unified invoice w/ amount (quickpay)
459- const { paymentRequest : invoice7 } = await lnd . addInvoice ( { value : 1000 } ) ;
482+ const { paymentRequest : invoice8 } = await lnd . addInvoice ( { value : 1000 } ) ;
460483 const unified7 = encode ( onchainAddress , {
461- lightning : invoice7 ,
484+ lightning : invoice8 ,
462485 amount : 1000 ,
463486 } ) ;
464487
@@ -474,8 +497,8 @@ d('Send', () => {
474497 . withTimeout ( 10000 ) ;
475498
476499 // send to lightning invoice w/ amount (skip quickpay for large amounts)
477- const { paymentRequest : invoice8 } = await lnd . addInvoice ( { value : 10000 } ) ;
478- await enterAddress ( invoice8 ) ;
500+ const { paymentRequest : invoice9 } = await lnd . addInvoice ( { value : 10000 } ) ;
501+ await enterAddress ( invoice9 ) ;
479502 await expect ( element ( by . id ( 'ReviewAmount' ) ) ) . toBeVisible ( ) ;
480503 await element ( by . id ( 'SendSheet' ) ) . swipe ( 'down' ) ;
481504
0 commit comments