diff --git a/src/placeholder.test.ts b/src/placeholder.test.ts new file mode 100644 index 0000000..2fdcbdc --- /dev/null +++ b/src/placeholder.test.ts @@ -0,0 +1,72 @@ +import { describe, it, expect } from 'vitest'; +import { existsSync, readFileSync } from 'node:fs'; +import { join } from 'node:path'; + +const placeholderDir = join(process.cwd(), 'placeholder'); +const indexPath = join(placeholderDir, 'index.html'); + +describe('placeholder/index.html', () => { + const html = readFileSync(indexPath, 'utf8'); + + it('starts with the HTML5 doctype', () => { + expect(html.toLowerCase().trimStart()).toMatch(/^/); + }); + + it('has the back-shortly title', () => { + expect(html).toContain('Cameleer — Back shortly'); + }); + + it('is not indexable by search engines', () => { + expect(html).toContain(''); + }); + + it('declares the dark color-scheme matching the live site', () => { + expect(html).toContain(''); + expect(html).toContain(''); + }); + + it('contains the sentinel string the deploy workflow greps for', () => { + // The workflow's post-deploy smoke test fails if this string is missing. + expect(html).toContain('Routes are remapping'); + }); + + it('uses the live hero subhead verbatim', () => { + expect(html).toContain( + 'Cameleer is the hosted runtime and observability platform for Apache Camel — auto-traced, replay-ready, cross-service correlated. The 3 AM page becomes a 30-second answer.' + ); + }); + + it('contains __SALES_EMAIL__ tokens at both the mailto href and the link text', () => { + const matches = html.match(/__SALES_EMAIL__/g) ?? []; + expect(matches.length).toBeGreaterThanOrEqual(2); + }); + + it('contains no other __TOKEN__ style placeholders', () => { + // Guard against a forgotten token that would survive the sed substitution. + const allTokens = html.match(/__[A-Z][A-Z0-9_]+__/g) ?? []; + const nonSales = allTokens.filter((t) => t !== '__SALES_EMAIL__'); + expect(nonSales).toEqual([]); + }); + + it('references the sibling cameleer-logo.png by relative path', () => { + expect(html).toContain('src="./cameleer-logo.png"'); + }); + + it('references the sibling favicon.png by relative path', () => { + expect(html).toContain('href="./favicon.png"'); + }); + + it('has no