diff options
Diffstat (limited to 'tools/signup-quick-test.js')
| -rw-r--r-- | tools/signup-quick-test.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/signup-quick-test.js b/tools/signup-quick-test.js index 3e38c5f..5005d6a 100644 --- a/tools/signup-quick-test.js +++ b/tools/signup-quick-test.js @@ -108,6 +108,27 @@ try { await page.reload({ waitUntil: 'domcontentloaded' }); await page.waitForSelector('.balance-face', { timeout: 20000 }); await sleep(1500); await giveBalance(); check('...and never again, not after a reload', !(await page.$('.ways-back-prompt'))); + // the breakdown (Ark / On-chain / Gifts) folds away under the total; a + // gift line stands in for it here (the ark feature made to report one) + { + const protoH = await page.evaluateHandle(() => Object.prototype); + const all = await page.queryObjects(protoH); + await page.evaluate((objs) => { + const f = objs.find((o) => { try { return o && o.id === 'ark' && typeof o.balanceLines === 'function'; } catch { return false; } }); + f.balanceLines = () => [{ label: 'Gifts', sat: 700, side: 'savings', part: true }]; + document.querySelector('.tabs button')?.click(); document.querySelector('.tabs button')?.click(); + }, all); + await all.dispose(); await protoH.dispose(); await sleep(600); + const face = () => page.evaluate(() => ({ t: document.querySelector('.balance-one')?.innerText || '', btn: document.querySelector('.balance-one .breakdown-toggle')?.textContent || '' })); + let f = await face(); + check('breakdown folded by default, with a way to open it', !/GIFTS/i.test(f.t.replace(f.btn, '')) && /breakdown/i.test(f.btn), JSON.stringify(f)); + await page.click('.balance-one .breakdown-toggle'); await sleep(400); + f = await face(); + check('opened, it shows the Gifts line', /Gifts/i.test(f.t.replace(f.btn, '')) && /hide/i.test(f.btn), JSON.stringify(f)); + if (process.env.SHOT3) await page.screenshot({ path: process.env.SHOT3 }); + check('remembered on this device', await page.evaluate(() => localStorage.getItem('btc-wallet-balance-breakdown') === '1')); + await page.evaluate(() => localStorage.removeItem('btc-wallet-balance-breakdown')); + } for (let i = 0; i < 60 && !(await page.$('#recv-amount')); i++) await sleep(250); check('Receive has an Amount button', !!(await page.$('#recv-amount'))); check('no History heading on an empty wallet', !/\bHISTORY\b/.test(await page.evaluate(() => document.body.innerText))); |
