aboutsummaryrefslogtreecommitdiffstats
path: root/tools/send-enter-keys-test.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-07 11:48:58 -0700
committerAdam Soltys <[email protected]>2026-10-07 11:48:58 -0700
commit5b6cdd95a3769ba897ae845590c7cbff0096e532 (patch)
tree4228eb95fb0b809aee3c12d749c939fb28190b36 /tools/send-enter-keys-test.js
parent3227fa8ca1ef57fff3e2242dc84899482ea9b260 (diff)
downloadcoinosv3-5b6cdd95a3769ba897ae845590c7cbff0096e532.tar.gz
coinosv3-5b6cdd95a3769ba897ae845590c7cbff0096e532.zip
Desktop: the Send amount field takes the cursor as soon as it appears (once; never off another field, never on phones)
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.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/send-enter-keys-test.js b/tools/send-enter-keys-test.js
index dc44ef3..5022c39 100644
--- a/tools/send-enter-keys-test.js
+++ b/tools/send-enter-keys-test.js
@@ -85,6 +85,15 @@ try {
const field = await page.evaluate(() => document.querySelector('textarea.send-dest')?.value ?? document.querySelector('[data-send-pane] h3')?.textContent);
check('Enter picked it: the amount step is up', !!amt, field);
check('no line break went into the field', !/\n/.test(field || ''), JSON.stringify(field));
+ await sleep(300);
+ check('desktop: the amount field has the cursor already', await page.evaluate(() => !matchMedia('(pointer: coarse)').matches && document.activeElement?.matches('[data-send-pane] input[type=number]')),
+ await page.evaluate(() => document.activeElement?.outerHTML.slice(0, 80)));
+ // left alone after that: a re-render (unit toggle) doesn't pull it back
+ await page.evaluate(() => document.activeElement.blur());
+ await page.evaluate(() => document.querySelector('[data-send-pane] button[title]')?.click()); await sleep(300);
+ await page.evaluate(() => document.querySelector('[data-send-pane] button[title]')?.click()); await sleep(300);
+ check('...only once: a later render leaves focus alone', await page.evaluate(() => document.activeElement === document.body),
+ await page.evaluate(() => document.activeElement?.outerHTML.slice(0, 80)));
console.log('[amount: Enter presses the main button]');
await page.focus('[data-send-pane] input[type=number]');