ENH - frame

This commit is contained in:
Eichenholz
2026-08-03 18:42:48 +02:00
parent eb915b9334
commit 3c25331bcb
9 changed files with 1018 additions and 213 deletions
+38 -2
View File
@@ -11,10 +11,46 @@ describe('preferences', () => {
const value = parsePhonePreferences(
JSON.stringify({
version: 1,
settings: { wifi: false, wallpaper: 'ember' },
settings: {
appearanceMode: 'light',
notificationVolume: 45,
notifications: {
camera: { enabled: false, sounds: false },
},
phoneScale: 110,
wallpaper: 'ember',
},
}),
)
expect(value.settings.wifi).toBe(false)
expect(value.settings.appearanceMode).toBe('light')
expect(value.settings.notificationVolume).toBe(45)
expect(value.settings.notifications.camera).toEqual({
enabled: false,
sounds: false,
})
expect(value.settings.notifications.clock.enabled).toBe(true)
expect(value.settings.phoneScale).toBe(110)
expect(value.settings.wallpaper).toBe('ember')
})
it('clamps ranges and rejects unknown choices', () => {
const value = parsePhonePreferences(
JSON.stringify({
version: 1,
settings: {
appearanceMode: 'neon',
frame: 'gold',
notificationVolume: -10,
phoneScale: 500,
ringtoneVolume: 120,
},
}),
)
expect(value.settings.appearanceMode).toBe('automatic')
expect(value.settings.frame).toBe('black')
expect(value.settings.notificationVolume).toBe(0)
expect(value.settings.phoneScale).toBe(115)
expect(value.settings.ringtoneVolume).toBe(100)
})
})