// dispatchers/frontend-dispatcher.ts — A11y, Game, Visual Regression dispatches
import { isGameProject, generateGameTestDefs, generateGameTestContent, } from '../generators/game-tests-generator.js';
import { generateA11yTestDefs, generateA11yTestContent, } from '../generators/a11y-tests-generator.js';
import { isVisualRegressionProject, generateVisualRegressionTestDefs, generateVisualRegressionTestFiles, } from '../generators/visual-regression-generator.js';
export function dispatchFrontend(spec, knowledge, testDir, testFramework, slug, autoGenerate, testExt, unitTests, integrationTests, testFiles) {
    if (spec.target === 'frontend' || spec.target === 'fullstack') {
        const a11yTests = generateA11yTestDefs(spec.title, testDir);
        unitTests.push(...a11yTests);
        testFiles.push({
            path: `${testDir}/a11y/${slug}.a11y.test.${testExt}`,
            framework: testFramework,
            content: generateA11yTestContent(spec.title, testFramework, knowledge.language),
            ready: autoGenerate,
        });
    }
    if (isGameProject(knowledge)) {
        const gameDefs = generateGameTestDefs(spec.title, testDir, knowledge);
        unitTests.push(...gameDefs.filter((d) => d.type === 'unit'));
        integrationTests.push(...gameDefs.filter((d) => d.type === 'integration'));
        testFiles.push({
            path: `${testDir}/unit/game-logic/${slug}.game.test.${testExt}`,
            framework: testFramework,
            content: generateGameTestContent(spec.title, knowledge.framework ?? 'phaser', testFramework),
            ready: autoGenerate,
        });
    }
    if (isVisualRegressionProject(knowledge)) {
        const vrDefs = generateVisualRegressionTestDefs(slug, testDir, testExt);
        unitTests.push(...vrDefs.filter((d) => d.type === 'unit'));
        integrationTests.push(...vrDefs.filter((d) => d.type === 'integration'));
        testFiles.push(...generateVisualRegressionTestFiles({ title: spec.title, slug }, testDir, testFramework, knowledge.language, testExt, autoGenerate));
    }
}
//# sourceMappingURL=frontend-dispatcher.js.map