Isolate test state and paint full frame

This commit is contained in:
Joe Julian
2026-03-31 20:12:54 -07:00
parent f9b58367da
commit 3e471366ce
2 changed files with 17 additions and 0 deletions
+3
View File
@@ -1655,6 +1655,9 @@ func (u *ui) noteCurrentVaultPath() {
}
func (u *ui) layout(gtx layout.Context) layout.Dimensions {
// Clear the full frame explicitly so mobile surfaces don't start from an
// unpainted black buffer before nested background widgets run.
paint.Fill(gtx.Ops, bgColor)
u.syncHostedAPI()
u.filter()
u.processShortcuts(gtx)
+14
View File
@@ -30,6 +30,20 @@ import (
"git.julianfamily.org/keepassgo/webdav"
)
func TestMain(m *testing.M) {
stateDir, err := os.MkdirTemp("", "keepassgo-test-state-")
if err != nil {
panic(err)
}
if err := os.Setenv("KEEPASSGO_STATE_DIR", stateDir); err != nil {
_ = os.RemoveAll(stateDir)
panic(err)
}
code := m.Run()
_ = os.RemoveAll(stateDir)
os.Exit(code)
}
func TestUIFiltersUsingVaultModelPathsAndSearch(t *testing.T) {
t.Parallel()