Files
aego/app/docsview/mesh_try_test.go
sanspie 50be5c04bc
ci-platforms / darwin amd64 smoke (push) Skipped
GitHub / linux amd64 native GitHub-hosted native CI: success
ci-platforms / windows amd64 smoke (push) Skipped
GitHub / windows amd64 native GitHub-hosted native CI: success
GitHub / darwin arm64 native GitHub-hosted native CI: success
GitHub / darwin amd64 native GitHub-hosted native CI: success
ci / checks (push) Failing after 1h21m34s
ci / native-authoring (push) Skipped
ci-platforms / darwin arm64 smoke (push) Skipped
github-native / gitea-pending (push) Skipped
github-native / darwin amd64 native (push) Skipped
github-native / linux amd64 native (push) Skipped
github-native / windows amd64 native (push) Skipped
github-native / darwin arm64 native (push) Skipped
github-native / gitea-result (push) Skipped
ci / build (amd64, linux, ubuntu-24.04) (push) Successful in 12m4s
ci / release (push) Skipped
Stage 12.5: Art Workspace and asset authoring
Add dockable Art tools, animation and previews, guarded asset workflows,
and the Web Asset Studio built on the shared Art Core. Expand English and
Russian documentation, interactive Try scenes, examples and editor icons.

Add audio waveform navigation, source analysis, guarded previews and a
browser Worker mixer. Preserve source changes and recovery with bounded
checks, and strengthen native, browser and interoperability CI.

Prepare version 0.12.5 and manually built native artifact candidates.
Fix the production site image demo build dependency.
Reuse immutable scene indices when capturing keyframes.
Wait for real Persist save/load completion in component tests.
Stabilize browser Game View captures outside pointer hover.
Aseprite interchange and persistent Audio EDL recovery remain limited;
the artifact workflow does not publish releases or change stable.
2026-11-15 10:37:50 +03:00

85 lines
2.1 KiB
Go

//go:build aego_editor
package docsview
import (
"encoding/json"
"testing"
"aego/app/playground"
"aego/asset"
"aego/engine/docs"
"aego/modules/render2d"
"aego/scene"
)
// This executes the real docs Try session with its existing loader, editor
// mutation and reset. A headless run does not prove GPU or browser rendering.
func TestMesh2DTryLoadsEditsAndResets(t *testing.T) {
p, err := playground.New()
if err != nil {
t.Fatal(err)
}
var entry docs.Entry
for _, candidate := range p.TryScenes() {
if candidate.ID == "engine.Mesh2D" {
entry = candidate
break
}
}
if entry.Try == "" || entry.TrySelect != "engine.Mesh2D" {
t.Fatal("the Mesh2D component does not own a selectable Try scene")
}
a := newHeadless(t)
request, err := json.Marshal(map[string]any{"scene": entry.Try, "select": entry.TrySelect, "artifacts": entry.TryArtifacts})
if err != nil {
t.Fatal(err)
}
if reply := a.Call("load", request); reply.Error != "" {
t.Fatal(reply.Error)
}
if err := a.Step(10); err != nil {
t.Fatal(err)
}
if _, ok := a.loader.Mesh(asset.BuiltinCube); !ok {
t.Fatal("the built-in mesh dependency is unavailable")
}
order := func() int32 {
t.Helper()
sc := a.session.Controller().Scene()
if sc == nil {
t.Fatal("Try runtime is not running")
}
node := sc.Find(sc.Root(), "Mesh 2D")
mesh, ok := scene.Get[render2d.Mesh2D](sc, node)
if !ok || mesh.Mesh.ID != asset.BuiltinCube {
t.Fatal("Try runtime lost the component or its mesh")
}
return mesh.Order
}
if got := order(); got != 2 {
t.Fatalf("initial mesh order = %d, want 2", got)
}
if err := a.session.Set("engine.Mesh2D", "order", 0); err != nil {
t.Fatal(err)
}
if err := a.Step(2); err != nil {
t.Fatal(err)
}
if got := order(); got != 0 {
t.Fatalf("edited mesh order = %d, want 0", got)
}
if err := a.session.Reset(); err != nil {
t.Fatal(err)
}
if err := a.Step(2); err != nil {
t.Fatal(err)
}
if got := order(); got != 2 {
t.Fatalf("reset mesh order = %d, want 2", got)
}
if errors := errorsOf(a); len(errors) > 0 {
t.Fatalf("Mesh2D Try faults: %v", errors)
}
}