aboutsummaryrefslogtreecommitdiffstats
path: root/tools/feed-custom-test.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-09-20 23:23:13 -0700
committerAdam Soltys <[email protected]>2026-09-20 23:23:13 -0700
commite27eaccee624d9bbc84ce4443d7cfba2db4fa15d (patch)
tree49077a2c8d02057b69601345270540068824114f /tools/feed-custom-test.js
parent501da85c85e014eb48e6cd7df246875fadf27cb3 (diff)
downloadcoinosv3-e27eaccee624d9bbc84ce4443d7cfba2db4fa15d.tar.gz
coinosv3-e27eaccee624d9bbc84ce4443d7cfba2db4fa15d.zip
Feeds: a following.space link is read before any naddr in the pasted text; the test clears its field between searches.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Diffstat (limited to 'tools/feed-custom-test.js')
-rw-r--r--tools/feed-custom-test.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/feed-custom-test.js b/tools/feed-custom-test.js
index 0fc7ab8..af2401f 100644
--- a/tools/feed-custom-test.js
+++ b/tools/feed-custom-test.js
@@ -74,7 +74,10 @@ page.on('pageerror', (e) => errs.push(String(e)));
const click = (t) => page.evaluate((x) => { const e = [...document.querySelectorAll('button')].find((n) => n.textContent.trim().toLowerCase().includes(x)); if (e) { e.click(); return true; } return false; }, t);
const waitText = async (x, ms = 25000) => { for (let i = 0; i < ms / 250; i++) { if ((await page.evaluate(() => document.body.innerText)).toLowerCase().includes(x)) return true; await sleep(250); } return false; };
const chips = () => page.evaluate(() => [...document.querySelectorAll('.feed-chip')].map((c) => (c.classList.contains('on') ? '*' : '') + c.textContent.trim()));
-const type = async (sel, text) => { await page.click(sel, { clickCount: 3 }); await page.type(sel, text); };
+const type = async (sel, text) => {
+ await page.evaluate((q) => { const i = document.querySelector(q); i.value = ''; i.dispatchEvent(new Event('input', { bubbles: true })); }, sel);
+ await page.click(sel); await page.type(sel, text);
+};
try {
await page.setViewport({ width: 390, height: 844 });