Files
Reims-Go/internal/driver/reims/reims_test.go
T
千川白浪andClaude Opus 5.5 4bea654736 feat: add Wails desktop GUI and stage-0 UI redesign
Wails shell over the existing Go core (app.go, main.go, wails.json,
build/), with a React frontend for the VM list, VM detail, host page,
create wizard and settings, plus process helpers for the driver and
runtime packages.

UI redesign stage 0 (docs/ui-redesign.md):
- VM actions live in the page header: one primary action per state,
  icon-only secondary actions with tooltips, the rest in a "..." menu
- install guide is a single card with the only "eject installer" button
- summary is an icon + value row; paths, ICD, CPU model and runtime hash
  moved to a collapsed "technical details" section
- logs no longer auto-open; a status bar shows merged download progress
  and an error count; the log view sticks to the bottom
- busy states on actions, toasts for results, custom delete dialog with
  "keep disk files"
- design tokens, Windows font stack, integer type scale, no inline styles
- keyboard: sidebar listbox navigation, focus rings, Ctrl+N / Ctrl+, / Ctrl+L
- copy rewritten per the restraint rules in §4.5
- Radix primitives and lucide icons replace hand-rolled widgets

Backend: OpenVMFolder binding to show a VM's directory in Explorer.
Docs: shell-design.md revised for decisions D1 and D4.
Vite dev server pinned to 127.0.0.1 so `wails dev` can reach it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 03:09:39 -07:00

64 lines
1.7 KiB
Go

package reims
import (
"reflect"
"testing"
)
func TestBuildCreateArgs(t *testing.T) {
logs := true
args, err := BuildCreateArgs(CreateOpts{
Name: "dev-mac",
Dir: `D:\VMs\dev-mac`,
MacOS: "tahoe",
CPUs: 8,
Memory: "16G",
DiskSize: "128G",
GPU: `C:\nv-vk64.json`,
Logs: &logs,
})
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
want := []string{
"create", "dev-mac",
"--dir", `D:\VMs\dev-mac`,
"--macos", "tahoe",
"--cpus", "8",
"--memory", "16G",
"--disk-size", "128G",
"--gpu", `C:\nv-vk64.json`,
"--logs", "true",
}
if !reflect.DeepEqual(args, want) {
t.Fatalf("args mismatch:\n got: %v\nwant: %v", args, want)
}
}
func TestParseShowRedactsMACAndDetectsInstaller(t *testing.T) {
sample := `m0
state stopped
kind x86-64 macOS guest (q35 and OpenCore, WHPX)
directory D:\Data\vms\m0
cpus 8
memory 12G
disk disk.qcow2 (qcow2, SATA)
graphics reims-vgpu, its own GPU device and macOS drivers
display one, in a window opening at 1920x1080, whose size the guest follows
gpu automatic: the only GPU, or a discrete one before an integrated one
opencore D:\Data\vms\m0\opencore.qcow2
installer D:\Data\vms\m0\installer.img
cpu model Skylake-Client-noTSX-IBRS
audio on
network user, mac 52:54:00:12:34:56
logs on (info)
stop timeout 90 s`
d := ParseShow("m0", sample)
if d.CPUs != 8 || d.Memory != "12G" || d.Resolution != "1920x1080" || !d.HasInstaller {
t.Fatalf("unexpected parsed detail: %+v", d)
}
if d.NetworkSummary == "" || d.NetworkSummary == "user, mac 52:54:00:12:34:56" {
t.Fatalf("expected MAC to be redacted, got %q", d.NetworkSummary)
}
}