aboutsummaryrefslogtreecommitdiffstats
path: root/tools/feed-nav-destination-test.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-01 06:49:19 -0700
committerAdam Soltys <[email protected]>2026-10-01 06:49:19 -0700
commit68ff290e07c0e1786cf8b8f3a87e38872ad7f8ba (patch)
treec85847c8f4a06b0a6b7dab8abb2d2eb54fefa226 /tools/feed-nav-destination-test.js
parent4b3291fdbd0b34b4d2df91a59bea93885de29508 (diff)
parent5ff909d37fe32ba04a841941593d95c7b3498ec3 (diff)
downloadcoinosv3-68ff290e07c0e1786cf8b8f3a87e38872ad7f8ba.tar.gz
coinosv3-68ff290e07c0e1786cf8b8f3a87e38872ad7f8ba.zip
Merge prod into master
Diffstat (limited to 'tools/feed-nav-destination-test.js')
-rw-r--r--tools/feed-nav-destination-test.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/feed-nav-destination-test.js b/tools/feed-nav-destination-test.js
new file mode 100644
index 0000000..b14a124
--- /dev/null
+++ b/tools/feed-nav-destination-test.js
@@ -0,0 +1,18 @@
+// The Feed destination and the new-posts pill deliberately have different
+// navigation semantics. Keep this small source-level guard beside the fuller
+// browser test for the pill's landing position.
+import assert from 'node:assert/strict';
+
+const source = await Bun.file('src/features/messages.js').text();
+const navStart = source.indexOf("button('feed', t('feedTitle')");
+const navEnd = source.indexOf("button('messages',", navStart);
+const feedButton = source.slice(navStart, navEnd);
+assert(navStart > 0 && navEnd > navStart, 'Feed bottom-nav handler exists');
+assert(feedButton.includes('glideToTop()'), 'Feed bottom-nav button returns to the top');
+assert(!feedButton.includes('jumpToNew()'), 'Feed bottom-nav button does not jump to unread posts');
+
+const pillStart = source.indexOf("class: 'feed-new-pill'");
+const pill = source.slice(pillStart, source.indexOf('})', pillStart) + 2);
+assert(pillStart > 0 && pill.includes('jumpToNew()'), 'new-posts pill jumps to the first unread arrival');
+
+console.log('✓ Feed tab goes to the top; only the new-posts pill jumps to unread posts');