test: add windows ui and packaging smoke

This commit is contained in:
QiuSW
2026-07-22 15:20:10 +08:00
parent 26cfa8b921
commit 63215bd181
5 changed files with 90 additions and 4 deletions
+28
View File
@@ -0,0 +1,28 @@
package ui
import (
"testing"
"gioui.org/widget/material"
)
func TestShellStartsWithSemanticInstanceStatuses(t *testing.T) {
shell := NewShell(material.NewTheme())
seen := map[string]bool{}
for _, row := range shell.rows {
seen[row.Status] = true
}
for _, status := range []string{"运行中", "启动中", "外部占用", "已退出"} {
if !seen[status] {
t.Fatalf("status %q is missing", status)
}
}
}
func TestShellSettingsCanBeRestored(t *testing.T) {
shell := NewShell(material.NewTheme())
shell.SetSettings(SettingsState{ChromePath: "chrome", EdgePath: "edge", DefaultDir: "profiles", LogDir: "logs", CloseOnExit: false})
if shell.chromePath.Text() != "chrome" || shell.edgePath.Text() != "edge" || shell.dataDir.Text() != "profiles" || shell.logDir.Text() != "logs" || shell.closeOnExit.Value {
t.Fatalf("settings were not restored")
}
}