aboutsummaryrefslogtreecommitdiffstats
path: root/tools/profile-recovery-test.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-07 08:10:17 -0700
committerAdam Soltys <[email protected]>2026-10-07 08:10:17 -0700
commit9a49107afe8cf7104ea7da1638e680518fa55bb8 (patch)
tree06496c82058d751eedfaa2d3d182a1aa417dcd40 /tools/profile-recovery-test.js
parent78cf670939133fc4f656f0f42b21a59431a53842 (diff)
downloadcoinosv3-9a49107afe8cf7104ea7da1638e680518fa55bb8.tar.gz
coinosv3-9a49107afe8cf7104ea7da1638e680518fa55bb8.zip
Profile tests: reach the feed and chats through the bottom nav, start on Following, follow today's onboarding
- avatar-profile, profile-open: a new wallet opens the feed on Popular, so seed this wallet's last feed as Following; profile-open opens Feed from the nav - profile-feed: a mainnet import offers a username first (Not now), Messages is a bottom-nav button - profile-draft, profile-recovery: the import button reads 'Have an existing seed or entropy to import?'; profile batches stream through queryStreamOn, so the recovery test answers that too Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'tools/profile-recovery-test.js')
-rw-r--r--tools/profile-recovery-test.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/profile-recovery-test.js b/tools/profile-recovery-test.js
index b2c871a..2f6ae90 100644
--- a/tools/profile-recovery-test.js
+++ b/tools/profile-recovery-test.js
@@ -46,7 +46,9 @@ const bundle = await Bun.build({ entrypoints: ['profile-test-entry'], target: 'b
build.onLoad({ filter: /src\/features\/messages\.js$/ }, async ({ path }) => ({ contents: (await Bun.file(path).text())
.replace("id: 'messages',", "id: 'messages', testFetch: fetchFullProfile, testView: profileScreen, testApply: applyProfile, testLight: (pk) => profiles.get(pk), testFull: (pk) => fullProfiles.get(pk),"), loader: 'js' }));
build.onLoad({ filter: /src\/nostr\.js$/ }, async ({ path }) => ({ contents: (await Bun.file(path).text())
- .replace('export async function queryOn(relays, filter, maxWait = 1500) {', 'export async function queryOn(relays, filter, maxWait = 1500) { if (globalThis.__profileQuery) return globalThis.__profileQuery(relays, filter);'), loader: 'js' }));
+ .replace('export async function queryOn(relays, filter, maxWait = 1500) {', 'export async function queryOn(relays, filter, maxWait = 1500) { if (globalThis.__profileQuery) return globalThis.__profileQuery(relays, filter);')
+ // profile batches stream each answer as it lands (our relays and the indexes at once)
+ .replace('export async function queryStreamOn(relays, filter, onEvent, maxWait = 1500) {', 'export async function queryStreamOn(relays, filter, onEvent, maxWait = 1500) { if (globalThis.__profileQuery) { const evs = await globalThis.__profileQuery(relays, filter); for (const ev of evs || []) onEvent(ev); return; }'), loader: 'js' }));
} }] });
assert(bundle.success, bundle.logs.join('\n'));
const css = await Bun.file('src/style.css').text();