fix: test failure on systems with non-English locale

Closes #5647

Explicitly mock DateTimeFormatService.currentLocale to 'en-US' by default in tests to ensure consistent date formatting regardless of system locale. Also update the German locale test to explicitly use 'de-de'.
This commit is contained in:
Johannes Millan 2025-12-04 10:47:55 +01:00
parent 677f387664
commit 48ce0e3731

View file

@ -65,7 +65,9 @@ describe('AddTaskBarActionsComponent', () => {
localization: () => ({ timeLocale: locale }),
});
};
const mockDateTimeFormatService = jasmine.createSpyObj('DateTimeFormatService', ['-']);
const mockDateTimeFormatService = jasmine.createSpyObj('DateTimeFormatService', ['-'], {
currentLocale: 'en-US',
});
beforeEach(async () => {
// Create proper signal mocks
@ -329,7 +331,12 @@ describe('AddTaskBarActionsComponent', () => {
TranslateModule.forRoot(),
],
providers: [
{ provide: DateTimeFormatService, useValue: mockDateTimeFormatService },
{
provide: DateTimeFormatService,
useValue: jasmine.createSpyObj('DateTimeFormatService', ['-'], {
currentLocale: 'de-de',
}),
},
{
provide: GlobalConfigService,
useValue: mockConfigService(DateTimeLocales.de_de),