aboutsummaryrefslogtreecommitdiffstats
path: root/tools/compose-preview-test.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-07 08:27:40 -0700
committerAdam Soltys <[email protected]>2026-10-07 08:27:40 -0700
commitdfb017c1b10cb52c24f4f0bcf745c6abea11b98f (patch)
treeb8150ed4805f206947e2475fe433be953c46fb70 /tools/compose-preview-test.js
parentb70e169bb5b5beccb89fd59427726e32d414b4a5 (diff)
downloadcoinosv3-dfb017c1b10cb52c24f4f0bcf745c6abea11b98f.tar.gz
coinosv3-dfb017c1b10cb52c24f4f0bcf745c6abea11b98f.zip
Feed, composer and zap tests follow today's app
- feed tests reach the Feed from the bottom nav (the chat-home row is gone) and seed this wallet's last feed as Following (new wallets open on Popular, c89050e) plus the author's profile (readiness gate) - post-actions: its picture is made locally (it read another session's scratchpad), the post's own ⋯ (not the feed header's), a real tap on the DM picture (a tap beside a fitted picture is a tap on the post) - composer-media / video-compress: intercept every public media host (ditto is first now; the tests were uploading for real) - compose-preview: Preview is one toggle button (aria-pressed) - thread-reply: harness has a wallet (else visitor: Reply asks to sign in), registers <coinos-text>, holds the root's id-only query; atomic send tap - video-unmute: stubs what videoNode reaches outside its slice; preload none means the in-view clip is told to load - zap-deep-profile: zap button scrolled to mid-screen (the bottom nav covered it) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'tools/compose-preview-test.js')
-rw-r--r--tools/compose-preview-test.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/compose-preview-test.js b/tools/compose-preview-test.js
index 2138ea6..c943655 100644
--- a/tools/compose-preview-test.js
+++ b/tools/compose-preview-test.js
@@ -53,6 +53,8 @@ try {
await page.evaluate(([k, n]) => {
localStorage.setItem(k + ':follows', JSON.stringify({ tags: [['p', n.pubkey]], c: '', at: Math.floor(Date.now() / 1000) }));
localStorage.setItem(k + ':feedNotes', JSON.stringify([n]));
+ localStorage.setItem(k + ':profiles', JSON.stringify({ [n.pubkey]: { name: 'fiatjaf', t: Date.now() } }));
+ localStorage.setItem('btc-wallet-feed:' + k, 'following'); // new wallets open on Popular
}, [base, {
id: 'f'.repeat(63) + '1', pubkey: '3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d',
kind: 1, created_at: Math.floor(Date.now() / 1000) - 60, content: 'a post to answer', tags: [],
@@ -61,10 +63,8 @@ try {
await waitText('receive', 20000);
// into the feed, where posts are written
- await page.evaluate(() => { const b = [...document.querySelectorAll('button')].find((e) => /message/i.test(e.getAttribute('aria-label') || '')); if (b) b.click(); });
- await sleep(1000);
- await page.evaluate(() => { const e = [...document.querySelectorAll('.item')].find((n) => /feed/i.test(n.textContent)); if (e) e.click(); });
- await sleep(2500);
+ await page.evaluate(() => document.querySelector('.app-nav-button[aria-label="Feed"]').click());
+ for (let i = 0; i < 60 && !(await page.$('.notes-feed:not([data-booting]) > .row')); i++) await sleep(250);
const opened = await page.evaluate(() => { const b = [...document.querySelectorAll('button')].find((n) => (n.getAttribute('aria-label') || n.textContent).trim().toLowerCase() === 'new post'); if (b) { b.click(); return true; } return false; });
check('the composer opens', opened && !!(await page.$('coinos-text')));
@@ -98,8 +98,9 @@ try {
/plus a word/.test(await page.evaluate(() => (document.querySelector('.draft-preview') || {}).innerText || '')));
// and it puts itself away
+ // (the same Preview button, pressed: a toggle)
await page.evaluate(() => [...document.querySelectorAll('button')]
- .find((b) => /hide preview/i.test(b.getAttribute('aria-label') || ''))?.click());
+ .find((b) => /preview/i.test(b.getAttribute('aria-label') || '') && b.getAttribute('aria-pressed') === 'true')?.click());
await sleep(500);
check('and it closes again', !(await page.$('.draft-preview')));