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:
@@ -114,9 +114,9 @@ test.describe('Login Flow', () => {
|
||||
await expect(page.locator('#email-error')).toBeVisible();
|
||||
await expect(page.locator('#password-error')).toBeVisible();
|
||||
|
||||
// Verify error messages
|
||||
await expect(page.locator('#email-error')).toContainText('Email is required');
|
||||
await expect(page.locator('#password-error')).toContainText('Password');
|
||||
// Verify error messages (generic i18n validation messages)
|
||||
await expect(page.locator('#email-error')).toContainText('This field is required');
|
||||
await expect(page.locator('#password-error')).toContainText('This field is required');
|
||||
});
|
||||
|
||||
test('should show validation error for invalid email', async ({ page }) => {
|
||||
@@ -142,7 +142,7 @@ test.describe('Login Flow', () => {
|
||||
|
||||
// Without backend, we just verify form is still functional (doesn't crash)
|
||||
// Should still be on login page
|
||||
await expect(page).toHaveURL(/\/login/);
|
||||
await expect(page).toHaveURL(/\/en\/login/);
|
||||
});
|
||||
|
||||
test('should successfully login with valid credentials', async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user