Branchwell

Inkspring / website / tests / static.test.mjs

1import { test } from 'node:test';
2import assert from 'node:assert/strict';
3import { readFileSync, existsSync } from 'node:fs';
4const homepage = () => readFileSync(new URL('../src/Homepage.tsx', import.meta.url), 'utf8');
5test('homepage focuses on text, single-image posts, and post replies with no carousels', () => {
6 const text = homepage();
7 assert.doesNotMatch(text, /carousel/i);
8 assert.match(text, /Paste a post/);
9 assert.doesNotMatch(text.replace(/className="[^"]*"|tweet:|\.tweet|TweetHead|e\.tweet|example\.tweet/g, ''), /tweet/i);
10 assert.match(text, /single-image posts/i);
11 assert.doesNotMatch(text, /bring your own API key|OpenAI|Claude|Codex|Gemini|gpt-image/i);
12 const diagram = readFileSync(new URL('../src/SyncDiagram.tsx', import.meta.url), 'utf8');
13 assert.doesNotMatch(diagram, /\bMCP\b|external agent/i);
14 assert.match(diagram, /Hosted AI is not enabled/);
15});
16test('website contains no authentication, database, waitlist submission, or tracker integration', () => {
17 const text = homepage();
18 assert.doesNotMatch(text, /Turnstile|\/api\/|\/auth\/|supabase|process\.env|fetch\(/i);
19 assert.doesNotMatch(text, /<form|type="email"|Reserve a spot/);
20 const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url)));
21 assert.doesNotMatch(JSON.stringify(pkg.dependencies || {}), /next|supabase|resend|turnstile/);
22});
23test('platform copy presents a native Apple Silicon Mac app with an iPhone and iPad companion, and no Windows or Linux', () => {
24 const text = homepage();
25 assert.match(text, /Apple Silicon/);
26 assert.match(text, /iPhone &amp; iPad/);
27 assert.doesNotMatch(text, /windows|linux/i);
28 for (const file of ['../src/Legal.tsx', '../index.html', '../scripts/seo.mjs']) assert.doesNotMatch(readFileSync(new URL(file, import.meta.url), 'utf8'), /windows|linux/i);
29 assert.match(text, /Inkspring \d+\.\d+\.\d+ is available for Mac/);
30 assert.match(text, /No Inkspring account/);
31});
32test('site says Inkspring is free and links to its public source', () => {
33 const text = homepage();
34 assert.match(text, /Free to use/);
35 assert.match(text, /https:\/\/github\.com\/projectatomai\/inkspring/);
36 assert.match(readFileSync(new URL('../scripts/seo.mjs', import.meta.url), 'utf8'), /Open source/);
37});
38
39test('active product pages advertise only official publishing channels and no public scraping', () => {
40 const files = ['../src/Homepage.tsx', '../src/Socials.tsx', '../src/Help.tsx', '../src/Legal.tsx', '../src/faq.js', '../scripts/seo.mjs', '../public/llms.txt'];
41 const text = files.map(file => readFileSync(new URL(file, import.meta.url), 'utf8')).join('\n');
42 assert.doesNotMatch(text, /apify|scraping|reddit|tiktok|substack|youtube|bearer token/i);
43 assert.match(text, /official APIs/);
44 const social = readFileSync(new URL('../src/Socials.tsx', import.meta.url), 'utf8');
45 assert.deepEqual([...social.matchAll(/\{ id: '([^']+)', name:/g)].map(m => m[1]).sort(), ['instagram','linkedin','x']);
46 assert.match(text, /media hosting/i);
47});