fix: convert antfarm from broken submodule to regular directory
Fixes Gitea 500 error caused by invalid submodule reference. Converted antfarm from pseudo-submodule (missing .gitmodules) to regular directory with all source files. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
48
antfarm/landing/__tests__/landing.test.js
Normal file
48
antfarm/landing/__tests__/landing.test.js
Normal file
@@ -0,0 +1,48 @@
|
||||
import { readFileSync, existsSync } from 'fs';
|
||||
import { resolve, dirname } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { describe, it } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const landingDir = resolve(__dirname, '..');
|
||||
|
||||
describe('Landing page', () => {
|
||||
it('index.html exists', () => {
|
||||
assert.ok(existsSync(resolve(landingDir, 'index.html')));
|
||||
});
|
||||
|
||||
it('style.css exists', () => {
|
||||
assert.ok(existsSync(resolve(landingDir, 'style.css')));
|
||||
});
|
||||
|
||||
it('index.html contains required sections', () => {
|
||||
const html = readFileSync(resolve(landingDir, 'index.html'), 'utf-8');
|
||||
assert.ok(html.includes('id="features"'), 'missing features section');
|
||||
assert.ok(html.includes('id="quickstart"'), 'missing quickstart section');
|
||||
assert.ok(html.includes('id="commands"'), 'missing commands section');
|
||||
assert.ok(html.includes('<title>'), 'missing title');
|
||||
assert.ok(html.includes('meta name="viewport"'), 'missing viewport meta');
|
||||
assert.ok(html.includes('meta name="description"'), 'missing description meta');
|
||||
});
|
||||
|
||||
it('index.html references style.css', () => {
|
||||
const html = readFileSync(resolve(landingDir, 'index.html'), 'utf-8');
|
||||
assert.ok(html.includes('style.css'));
|
||||
});
|
||||
|
||||
it('style.css contains essential rules', () => {
|
||||
const css = readFileSync(resolve(landingDir, 'style.css'), 'utf-8');
|
||||
assert.ok(css.includes('.hero'), 'missing hero styles');
|
||||
assert.ok(css.includes('.feature-grid'), 'missing feature grid');
|
||||
assert.ok(css.includes('@media'), 'missing responsive styles');
|
||||
});
|
||||
|
||||
it('all internal links have valid targets', () => {
|
||||
const html = readFileSync(resolve(landingDir, 'index.html'), 'utf-8');
|
||||
const anchors = [...html.matchAll(/href="#([^"]+)"/g)].map(m => m[1]);
|
||||
for (const id of anchors) {
|
||||
assert.ok(html.includes(`id="${id}"`), `missing target for #${id}`);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user