feat: add hero section and service cards to the hub page
CVE Watch card resolves its href per-locale (cve-en/cve-fr), Convert resolves to the same URL on both locales.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { describe, it, expect, beforeAll } from 'vitest';
|
||||
import { execSync } from 'node:child_process';
|
||||
import { readFileSync } from 'node:fs';
|
||||
|
||||
describe('hero and service cards', () => {
|
||||
let en: string;
|
||||
let fr: string;
|
||||
|
||||
beforeAll(() => {
|
||||
execSync('npm run build', { stdio: 'inherit' });
|
||||
en = readFileSync('dist/en/index.html', 'utf-8');
|
||||
fr = readFileSync('dist/fr/index.html', 'utf-8');
|
||||
});
|
||||
|
||||
it('renders the localized hero copy', () => {
|
||||
expect(en).toContain('The Ombrora hub');
|
||||
expect(fr).toContain('Le hub des outils Ombrora');
|
||||
});
|
||||
|
||||
it('renders the CVE Watch card with a locale-specific link', () => {
|
||||
expect(en).toContain('href="https://cve-en.ombrora.com"');
|
||||
expect(fr).toContain('href="https://cve-fr.ombrora.com"');
|
||||
expect(en).toContain('CVE Watch');
|
||||
expect(fr).toContain('Veille CVE');
|
||||
});
|
||||
|
||||
it('renders the Convert card with the same link on both locales', () => {
|
||||
const enMatches = en.match(/href="https:\/\/convert\.ombrora\.com"/g) ?? [];
|
||||
const frMatches = fr.match(/href="https:\/\/convert\.ombrora\.com"/g) ?? [];
|
||||
expect(enMatches.length).toBeGreaterThan(0);
|
||||
expect(frMatches.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user