From 58f7de1729bac5db2ade612ed1fd159b22ef587e Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 25 Oct 2026 14:52:14 -0700 Subject: Gifts carry a note: an optional "Add a note" when making one, quoted above the amount for whoever opens it. It rides the link after the # (#m=…), so no server sees it; the gift's record keeps it, so Copy link again and View include it; with a note the QR is byte mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QjVvE4YAcK3AGwV7kZXeN4 --- tools/gift-profile-setup-test.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/gift-profile-setup-test.js b/tools/gift-profile-setup-test.js index 67da261..9304d1a 100644 --- a/tools/gift-profile-setup-test.js +++ b/tools/gift-profile-setup-test.js @@ -33,11 +33,16 @@ const waitText = async (page, re, ms = 30000) => { for (let t = 0; t < ms; t += 250) { if (re.test(await text(page))) return true; await sleep(250); } return false; }; -async function toSeed(page) { +async function toSeed(page, note) { await page.goto(server.url.href); await page.evaluate(() => { localStorage.clear(); localStorage.setItem('btc-wallet-network', 'mutinynet'); }); - await page.goto(server.url.href + 'ag/' + giftCode()); + await page.goto(server.url.href + 'ag/' + giftCode() + (note ? '#m=' + encodeURIComponent(note) : '')); check('the gift opens: the server sees no coin behind it', await waitText(page, /aren.t visible/i)); + if (note) { + const q = await page.evaluate(() => document.querySelector('.gift-note')?.textContent || null); + check('the sender\'s note shows on the gift', q === note, String(q)); + check('...and leaves the address bar with the code', await page.evaluate(() => location.pathname === '/' && !location.hash)); + } await click(page, 'claim'); check('...so the claim finds it taken', await waitText(page, /create a wallet anyway/i)); check('...create a wallet anyway shows the seed', await click(page, 'create a wallet anyway') && await waitText(page, /recovery phrase/i, 10000)); @@ -47,7 +52,7 @@ try { const errors = []; page.on('pageerror', (e) => errors.push(String(e))); await page.setViewport({ width: 390, height: 844, deviceScaleFactor: 2 }); - await toSeed(page); + await toSeed(page, 'Happy birthday! 🎂 not bold'); await click(page, 'skip verification'); check('the seed done: the wizard asks for a username', await waitText(page, /now pick a username/i, 10000), (await text(page)).slice(0, 200)); check('...with the claim form (or its wait) and Not now', await page.evaluate(() => !!document.querySelector('.onb')) && /not now/i.test(await text(page))); -- cgit v1.2.3