diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/ark/cooperative-exit-ui-test.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/ark/cooperative-exit-ui-test.js b/tools/ark/cooperative-exit-ui-test.js index d8fa0d8..506bca6 100644 --- a/tools/ark/cooperative-exit-ui-test.js +++ b/tools/ark/cooperative-exit-ui-test.js @@ -162,6 +162,19 @@ try { assert.deepEqual(await page.evaluate(() => coopCalls[1].script), await page.evaluate(() => [...coopApp.wallet.derive(0, 1).script])); console.log('✓ Editing the destination and amount offboards only the requested amount to the chosen on-chain address'); + // ticking a subset on Manage: exactly those coins go, no split, the amount is theirs and not a field + await manage(); + await page.evaluate(() => { coopApp.ui.arkCoinsSel = new Set(['coin-b']); coopApp.render(); }); + assert.match(await page.evaluate(() => [...document.querySelectorAll('.card')].find((c) => c.querySelector('h4')?.textContent === 'Co-operative exit').innerText), /Only the coin ticked above will move[\s\S]*Move 8,000 sats to Savings/); + await coopButton(); + await page.waitForSelector('.ark-coop-chosen'); + assert.match(await page.$eval('.ark-coop-chosen', (e) => e.textContent), /1 selected coin · 8,000 sats/); + assert.equal(await page.$('input[type="number"]'), null, 'no amount field for chosen coins'); + await send(); + await page.waitForFunction(() => coopCalls.length === 3 && !coopApp.ui.arkBusy); + assert.deepEqual(await page.evaluate(() => ({ type: coopCalls[2].type, ids: coopCalls[2].ids, address: coopCalls[2].address })), { type: 'offboard', ids: ['coin-b'], address: savings }); + console.log('✓ Ticking a subset on Manage offboards exactly those coins, without splitting'); + await manage(); await coopButton(); await page.evaluate(() => document.querySelector('.app-nav-button[aria-label="Wallet"]').click()); assert.equal(await page.evaluate(() => coopApp.ui.arkOffboardSend), null); |
