mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
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:
parent
677f387664
commit
48ce0e3731
1 changed files with 9 additions and 2 deletions
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue