All files / vqa/generators bundle-summary.template.ts

100% Statements 77/77
88% Branches 22/25
100% Functions 1/1
100% Lines 77/77

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 781x 1x 1x 1x 1x 1x 1x 1x 1x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 25x 25x 39x 39x 39x 39x 25x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 1x 1x 1x 18x 18x 18x 1x 1x 1x 18x 18x 18x 18x 18x 18x 18x 1x  
import { DyE2E_VQA_FeatureManifest_Interface } from '../_models/interfaces/feature-manifest.interface';
 
/**
 * `DyE2E_VQA_BundleSummary_Template` — `summary.md` rendering a feature-state-viewport
 * táblával, amit mind ember, mind AI agent áttekint.
 */
export class DyE2E_VQA_BundleSummary_Template {
 
  static render(
    manifest: DyE2E_VQA_FeatureManifest_Interface,
    runId: string,
  ): string {
    const orientations: ('portrait' | 'landscape')[] =
      manifest.orientations && manifest.orientations.length > 0
        ? manifest.orientations
        : ['portrait'];
 
    const matrixHeader: string = ['State / Viewport',
      ...manifest.viewports.flatMap((v) => orientations.map((o) => `${v.key} / ${o}`)),
    ].join(' | ');
    const matrixSep: string = ['---',
      ...manifest.viewports.flatMap(() => orientations.map(() => '---')),
    ].join(' | ');
    const matrixRows: string[] = manifest.states.map((s) => {
      const row: string[] = [`\`${s.stateId}\``];
      for (const _v of manifest.viewports) {
        for (const _o of orientations) {
          row.push('✓');
        }
      }
      return row.join(' | ');
    });
 
    return `# Review-bundle summary — \`${manifest.featureName}\`
 
- **featureId:** \`${manifest.featureId}\`
- **runId:** \`${runId}\`
- **route:** \`${manifest.route}\`
- **userRole:** ${manifest.userRole ? `\`${manifest.userRole}\`` : '*nincs*'}
- **states:** ${manifest.states.length}
- **viewports:** ${manifest.viewports.length} (\`${manifest.viewports.map((v) => v.key).join(', ')}\`)
- **orientations:** \`${orientations.join(', ')}\`
- **criticalElements:** ${manifest.criticalElements.length}
 
${manifest.description ? `\n## Leírás\n\n${manifest.description}\n` : ''}
 
## State × Viewport mátrix
 
A ✓ jelzi: a (state × viewport × orientation) capture-elve, screenshot + DOM-snapshot
+ evidence + a11y a megfelelő mappákban.
 
| ${matrixHeader} |
| ${matrixSep} |
${matrixRows.map((r) => `| ${r} |`).join('\n')}
 
## Critical-element-ek
 
${manifest.criticalElements.map((c) => `- **${c.key}** (\`${c.regionType}\`): \`${c.selector}\`${c.label ? ` — ${c.label}` : ''}`).join('\n')}
 
${manifest.expectedFeedback && manifest.expectedFeedback.length > 0 ? `
## Várt visszajelzések (AI-hint)
 
${manifest.expectedFeedback.map((ef) => `- **${ef.stateId}** / \`${ef.feedbackType}\`: ${ef.expectation}`).join('\n')}
` : ''}
 
${manifest.contextNotes && manifest.contextNotes.length > 0 ? `
## Kontextus
 
${manifest.contextNotes.map((n) => `- ${n}`).join('\n')}
` : ''}
 
---
 
*A részletes review-instrukció az \`README.md\`-ben.*
`;
  }
}