diff options
Diffstat (limited to 'tools/mention-ac-test.js')
| -rw-r--r-- | tools/mention-ac-test.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/mention-ac-test.js b/tools/mention-ac-test.js index e476e61..04d7e12 100644 --- a/tools/mention-ac-test.js +++ b/tools/mention-ac-test.js @@ -106,11 +106,16 @@ try { await sleep(300); check('...and on a second line, in place', /\ncc nostr:npub1[a-z0-9]+ $/.test(await value()) && !(await value()).includes('@glo'), JSON.stringify((await value()).slice(-90))); + // a name typed out in full and never picked from the list + await page.keyboard.type('ty @globetrotter and @nobody9 ok'); + await sleep(300); + console.log('\n[posting]'); await page.evaluate(() => { window.__published = []; [...document.querySelectorAll('.post-actions button')].find((b) => /^post$/i.test(b.textContent.trim())).click(); }); await waitFor(() => window.__published.some((e) => e.kind === 1), 8000); const ev = (await page.evaluate(() => window.__published)).find((e) => e.kind === 1); check('the post carries both p tags', !!ev && [FRIEND, STRANGER].every((pk) => ev.tags.some((x) => x[0] === 'p' && x[1] === pk)), JSON.stringify(ev && ev.tags)); + check('a followed name typed out, not picked, goes out as their npub', !!ev && ev.content.endsWith('ty nostr:' + npubEncode(FRIEND) + ' and @nobody9 ok'), JSON.stringify(ev && ev.content.slice(-110))); check('no page errors', errs.length === 0, errs.slice(0, 2).join(' | ')); } finally { await browser.close(); server.stop(true); } console.log(ok ? '\nā
@mentions suggest people and tag them' : '\nā failed'); |
