Isolate test state and paint full frame
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user