Merge branch 'main' into feature/appearance-settings

This commit is contained in:
josedario87
2025-05-30 18:22:59 -06:00
committed by GitHub
28 changed files with 478 additions and 243 deletions

View File

@@ -52,6 +52,10 @@ describe('useUi Store', () => {
})
it('loads settings from localStorage including new accent colors if present', () => {
expect(localStorageMock.getItem).toHaveBeenCalledWith(APPEARANCE_STORAGE_KEY)
})
it('loads settings from localStorage if present', () => {
const storedSettings = {
primaryColor: '#FF0000',
theme: 'dark',
@@ -126,6 +130,9 @@ describe('useUi Store', () => {
'primaryColor', 'secondaryColor', 'warningColor', 'fontFamily',
'fontSize', 'animationsEnabled', 'backgroundColor', 'theme',
'accentColorEmpleados', 'accentColorTareas', 'accentColorPlanillas', 'accentColorAsistencias',
const appearanceSettingKeys = [
'primaryColor', 'secondaryColor', 'warningColor', 'fontFamily',
'fontSize', 'animationsEnabled', 'backgroundColor', 'theme',
]
it('setPrimaryColor updates state and saves to localStorage', () => {
@@ -252,5 +259,11 @@ describe('useUi Store', () => {
expect.stringContaining('"accentColorAsistencias":"#FF7788"')
)
})
expect(Object.keys(savedData).length).toBe(appearanceSettingKeys.length);
expect(savedData.sidebarOpen).toBeUndefined() // Ensure non-appearance data is not saved
appearanceSettingKeys.forEach(key => {
expect(savedData.hasOwnProperty(key)).toBe(true)
})
})
})
})