From 2d1f83c88000503b0ce5dbe391ce1929bcb9a71b Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 22 Oct 2026 23:17:13 -0700 Subject: Custody strategy: the price sits under the drop-down, not in the option text (which overflowed on a phone) Co-Authored-By: Claude Fable 5.1 --- tools/ark/custody-ui-test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/ark/custody-ui-test.js b/tools/ark/custody-ui-test.js index 5eabbfa..9c238f5 100644 --- a/tools/ark/custody-ui-test.js +++ b/tools/ark/custody-ui-test.js @@ -78,7 +78,8 @@ try { let tx = await text(); assert.match(tx, /Custody/); const opts = await page.$$eval('.ark-custody option', (es) => es.map((e) => e.value + '=' + e.textContent)); - assert.deepEqual(opts, ['custodial=Allow coins to expire · no fees', 'self=Minimize renewal cost · 300 sats per renewal', 'exit=Minimize exit cost · 300 sats near expiry, 0.2% + 300 sats when early']); + assert.deepEqual(opts, ['custodial=Allow coins to expire', 'self=Minimize renewal cost', 'exit=Minimize exit cost']); + assert.equal(await page.$eval('.ark-custody-cost', (e) => e.textContent), 'no fees'); assert.equal(await page.$eval('#ark-custody-select', (e) => e.value), 'custodial', 'coins expire by default'); assert.equal(await page.evaluate(() => coopFeature.getCustody()), 'custodial'); assert.match(await page.$eval('.ark-custody-desc', (e) => e.textContent), /keeps its own exit until it expires/); @@ -112,6 +113,7 @@ try { assert.match(tx, /Custody choice saved/); assert.match(await renewSheet(), /renews coins automatically once they are close to expiring/); assert.match(await page.$eval('.ark-custody-desc', (e) => e.textContent), /Coins renew in the last hours/); + assert.equal(await page.$eval('.ark-custody-cost', (e) => e.textContent), '300 sats per renewal'); const calls = await page.evaluate(() => coopFeature.autoRefreshCalls); assert.deepEqual(calls[0], ['ensure', 6, 8, 1], 'backstop orders registered at once (regtest margin 6)'); assert.deepEqual(calls[1], ['refresh', ['coin-1', 'coin-2']], 'the coin past its timelock is renewed now with the small change; the deep healthy one is left alone'); @@ -121,6 +123,7 @@ try { await page.evaluate(() => { coopFeature.autoRefreshCalls.length = 0; }); await page.select('#ark-custody-select', 'exit'); await sleep(400); assert.equal(await page.evaluate(() => coopFeature.getCustody()), 'exit'); + assert.equal(await page.$eval('.ark-custody-cost', (e) => e.textContent), '300 sats near expiry, 0.2% + 300 sats when early'); const calls2 = await page.evaluate(() => coopFeature.autoRefreshCalls); assert.deepEqual(calls2[1], ['refresh', ['coin-1', 'coin-0', 'coin-2']], 'expired + deep (worth it) + small change ride one round'); console.log('✓ "Keep my exit cheap" renews the deep coin too, when the fee is under a tenth of it'); -- cgit v1.2.3