landing-footer.test.mjs
44 lines 2.2 KB
Raw
sha256:b5f647cb9c409f563d4671fe3fc05ddea01fabfed9b41fc11cb923588e1c1baf mirror: GitHub Phase A durable MCP OAuth (#270) Human minor ⚠ breaking 11 days ago
1 import { describe, it } from 'node:test';
2 import assert from 'node:assert';
3 import { readFileSync, existsSync } from 'node:fs';
4 import { fileURLToPath } from 'node:url';
5 import { dirname, join } from 'node:path';
6
7 const root = join(dirname(fileURLToPath(import.meta.url)), '..');
8 const indexHtml = readFileSync(join(root, 'web', 'index.html'), 'utf8');
9 const hubHtml = readFileSync(join(root, 'web', 'hub', 'index.html'), 'utf8');
10
11 describe('landing footer and favicon', () => {
12 it('links Discord community invite above tagline', () => {
13 const discordIdx = indexHtml.indexOf('https://discord.gg/NrtzhZtrED');
14 const taglineIdx = indexHtml.indexOf('Your notes, your data, your context.');
15 assert.ok(discordIdx !== -1 && taglineIdx !== -1 && discordIdx < taglineIdx);
16 assert.match(indexHtml, /<strong>Join the community<\/strong>/);
17 assert.match(indexHtml, /class="footer-discord-link"/);
18 });
19
20 it('uses PNG favicon on landing and hub', () => {
21 assert.ok(indexHtml.includes('href="/assets/favicon.png"'));
22 assert.ok(hubHtml.includes('href="/assets/favicon.png"'));
23 assert.ok(existsSync(join(root, 'web', 'assets', 'favicon.png')));
24 });
25
26 it('includes YouTube and X footer icons before tagline', () => {
27 const yt = indexHtml.indexOf('https://www.youtube.com/@Knowtation');
28 const x = indexHtml.indexOf('https://x.com/Knowtation1111');
29 const taglineIdx = indexHtml.indexOf('Your notes, your data, your context.');
30 assert.ok(yt !== -1 && yt < taglineIdx);
31 assert.ok(x !== -1 && x < taglineIdx);
32 assert.match(indexHtml, /class="footer-social-icons"/);
33 });
34
35 it('places Discord, YouTube, and X beside the theme toggle in the header', () => {
36 assert.match(indexHtml, /class="landing-header-start"/);
37 assert.match(indexHtml, /class="landing-header-social"/);
38 const start = indexHtml.indexOf('class="landing-header-start"');
39 const themeBtn = indexHtml.indexOf('id="theme-toggle"');
40 const social = indexHtml.indexOf('class="landing-header-social"');
41 assert.ok(start !== -1 && themeBtn > start && social > themeBtn);
42 assert.ok(indexHtml.includes('aria-label="Knowtation on YouTube"', indexHtml.indexOf('landing-header-social')));
43 });
44 });
File History 4 commits
sha256:b5f647cb9c409f563d4671fe3fc05ddea01fabfed9b41fc11cb923588e1c1baf mirror: GitHub Phase A durable MCP OAuth (#270) Human minor 11 days ago
sha256:d8c648b20a4d53b2673c5c082ee7edfa7b2fc9b11080832da1f38807b6bf940b fix(7C-L1b): route hosted delegation proposals through cani… Human minor 30 days ago
sha256:2827ba9e7632a4b141c50caf1e8f7d77abbc3515be20e7465f2bccb0ac4edf91 fix: repair endpoint now sets has_active_subscription when … Human minor 50 days ago