Fix date/time formatting to use es-ES locale

- Update all date/time formatting functions to use 'es-ES' locale instead of 'en-US' or 'de-DE'
- Update utility functions in utils/date.ts and utils/exchange.ts
- Update all component files that use date formatting
- Update e2e test helper to match new Spanish date format
- All formatting now uses Spanish locale regardless of selected language as per PR requirements
This commit is contained in:
counterweight 2025-12-26 11:38:17 +01:00
parent d2fc7d8850
commit e35e79e84d
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
19 changed files with 146 additions and 50 deletions

View file

@ -73,9 +73,7 @@ test.describe("Profile - Regular User Access", () => {
test.beforeEach(async ({ context, page }) => {
// Set English language before any navigation
await context.addInitScript(() => {
if (typeof window !== "undefined") {
window.localStorage.setItem("arbret-locale", "en");
}
localStorage.setItem("arbret-locale", "en");
});
await clearAuth(page);
await loginUser(page, REGULAR_USER.email, REGULAR_USER.password);
@ -96,7 +94,8 @@ test.describe("Profile - Regular User Access", () => {
// Test page structure
await expect(page.getByRole("heading", { name: "My Profile" })).toBeVisible();
await expect(page.getByText("Login EmailRead only")).toBeVisible();
// Check for email label with read-only badge (combined in parent element)
await expect(page.getByText("EmailRead only")).toBeVisible();
await expect(page.getByText("Contact Details")).toBeVisible();
await expect(page.getByText(/communication purposes only/i)).toBeVisible();
@ -118,7 +117,10 @@ test.describe("Profile - Regular User Access", () => {
});
test.describe("Profile - Form Behavior", () => {
test.beforeEach(async ({ page }) => {
test.beforeEach(async ({ context, page }) => {
await context.addInitScript(() => {
window.localStorage.setItem("arbret-locale", "en");
});
await clearAuth(page);
await loginUser(page, REGULAR_USER.email, REGULAR_USER.password);
// Clear any existing profile data
@ -177,7 +179,10 @@ test.describe("Profile - Form Behavior", () => {
});
test.describe("Profile - Validation", () => {
test.beforeEach(async ({ page }) => {
test.beforeEach(async ({ context, page }) => {
await context.addInitScript(() => {
window.localStorage.setItem("arbret-locale", "en");
});
await clearAuth(page);
await loginUser(page, REGULAR_USER.email, REGULAR_USER.password);
await clearProfileData(page);
@ -226,7 +231,10 @@ test.describe("Profile - Validation", () => {
});
test.describe("Profile - Admin User Access", () => {
test.beforeEach(async ({ page }) => {
test.beforeEach(async ({ context, page }) => {
await context.addInitScript(() => {
window.localStorage.setItem("arbret-locale", "en");
});
await clearAuth(page);
await loginUser(page, ADMIN_USER.email, ADMIN_USER.password);
});
@ -257,7 +265,10 @@ test.describe("Profile - Admin User Access", () => {
});
test.describe("Profile - Unauthenticated Access", () => {
test.beforeEach(async ({ page }) => {
test.beforeEach(async ({ context, page }) => {
await context.addInitScript(() => {
window.localStorage.setItem("arbret-locale", "en");
});
await clearAuth(page);
});