aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/app.js3
-rw-r--r--tools/ark/cooperative-exit-ui-test.js9
2 files changed, 12 insertions, 0 deletions
diff --git a/src/app.js b/src/app.js
index 8394561..5e8f147 100644
--- a/src/app.js
+++ b/src/app.js
@@ -135,6 +135,9 @@ function showSend({ fresh = false } = {}) {
ui.bump = null;
ui.sendError = '';
if (fresh) clearSend();
+ // the Send tab lives on the wallet screen: from a page like Spending's
+ // settings (its co-operative exit) the tab flipped out of sight
+ ui.screen = 'wallet';
ui.tab = 'send';
}
diff --git a/tools/ark/cooperative-exit-ui-test.js b/tools/ark/cooperative-exit-ui-test.js
index 831ed3b..72e4705 100644
--- a/tools/ark/cooperative-exit-ui-test.js
+++ b/tools/ark/cooperative-exit-ui-test.js
@@ -91,6 +91,15 @@ try {
assert.match(st.text, /Security/); assert.match(st.text, /Lock wallet/); assert.match(st.text, /Recovery phrase/);
await page.screenshot({ path: '/tmp/gear-settings.png', fullPage: true });
console.log('✓ The Spending gear opens its settings: coins, the exit cost (gone from home), lock and recovery phrase');
+ // its co-operative exit opens the move form on the wallet (it used to flip
+ // the Send tab behind the settings page and seem to do nothing)
+ await coopButton();
+ await page.waitForSelector('input.mono-input', { timeout: 3000 });
+ assert.equal(await page.evaluate(() => coopApp.ui.screen), 'wallet');
+ assert.equal(await page.$eval('input.mono-input', (e) => e.value), await page.evaluate(() => coopApp.wallet.freshReceive().address));
+ assert.deepEqual(await page.evaluate(() => coopCalls), [], 'opening the form never starts an exit');
+ console.log('✓ From the Spending settings, the co-operative exit opens its form, prefilled to Savings');
+ await page.evaluate(() => { coopApp.ui.arkOffboardSend = null; coopApp.ui.tab = 'receive'; coopApp.render(); });
await page.evaluate(() => { window.forceArkReady = false; coopApp.wallet.saveFeatureState('arkDepth', null); coopApp.ui.screen = 'wallet'; coopApp.render(); });
await manage();