- Tema custom (indigo/cyan dari ikon, sudut membulat) mengikuti varian sistem - Header compact: logo + wordmark, tombol aksi di kanan - Kartu per shortcut: ikon, nama, meta singkat, chip lokasi, tombol ikon - Teks satu baris pakai canvas.Text (widget.Label Fyne 2.8 memesan tinggi ~2x) - Dialog: judul bagian, ikon folder pada Browse, tombol Install primary
39 lines
855 B
Go
39 lines
855 B
Go
package ui
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"fyne.io/fyne/v2/test"
|
|
|
|
"lazyrun/internal/store"
|
|
)
|
|
|
|
func TestBuildMainWindow(t *testing.T) {
|
|
a := test.NewApp()
|
|
defer a.Quit()
|
|
|
|
ui, err := build(a, "test")
|
|
if err != nil {
|
|
t.Fatalf("build(): %v", err)
|
|
}
|
|
if ui.win.Content() == nil {
|
|
t.Fatal("window tanpa content")
|
|
}
|
|
|
|
// dialog harus bisa dibuka tanpa panic
|
|
ui.showExecutableDialog()
|
|
ui.showWebAppDialog()
|
|
ui.checkUpdates()
|
|
}
|
|
|
|
func TestMetaText(t *testing.T) {
|
|
sc := store.Shortcut{Type: store.TypeWebApp, URL: "https://example.com/x", Targets: store.Targets{Menu: true}}
|
|
if got := metaText(sc); got != "Web · example.com" {
|
|
t.Errorf("metaText() = %q", got)
|
|
}
|
|
exe := store.Shortcut{Type: store.TypeExecutable, BinaryPath: "/home/u/.local/bin/winbox"}
|
|
if got := metaText(exe); got != "Executable · winbox" {
|
|
t.Errorf("metaText() = %q", got)
|
|
}
|
|
}
|