fix(locale): align all English MDX page links and add automated links validation test to prevent language drift
All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 18s
Build & Deploy / 🧪 QA (push) Successful in 1m6s
Build & Deploy / 🏗️ Build (push) Successful in 2m44s
Build & Deploy / 🚀 Deploy (push) Successful in 28s
Build & Deploy / 🧪 Post-Deploy Verification (push) Successful in 43s
Build & Deploy / 🔔 Notify (push) Successful in 1s
All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 18s
Build & Deploy / 🧪 QA (push) Successful in 1m6s
Build & Deploy / 🏗️ Build (push) Successful in 2m44s
Build & Deploy / 🚀 Deploy (push) Successful in 28s
Build & Deploy / 🧪 Post-Deploy Verification (push) Successful in 43s
Build & Deploy / 🔔 Notify (push) Successful in 1s
This commit is contained in:
26
tests/mdx-links.test.ts
Normal file
26
tests/mdx-links.test.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
describe('English MDX Content Links', () => {
|
||||
it('should not contain German slug routes like /en/kontakt or /en/karriere', () => {
|
||||
const enContentDir = path.join(process.cwd(), 'content', 'en');
|
||||
const files = fs.readdirSync(enContentDir).filter(f => f.endsWith('.mdx'));
|
||||
|
||||
const forbiddenLinks = ['/en/kontakt', '/en/karriere'];
|
||||
const infractions: string[] = [];
|
||||
|
||||
files.forEach(file => {
|
||||
const filePath = path.join(enContentDir, file);
|
||||
const content = fs.readFileSync(filePath, 'utf8');
|
||||
|
||||
forbiddenLinks.forEach(link => {
|
||||
if (content.includes(link)) {
|
||||
infractions.push(`${file} contains forbidden link "${link}"`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
expect(infractions).toEqual([]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user