aboutsummaryrefslogtreecommitdiffstats
path: root/tools/composer-media-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/composer-media-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/composer-media-test.js')
-rw-r--r--tools/composer-media-test.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/composer-media-test.js b/tools/composer-media-test.js
index 9b2b41c..6f30995 100644
--- a/tools/composer-media-test.js
+++ b/tools/composer-media-test.js
@@ -17,16 +17,19 @@ const browser = await puppeteer.launch({ executablePath: '/usr/bin/google-chrome
const page = await browser.newPage();
const uploads = [];
await page.setRequestInterception(true);
+// every public media host the upload may try first (nothing leaves the machine)
+const HOSTS = /blossom\.ditto\.pub|blossom\.primal\.net|nostr\.download|nostr\.build/;
page.on('request', (req) => {
const u = req.url();
- if (/nostr\.download|nostr\.build/.test(u) && req.method() === 'PUT') {
+ if (HOSTS.test(u) && req.method() === 'PUT') {
uploads.push(u);
return req.respond({ status: 200, contentType: 'application/json', headers: { 'access-control-allow-origin': '*' },
body: JSON.stringify({ url: 'https://nostr.download/' + 'f'.repeat(64) + '.gif', sha256: 'f'.repeat(64), size: 10, type: 'image/gif' }) });
}
- if (/nostr\.download|nostr\.build/.test(u) && req.method() === 'OPTIONS') {
+ if (HOSTS.test(u) && req.method() === 'OPTIONS') {
return req.respond({ status: 204, headers: { 'access-control-allow-origin': '*', 'access-control-allow-methods': 'PUT, HEAD, GET', 'access-control-allow-headers': '*' } });
}
+ if (HOSTS.test(u) && req.method() === 'HEAD') return req.respond({ status: 200, headers: { 'access-control-allow-origin': '*' } });
req.continue();
});
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);
@@ -50,10 +53,11 @@ try {
localStorage.setItem(k + ':follows', JSON.stringify({ tags: [['p', a]], c: '', at: now }));
localStorage.setItem(k + ':feedNotes', JSON.stringify([{ id: 'c'.repeat(64), pubkey: a, kind: 1, created_at: now, content: 'a post to answer', tags: [] }]));
localStorage.setItem(k + ':profiles', JSON.stringify({ [a]: { name: 'Poster', t: Date.now() } }));
+ localStorage.setItem('btc-wallet-feed:' + k, 'following'); // new wallets open on Popular
}, [base, A]);
await page.reload({ waitUntil: 'domcontentloaded' });
await waitText('receive', 20000);
- await page.evaluate(() => document.querySelector('.app-bottom-nav .app-nav-button').click());
+ await page.evaluate(() => document.querySelector('.app-nav-button[aria-label="Feed"]').click());
await waitText('a post to answer', 20000);
await page.evaluate(() => [...document.querySelectorAll('.notes-feed [data-key]')].find((n) => n.innerText.includes('a post to answer')).querySelector('button[aria-label="Reply"]').click());
check('the reply box appears', await waitFor(() => !!document.querySelector('.thread-reply-input'), 10000));