diff options
| author | Adam Soltys <[email protected]> | 2026-10-07 13:47:09 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-10-07 13:47:09 -0700 |
| commit | 3ffe565b3d50539470a05b1f7a65f5fed419daf5 (patch) | |
| tree | ed1af8a501c8db6a01af2bff0f2fc4dad7b9bf39 /tools/send-enter-keys-test.js | |
| parent | 20c9a87850f034071990067ed0dc042503e6deaf (diff) | |
| download | coinosv3-3ffe565b3d50539470a05b1f7a65f5fed419daf5.tar.gz coinosv3-3ffe565b3d50539470a05b1f7a65f5fed419daf5.zip | |
Desktop Send focus: a mouse click leaves the Send button focused, and that blocked the recipient field — only a field you're typing in is protected now (test opens Send with a real click)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'tools/send-enter-keys-test.js')
| -rw-r--r-- | tools/send-enter-keys-test.js | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tools/send-enter-keys-test.js b/tools/send-enter-keys-test.js index 67997c0..aac95f8 100644 --- a/tools/send-enter-keys-test.js +++ b/tools/send-enter-keys-test.js @@ -72,11 +72,28 @@ try { check('back on Spending, history again', !(await lit()), await lit()); console.log('[recipient: Enter picks the top suggestion]'); - await page.evaluate(() => [...document.querySelectorAll('button')].find((b) => b.textContent.trim() === 'Send')?.click()); + // a REAL click: Chrome focuses the button clicked, and the recipient field + // must still take the cursor from it + const openSend = async () => { + for (const b of await page.$$('button')) if ((await b.evaluate((n) => n.textContent.trim())) === 'Send') { await b.click(); return; } + }; + await openSend(); await page.waitForSelector('textarea.send-dest', { timeout: 10000 }); await sleep(300); check('desktop: Send opens with the cursor in the recipient field', await page.evaluate(() => document.activeElement?.matches('textarea.send-dest')), await page.evaluate(() => document.activeElement?.outerHTML.slice(0, 80))); + // away and back, two ways: the cursor lands again each time + await page.evaluate(() => document.activeElement?.blur()); + await page.evaluate(() => [...document.querySelectorAll('button')].find((b) => b.textContent.trim() === 'Receive')?.click()); await sleep(600); + await openSend(); await sleep(600); + check('...again after Receive and back to Send', await page.evaluate(() => document.activeElement?.matches('textarea.send-dest')), + await page.evaluate(() => document.activeElement?.outerHTML.slice(0, 80))); + await page.evaluate(() => document.activeElement?.blur()); + await swipeTo('face-savings'); await sleep(1200); + await swipeTo('face-spending'); await sleep(1200); + await openSend(); await sleep(600); + check('...and after swiping to Savings and back', await page.evaluate(() => document.activeElement?.matches('textarea.send-dest')), + await page.evaluate(() => document.activeElement?.outerHTML.slice(0, 80))); await page.focus('textarea.send-dest'); await page.keyboard.type('adam', { delay: 80 }); let top = ''; |
