Refactor i18n integration and update tests for improved localization
- Updated test components (`PasswordResetConfirmForm`, `PasswordChangeForm`) to use i18n keys directly, ensuring accurate validation messages. - Refined translations in `it.json` to standardize format and content. - Replaced text-based labels with localized strings in `PasswordResetRequestForm` and `RegisterForm`. - Introduced `generateLocalizedMetadata` utility and updated layout metadata generation for locale-aware SEO. - Enhanced e2e tests with locale-prefixed routes and updated assertions for consistency. - Added comprehensive i18n documentation (`I18N.md`) for usage, architecture, and testing.
This commit is contained in:
@@ -25,7 +25,7 @@ test.describe('Password Reset Request Flow', () => {
|
||||
|
||||
// Should stay on password reset page (validation failed)
|
||||
// URL might have query params, so use regex
|
||||
await expect(page).toHaveURL(/\/password-reset/);
|
||||
await expect(page).toHaveURL(/\/en\/password-reset/);
|
||||
});
|
||||
|
||||
test('should show validation error for invalid email', async ({ page }) => {
|
||||
@@ -115,7 +115,7 @@ test.describe('Password Reset Confirm Flow', () => {
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
// Should stay on password reset confirm page (validation failed)
|
||||
await expect(page).toHaveURL(/\/password-reset\/confirm/);
|
||||
await expect(page).toHaveURL(/\/en\/password-reset\/confirm/);
|
||||
});
|
||||
|
||||
test('should show validation error for weak password', async ({ page }) => {
|
||||
@@ -131,7 +131,7 @@ test.describe('Password Reset Confirm Flow', () => {
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
// Should stay on password reset confirm page (validation failed)
|
||||
await expect(page).toHaveURL(/\/password-reset\/confirm/);
|
||||
await expect(page).toHaveURL(/\/en\/password-reset\/confirm/);
|
||||
});
|
||||
|
||||
test('should show validation error for mismatched passwords', async ({ page }) => {
|
||||
@@ -147,7 +147,7 @@ test.describe('Password Reset Confirm Flow', () => {
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
// Should stay on password reset confirm page (validation failed)
|
||||
await expect(page).toHaveURL(/\/password-reset\/confirm/);
|
||||
await expect(page).toHaveURL(/\/en\/password-reset\/confirm/);
|
||||
});
|
||||
|
||||
test('should show error for invalid token', async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user