Add tests for i18n metadata utilities and improve locale-based metadata generation

- Introduced comprehensive unit tests for `generateLocalizedMetadata` and `generatePageMetadata` utilities.
- Enhanced `siteConfig` validation assertions for structure and localization support.
- Updated metadata generation to handle empty paths, canonical URLs, language alternates, and Open Graph data consistently.
- Annotated server-side middleware with istanbul ignore for coverage clarity.
This commit is contained in:
Felipe Cardoso
2025-11-19 14:23:06 +01:00
parent 7b1bea2966
commit 3ec589293c
3 changed files with 353 additions and 3 deletions

View File

@@ -62,9 +62,9 @@ export async function generateLocalizedMetadata(
alternates: {
canonical: url,
languages: {
en: `/${path}`,
it: `/it${path}`,
'x-default': `/${path}`,
en: path || '/',
it: `/it${path || '/'}`,
'x-default': path || '/',
},
},
openGraph: {