Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions e2e/backup.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ d('Backup', () => {
await rpc.generateToAddress(1, await rpc.getNewAddress());
await electrum?.waitForSync();

await waitFor(element(by.id('NewTxPrompt')))
await waitFor(element(by.id('ReceivedTransaction')))
.toBeVisible()
.withTimeout(10000);
await element(by.id('NewTxPrompt')).swipe('down'); // close Receive screen
await element(by.id('ReceivedTransaction')).swipe('down'); // close Receive screen
await sleep(200); // animation

// set tag to new tx
Expand All @@ -92,7 +92,7 @@ d('Backup', () => {
await element(by.id('NavigationClose')).atIndex(0).tap();

// remove 2 default widgets, leave PriceWidget
await element(by.id('HomeScrollView')).scroll(200, 'down', 0);
await element(by.id('HomeScrollView')).scroll(200, 'down', 0, 0.5);
await element(by.id('WidgetsEdit')).tap();
for (const w of ['NewsWidget', 'BlocksWidget']) {
await element(by.id('WidgetActionDelete').withAncestor(by.id(w))).tap();
Expand Down Expand Up @@ -122,7 +122,7 @@ d('Backup', () => {
await sleep(200); // animation

// check widgets
await element(by.id('HomeScrollView')).scroll(300, 'down', 0);
await element(by.id('HomeScrollView')).scroll(300, 'down', 0, 0.5);
await expect(element(by.id('PriceWidget'))).toExist();
await expect(element(by.id('NewsWidget'))).not.toExist();
await expect(element(by.id('BlocksWidget'))).not.toExist();
Expand Down
8 changes: 4 additions & 4 deletions e2e/boost.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ d('Boost', () => {
await rpc.sendToAddress(wAddress, '0.001');
await rpc.generateToAddress(1, await rpc.getNewAddress());
await electrum?.waitForSync();
await waitFor(element(by.id('NewTxPrompt')))
await waitFor(element(by.id('ReceivedTransaction')))
.toBeVisible()
.withTimeout(10000);
await element(by.id('NewTxPromptButton')).tap();
await element(by.id('ReceivedTransactionButton')).tap();
await expect(
element(by.id('MoneyText').withAncestor(by.id('TotalBalance'))),
).toHaveText('100 000');
Expand Down Expand Up @@ -178,10 +178,10 @@ d('Boost', () => {
await rpc.sendToAddress(wAddress, '0.001');
await rpc.generateToAddress(1, await rpc.getNewAddress());
await electrum?.waitForSync();
await waitFor(element(by.id('NewTxPrompt')))
await waitFor(element(by.id('ReceivedTransaction')))
.toBeVisible()
.withTimeout(10000);
await element(by.id('NewTxPromptButton')).tap();
await element(by.id('ReceivedTransactionButton')).tap();
await expect(
element(by.id('MoneyText').withAncestor(by.id('TotalBalance'))),
).toHaveText('100 000');
Expand Down
4 changes: 2 additions & 2 deletions e2e/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ export const receiveOnchainFunds = async (rpc, amount = '0.001') => {
await rpc.sendToAddress(wAddress, amount);
await rpc.generateToAddress(1, await rpc.getNewAddress());

await waitFor(element(by.id('NewTxPrompt')))
await waitFor(element(by.id('ReceivedTransaction')))
.toBeVisible()
.withTimeout(10000);
await element(by.id('NewTxPrompt')).swipe('down');
await element(by.id('ReceivedTransaction')).swipe('down');
await sleep(1000);
};

Expand Down
19 changes: 10 additions & 9 deletions e2e/lightning.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ d('Lightning', () => {
let { label: invoice1 } = await element(by.id('QRCode')).getAttributes();
invoice1 = invoice1.replaceAll(/bitcoin.*=/gi, '').toLowerCase();
await lnd.sendPaymentSync({ paymentRequest: invoice1, amt: 50000 });
await waitFor(element(by.id('NewTxPrompt')))
await waitFor(element(by.id('ReceivedTransaction')))
.toBeVisible()
.withTimeout(10000);
await element(by.id('NewTxPrompt')).swipe('down');
await element(by.id('ReceivedTransaction')).swipe('down');
await waitFor(
element(by.id('MoneyText').withAncestor(by.id('TotalBalance'))),
)
Expand All @@ -153,20 +153,21 @@ d('Lightning', () => {
const note1 = 'note 111';
await element(by.id('ReceiveNote')).typeText(note1);
await element(by.id('ReceiveNote')).tapReturnKey();
await sleep(200);
await sleep(300); // wait for keyboard to hide
await element(by.id('TagsAdd')).tap();
await element(by.id('TagInputReceive')).typeText('rtag');
await element(by.id('TagInputReceive')).tapReturnKey();
await sleep(300); // wait for keyboard to hide
await element(by.id('ShowQrReceive')).tap();
await element(by.id('QRCode')).swipe('left');
const { label: invoice2 } = await element(
by.id('ReceiveLightningInvoice'),
).getAttributes();
await lnd.sendPaymentSync({ paymentRequest: invoice2 });
await waitFor(element(by.id('NewTxPrompt')))
await waitFor(element(by.id('ReceivedTransaction')))
.toBeVisible()
.withTimeout(10000);
await element(by.id('NewTxPrompt')).swipe('down');
await element(by.id('ReceivedTransaction')).swipe('down');
await waitFor(
element(by.id('MoneyText').withAncestor(by.id('TotalBalance'))),
)
Expand Down Expand Up @@ -232,7 +233,7 @@ d('Lightning', () => {
.withTimeout(10000);

// check tx history
await element(by.id('HomeScrollView')).scroll(1000, 'down', 0);
await element(by.id('HomeScrollView')).scroll(1000, 'down', 0, 0.5);
await expect(
element(by.text('1 000').withAncestor(by.id('ActivityShort-1'))),
).toBeVisible();
Expand Down Expand Up @@ -324,7 +325,7 @@ d('Lightning', () => {
.withTimeout(10000);

// check tx history
await element(by.id('HomeScrollView')).scroll(1000, 'down', 0);
await element(by.id('HomeScrollView')).scroll(1000, 'down', 0, 0.5);
await expect(
element(by.text('111').withAncestor(by.id('ActivityShort-2'))),
).toBeVisible();
Expand Down Expand Up @@ -360,10 +361,10 @@ d('Lightning', () => {

// TODO: for some reason this doen't work on github actions
// wait for onchain payment to arrive
// await waitFor(element(by.id('NewTxPrompt')))
// await waitFor(element(by.id('ReceivedTransaction')))
// .toBeVisible()
// .withTimeout(60000);
// await element(by.id('NewTxPrompt')).swipe('down');
// await element(by.id('ReceivedTransaction')).swipe('down');
// await expect(
// element(by.id('MoneySign').withAncestor(by.id('ActivityShort-1'))),
// ).toHaveText('+');
Expand Down
8 changes: 4 additions & 4 deletions e2e/lnurl.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@ d('LNURL', () => {
await element(by.id('DialogConfirm')).tap();
await element(by.id('ContinueAmount')).tap();
await element(by.id('WithdrawConfirmButton')).tap();
await waitFor(element(by.id('NewTxPrompt')))
await waitFor(element(by.id('ReceivedTransaction')))
.toBeVisible()
.withTimeout(10000);
await element(by.id('NewTxPrompt')).swipe('down');
await element(by.id('ReceivedTransaction')).swipe('down');

// test lnurl-withdraw, with min !== max amount
const withdrawRequest2 = await lnurl.generateNewUrl('withdrawRequest', {
Expand All @@ -277,10 +277,10 @@ d('LNURL', () => {
await element(by.id('QRInput')).replaceText(withdrawRequest2.encoded);
await element(by.id('DialogConfirm')).tap();
await element(by.id('WithdrawConfirmButton')).tap();
await waitFor(element(by.id('NewTxPrompt')))
await waitFor(element(by.id('ReceivedTransaction')))
.toBeVisible()
.withTimeout(10000);
await element(by.id('NewTxPrompt')).swipe('down');
await element(by.id('ReceivedTransaction')).swipe('down');

// test lnurl-auth
const loginRequest1 = await lnurl.generateNewUrl('login');
Expand Down
17 changes: 9 additions & 8 deletions e2e/onchain.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,17 @@ d('Onchain', () => {
await element(by.id('TagsAdd')).tap();
await element(by.id('TagInputReceive')).typeText(`rtag${i}`);
await element(by.id('TagInputReceive')).tapReturnKey();
await sleep(300); // wait for keyboard to hide
await element(by.id('ShowQrReceive')).tap();

await rpc.sendToAddress(wAddress, '1');
await rpc.generateToAddress(1, await rpc.getNewAddress());
await electrum?.waitForSync();

await waitFor(element(by.id('NewTxPrompt')))
await waitFor(element(by.id('ReceivedTransaction')))
.toBeVisible()
.withTimeout(10000);
await element(by.id('NewTxPrompt')).swipe('down'); // close Receive screen
await element(by.id('ReceivedTransaction')).swipe('down'); // close Receive screen
await sleep(1000); // animation
}

Expand Down Expand Up @@ -140,7 +141,7 @@ d('Onchain', () => {
).toHaveText('0');

// check Activity
await element(by.id('HomeScrollView')).scroll(1000, 'down', 0);
await element(by.id('HomeScrollView')).scroll(1000, 'down', 0, 0.5);
await expect(element(by.id('ActivityShort-1'))).toBeVisible();
await expect(element(by.id('ActivityShort-2'))).toBeVisible();
await expect(element(by.id('ActivityShort-3'))).toBeVisible();
Expand Down Expand Up @@ -200,7 +201,7 @@ d('Onchain', () => {
await element(by.id('Tag-stag-delete')).tap();

// calendar, previous month, 0 transactions
await element(by.id('TimeRangePrompt')).tap();
await element(by.id('DatePicker')).tap();
await expect(element(by.id('Today'))).toBeVisible();
await element(by.id('PrevMonth')).tap();
await expect(element(by.id('Today'))).not.toExist();
Expand All @@ -210,7 +211,7 @@ d('Onchain', () => {
await expect(element(by.id('Activity-1'))).not.toExist();

// calendar, current date, 3 transactions
await element(by.id('TimeRangePrompt')).tap();
await element(by.id('DatePicker')).tap();
await element(by.id('CalendarClearButton')).tap();
await element(by.id('NextMonth')).tap();
await element(by.id('Today')).tap();
Expand All @@ -237,10 +238,10 @@ d('Onchain', () => {
// await rpc.generateToAddress(1, await rpc.getNewAddress());
// await electrum?.waitForSync();

await waitFor(element(by.id('NewTxPrompt')))
await waitFor(element(by.id('ReceivedTransaction')))
.toBeVisible()
.withTimeout(10000);
await element(by.id('NewTxPrompt')).swipe('down'); // close Receive screen
await element(by.id('ReceivedTransaction')).swipe('down'); // close Receive screen
await sleep(1000); // animation

const coreAddress = await rpc.getNewAddress();
Expand Down Expand Up @@ -307,7 +308,7 @@ d('Onchain', () => {
).toHaveText('0');

// check number of outputs for send tx
await element(by.id('HomeScrollView')).scroll(1000, 'down', 0);
await element(by.id('HomeScrollView')).scroll(1000, 'down', 0, 0.5);
await expect(element(by.id('ActivityShort-1'))).toBeVisible();
await expect(element(by.id('ActivityShort-2'))).toBeVisible();
await element(by.id('ActivityShowAll')).tap();
Expand Down
3 changes: 2 additions & 1 deletion e2e/receive.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@ d('Receive', () => {
const note = 'iPhone Refurbished';
await element(by.id('ReceiveNote')).typeText(note);
await element(by.id('ReceiveNote')).tapReturnKey();
await sleep(200);
await sleep(300); // wait for keyboard to hide

// Tags
const tag = 'test123';
await element(by.id('TagsAdd')).tap();
await element(by.id('TagInputReceive')).typeText(tag);
await element(by.id('ReceiveTagsSubmit')).tap();
await sleep(300); // wait for keyboard to hide

// Show QR
await element(by.id('ShowQrReceive')).tap();
Expand Down
4 changes: 2 additions & 2 deletions e2e/security.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ d('Settings Security And Privacy', () => {
await rpc.sendToAddress(wAddress, '1');
await rpc.generateToAddress(1, await rpc.getNewAddress());
await electrum?.waitForSync();
await waitFor(element(by.id('NewTxPrompt')))
await waitFor(element(by.id('ReceivedTransaction')))
.toBeVisible()
.withTimeout(10000);
await element(by.id('NewTxPrompt')).swipe('down'); // close Receive screen
await element(by.id('ReceivedTransaction')).swipe('down'); // close Receive screen

// send, using FaceID
const coreAddress = await rpc.getNewAddress();
Expand Down
4 changes: 2 additions & 2 deletions e2e/send.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,10 @@ d('Send', () => {
let { label: receive } = await element(by.id('QRCode')).getAttributes();
receive = receive.replaceAll(/bitcoin.*=/gi, '').toLowerCase();
await lnd.sendPaymentSync({ paymentRequest: receive, amt: 50000 });
await waitFor(element(by.id('NewTxPrompt')))
await waitFor(element(by.id('ReceivedTransaction')))
.toBeVisible()
.withTimeout(10000);
await element(by.id('NewTxPrompt')).swipe('down');
await element(by.id('ReceivedTransaction')).swipe('down');

await waitFor(
element(by.id('MoneyText').withAncestor(by.id('TotalBalance'))),
Expand Down
1 change: 1 addition & 0 deletions e2e/settings.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ d('Settings', () => {
await expect(element(by.text(tag))).not.toBeVisible();
await element(by.id('TagInputReceive')).typeText(tag);
await element(by.id('ReceiveTagsSubmit')).tap();
await sleep(300); // wait for keyboard to hide
await expect(element(by.text(tag))).toBeVisible();
await element(by.id('ReceiveScreen')).swipe('down');
await sleep(1000);
Expand Down
10 changes: 2 additions & 8 deletions e2e/slashtags.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,6 @@ d('Profile and Contacts', () => {
await element(by.id('NavigationBack')).tap();
await element(by.id('NavigationBack')).tap();

if (device.getPlatform() === 'ios') {
// FIXME: this bottom sheet should not appear
// Tap on background to dismiss
await element(by.label('Close')).atIndex(0).tap({ x: 10, y: 10 });
}

// Hal
await element(by.id('AddContact')).tap();
await element(by.id('ContactURLInput')).typeText(hal.url);
Expand Down Expand Up @@ -206,10 +200,10 @@ d('Profile and Contacts', () => {
await rpc.sendToAddress(wAddress, '1');
await rpc.generateToAddress(1, await rpc.getNewAddress());
await electrum?.waitForSync();
await waitFor(element(by.id('NewTxPrompt')))
await waitFor(element(by.id('ReceivedTransaction')))
.toBeVisible()
.withTimeout(10000);
await element(by.id('NewTxPrompt')).swipe('down');
await element(by.id('ReceivedTransaction')).swipe('down');
await element(by.id('ActivitySavings')).tap();
await element(by.id('Activity-1')).tap();
await element(by.id('ActivityAssign')).tap();
Expand Down
8 changes: 4 additions & 4 deletions e2e/transfer.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ d('Transfer', () => {
await rpc.generateToAddress(1, await rpc.getNewAddress());
await electrum?.waitForSync();

await waitFor(element(by.id('NewTxPrompt')))
await waitFor(element(by.id('ReceivedTransaction')))
.toBeVisible()
.withTimeout(20000);
await element(by.id('NewTxPrompt')).swipe('down'); // close Receive screen
await element(by.id('ReceivedTransaction')).swipe('down'); // close Receive screen

// switch to USD
await element(by.id('HeaderMenu')).tap();
Expand Down Expand Up @@ -261,10 +261,10 @@ d('Transfer', () => {
await rpc.sendToAddress(wAddress, '0.001');
await rpc.generateToAddress(1, await rpc.getNewAddress());

await waitFor(element(by.id('NewTxPrompt')))
await waitFor(element(by.id('ReceivedTransaction')))
.toBeVisible()
.withTimeout(20000);
await element(by.id('NewTxPrompt')).swipe('down');
await element(by.id('ReceivedTransaction')).swipe('down');

// Get LDK node id
await element(by.id('HeaderMenu')).tap();
Expand Down
4 changes: 2 additions & 2 deletions e2e/widgets.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ d('Widgets', () => {
}

// add price widget
await element(by.id('HomeScrollView')).scroll(300, 'down', 0);
await element(by.id('HomeScrollView')).scroll(300, 'down', 0, 0.5);
await element(by.id('WidgetsAdd')).tap();
await element(by.id('WidgetsOnboarding-button')).tap();
await element(by.id('WidgetListItem-price')).tap();
Expand All @@ -50,7 +50,7 @@ d('Widgets', () => {
await element(by.id('WidgetEditField-showSource')).tap();
await element(by.id('WidgetEditPreview')).tap();
await element(by.id('WidgetSave')).tap();
await element(by.id('HomeScrollView')).scroll(200, 'down', 0);
await element(by.id('HomeScrollView')).scroll(200, 'down', 0, 0.5);
await expect(element(by.id('PriceWidget'))).toBeVisible();
await expect(element(by.id('PriceWidgetRow-BTC/EUR'))).toBeVisible();
await expect(element(by.id('PriceWidgetSource'))).toBeVisible();
Expand Down
30 changes: 30 additions & 0 deletions patches/@gorhom+bottom-sheet+4.6.4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/node_modules/@gorhom/bottom-sheet/lib/typescript/types.d.ts b/node_modules/@gorhom/bottom-sheet/lib/typescript/types.d.ts
index 27f39a1..914efc6 100644
--- a/node_modules/@gorhom/bottom-sheet/lib/typescript/types.d.ts
+++ b/node_modules/@gorhom/bottom-sheet/lib/typescript/types.d.ts
@@ -91,6 +91,10 @@ export interface BottomSheetModalMethods extends BottomSheetMethods {
* @see {WithTimingConfig}
*/
dismiss: (animationConfigs?: WithSpringConfig | WithTimingConfig) => void;
+ /**
+ * Check if the bottom sheet modal is open.
+ */
+ isOpen: () => boolean;
}
//#endregion

diff --git a/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetModal/BottomSheetModal.tsx b/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetModal/BottomSheetModal.tsx
index 275ce50..2d5ea19 100644
--- a/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetModal/BottomSheetModal.tsx
+++ b/node_modules/@gorhom/bottom-sheet/src/components/bottomSheetModal/BottomSheetModal.tsx
@@ -363,6 +363,10 @@ const BottomSheetModalComponent = forwardRef<
// internal
minimize: handleMinimize,
restore: handleRestore,
+ isOpen: () => {
+ // If animateOnMount is disabled, the sheet is open if it's mounted
+ return animateOnMount ? currentIndexRef.current !== -1 : mounted.current;
+ },
}));
//#endregion

Loading
Loading