import { readFileSync } from 'node:fs'; import { resolve } from 'node:path'; const sourcePath = resolve( __dirname, '../../frontend/src/app/features/challenges/challenge-card.component.ts', ); const templatePath = resolve( __dirname, '../../frontend/src/app/features/challenges/challenge-card.component.ts', ); const source = readFileSync(sourcePath, 'utf8'); describe('ChallengeCardComponent — per-card solved accessibility contract', () => { function extractTemplate(src: string): string { const match = src.match(/template:\s*`([\s\S]*?)`,?\s*\n\s*\}/); return match ? match[1] : ''; } const template = extractTemplate(source); it('wraps the card in a native