Skip to content

Commit

Permalink
refactor(settings): move LDK debug UI (#2209)
Browse files Browse the repository at this point in the history
  • Loading branch information
pwltr authored Sep 7, 2024
1 parent 910e714 commit f9c4eaa
Show file tree
Hide file tree
Showing 6 changed files with 458 additions and 329 deletions.
6 changes: 5 additions & 1 deletion e2e/lightning.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ d('Lightning', () => {
).getAttributes();
await element(by.id('NavigationBack')).atIndex(0).tap();
await sleep(100);
await element(by.id('NavigationBack')).atIndex(0).tap();
await element(by.id('DevSettings')).tap();
await element(by.id('LDKDebug')).tap();

// connect to LND
await element(by.id('Channels')).tap();
await element(by.id('AddPeerInput')).replaceText(
`${lndNodeID}@127.0.0.1:9735`,
);
Expand Down Expand Up @@ -145,6 +147,8 @@ d('Lightning', () => {
await sleep(500);
await element(by.id('NavigationBack')).atIndex(0).tap();
await sleep(100);
await element(by.id('NavigationBack')).atIndex(0).tap();
await element(by.id('AdvancedSettings')).atIndex(0).tap();
await element(by.id('Channels')).tap();
await element(by.id('Channel')).atIndex(0).tap();
await expect(
Expand Down
7 changes: 4 additions & 3 deletions e2e/settings.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@ d('Settings', () => {
if (!__DEV__) {
await element(by.id('DevOptions')).multiTap(5); // enable dev mode
}
await element(by.id('AdvancedSettings')).tap();
await element(by.id('Channels')).tap();
await element(by.id('DevSettings')).tap();
await element(by.id('LDKDebug')).tap();
await element(by.id('CopyNodeId')).tap();
await element(by.id('RefreshLDK')).tap();
await element(by.id('RestartLDK')).tap();
Expand All @@ -417,7 +417,8 @@ d('Settings', () => {
.toBeVisible()
.withTimeout(5000);
await element(by.id('NavigationBack')).atIndex(0).tap();

await element(by.id('NavigationBack')).atIndex(0).tap();
await element(by.id('AdvancedSettings')).tap();
await element(by.id('LightningNodeInfo')).tap();
// TODO: this fails too often on CI
// await waitFor(element(by.id('LDKNodeID')))
Expand Down
3 changes: 3 additions & 0 deletions src/navigation/settings/SettingsNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import CoinSelectPreference from '../../screens/Settings/CoinSelectPreference';
import PaymentPreference from '../../screens/Settings/PaymentPreference';
import AddressTypePreference from '../../screens/Settings/AddressTypePreference';
import DevSettings from '../../screens/Settings/DevSettings';
import LdkDebug from '../../screens/Settings/DevSettings/LdkDebug';
import AddressViewer from '../../screens/Settings/AddressViewer';
import LightningNodeInfo from '../../screens/Settings/Lightning/LightningNodeInfo';
import UnitSettings from '../../screens/Settings/Unit';
Expand Down Expand Up @@ -91,6 +92,7 @@ export type SettingsStackParamList = {
PaymentPreference: undefined;
AddressTypePreference: undefined;
DevSettings: undefined;
LdkDebug: undefined;
ExportToPhone: undefined;
ResetAndRestore: undefined;
BitcoinNetworkSelection: undefined;
Expand Down Expand Up @@ -160,6 +162,7 @@ const SettingsNavigator = (): ReactElement => {
component={AddressTypePreference}
/>
<Stack.Screen name="DevSettings" component={DevSettings} />
<Stack.Screen name="LdkDebug" component={LdkDebug} />
<Stack.Screen name="AddressViewer" component={AddressViewer} />
<Stack.Screen name="ExportToPhone" component={ExportToPhone} />
<Stack.Screen name="ResetAndRestore" component={ResetAndRestore} />
Expand Down
Loading

0 comments on commit f9c4eaa

Please sign in to comment.