import { describe, it, expect } from 'vitest'; import fs from 'fs'; import path from 'path'; describe('Team Images and Team Page Content', () => { const publicTeamPhotosDir = path.join(process.cwd(), 'public', 'assets', 'photos', 'team'); const publicPhotosDir = path.join(process.cwd(), 'public', 'assets', 'photos'); const deTeamPath = path.join(process.cwd(), 'content', 'de', 'team.mdx'); const enTeamPath = path.join(process.cwd(), 'content', 'en', 'team.mdx'); it('should verify all required team photos exist in public/assets/photos/team/', () => { const requiredMemberImages = [ 'danny.jpg', 'dirk.jpg', 'kathrin.jpg', 'katrin-heigold.jpg', 'maik.jpg', 'martin.jpg', 'oliver.jpg', 'sven.jpg', ]; for (const imgName of requiredMemberImages) { const imgPath = path.join(publicTeamPhotosDir, imgName); expect(fs.existsSync(imgPath), `Expected image ${imgName} to exist`).toBe(true); } }); it('should verify team group photo exists in public/assets/photos/', () => { const groupPhotoPath = path.join(publicPhotosDir, 'E-TIB_Gruppenfoto.jpg'); expect(fs.existsSync(groupPhotoPath), 'Expected E-TIB_Gruppenfoto.jpg to exist').toBe(true); }); it('should verify DE and EN team.mdx use E-TIB_Gruppenfoto.jpg in HeroSection', () => { const deContent = fs.readFileSync(deTeamPath, 'utf8'); const enContent = fs.readFileSync(enTeamPath, 'utf8'); expect(deContent).toContain("url: '/assets/photos/E-TIB_Gruppenfoto.jpg'"); expect(enContent).toContain("url: '/assets/photos/E-TIB_Gruppenfoto.jpg'"); }); it('should verify Frau Joseph (Kerstin Joseph) has no image property in team.mdx', () => { const deContent = fs.readFileSync(deTeamPath, 'utf8'); const enContent = fs.readFileSync(enTeamPath, 'utf8'); // Parse kerstin-joseph block and ensure no image line exists for kerstin-joseph const deKerstinBlock = deContent.match(/id:\s*"kerstin-joseph"[\s\S]*?\}/)?.[0] || ''; const enKerstinBlock = enContent.match(/id:\s*"kerstin-joseph"[\s\S]*?\}/)?.[0] || ''; expect(deKerstinBlock).not.toContain('image:'); expect(enKerstinBlock).not.toContain('image:'); }); it('should verify Katrin Heigold has image set in team.mdx', () => { const deContent = fs.readFileSync(deTeamPath, 'utf8'); const enContent = fs.readFileSync(enTeamPath, 'utf8'); expect(deContent).toContain('/assets/photos/team/katrin-heigold.jpg'); expect(enContent).toContain('/assets/photos/team/katrin-heigold.jpg'); }); });