// tools/generate-tests/generators/hypermedia-generator.ts — SPEC-043
// Generates HTTP+HTML integration test scaffolds for hypermedia/backend-first projects.
// Language-specific generators moved to hypermedia-generator-b.ts for SOLID compliance.
export { getFileExtension, selectTestFramework, generateTestContent, generateHypermediaTestFiles, } from './hypermedia-generator-b.js';
// === Public guard ===
/**
 * Returns true when the project uses a hypermedia framework (htmx, hotwire-turbo).
 */
export function isHypermediaProject(knowledge) {
    const fw = knowledge.hypermediaFramework;
    return fw === 'htmx' || fw === 'hotwire-turbo';
}
// === Test definition generators ===
/**
 * Generate integration test definitions for a hypermedia project spec.
 */
export function generateHypermediaTestDefs(title, testDir) {
    return [
        {
            name: `${title} — HTTP 200 and Content-Type text/html`,
            type: 'integration',
            file: `${testDir}/integration/`,
            description: 'GET endpoint returns 200 with Content-Type: text/html',
            priority: 'critical',
            automatable: true,
        },
        {
            name: `${title} — HTML fragment contains expected elements`,
            type: 'integration',
            file: `${testDir}/integration/`,
            description: 'Response HTML contains the expected elements (DOM assertions)',
            priority: 'critical',
            automatable: true,
        },
        {
            name: `${title} — HX-Request header validation`,
            type: 'integration',
            file: `${testDir}/integration/`,
            description: 'Fragment endpoint validates HX-Request: true header server-side',
            priority: 'high',
            automatable: true,
        },
        {
            name: `${title} — graceful degradation without JavaScript`,
            type: 'integration',
            file: `${testDir}/integration/`,
            description: 'Action is accessible via native HTML form when JS is disabled',
            priority: 'high',
            automatable: true,
        },
    ];
}
//# sourceMappingURL=hypermedia-generator.js.map