Log compact header button bounds
This commit is contained in:
@@ -5460,6 +5460,28 @@ func TestUISyncDefaultsPersistInSettings(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestUIDebugHeaderBoundsPersistInSettings(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
configPath := filepath.Join(t.TempDir(), "settings.json")
|
||||
|
||||
first := newUIWithSession("phone", &session.Manager{}, statePaths{
|
||||
SettingsPath: configPath,
|
||||
})
|
||||
first.debugLogHeaderBounds = true
|
||||
first.saveSettings()
|
||||
|
||||
second := newUIWithSession("phone", &session.Manager{}, statePaths{
|
||||
SettingsPath: configPath,
|
||||
})
|
||||
second.debugLogHeaderBounds = false
|
||||
second.loadSettings()
|
||||
|
||||
if !second.debugLogHeaderBounds {
|
||||
t.Fatal("debugLogHeaderBounds = false, want true after reload")
|
||||
}
|
||||
}
|
||||
|
||||
func TestUILoadSettingsFallsBackToLegacySyncDefaultsInUIPreferences(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -5552,6 +5574,39 @@ func TestUISaveSecuritySettingsPersistsSyncDefaults(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestUISaveSecuritySettingsPersistsDebugHeaderBounds(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
manager := &session.Manager{}
|
||||
dir := t.TempDir()
|
||||
u := newUIWithSession("phone", manager, statePaths{
|
||||
DefaultSaveAsPath: filepath.Join(dir, "vault.kdbx"),
|
||||
SettingsPath: filepath.Join(dir, "settings.json"),
|
||||
UIPreferencesPath: filepath.Join(dir, "ui-prefs.json"),
|
||||
})
|
||||
u.masterPassword.SetText("correct horse battery staple")
|
||||
if err := u.createVaultAction(); err != nil {
|
||||
t.Fatalf("createVaultAction() error = %v", err)
|
||||
}
|
||||
u.securityCipher.SetText(vault.CipherAES256)
|
||||
u.securityKDF.SetText(vault.KDFAES)
|
||||
u.loadSettingsDraft()
|
||||
u.settingsDebugHeaderBounds.Value = true
|
||||
|
||||
if err := u.saveSecuritySettingsAction(); err != nil {
|
||||
t.Fatalf("saveSecuritySettingsAction() error = %v", err)
|
||||
}
|
||||
|
||||
reloaded := newUIWithSession("phone", &session.Manager{}, statePaths{
|
||||
SettingsPath: u.settingsPath,
|
||||
})
|
||||
reloaded.loadSettings()
|
||||
|
||||
if !reloaded.debugLogHeaderBounds {
|
||||
t.Fatal("reloaded debugLogHeaderBounds = false, want true")
|
||||
}
|
||||
}
|
||||
|
||||
func TestUIAccessibilityPreferencesPersist(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user