Files
aego/engine/docs/navigation_icons_test.go
sanspie 768a59fdd6
ci-platforms / darwin amd64 smoke (push) Skipped
ci-platforms / windows amd64 smoke (push) Skipped
ci-platforms / darwin arm64 smoke (push) Skipped
GitHub / windows amd64 native GitHub-hosted native CI: failure
GitHub / darwin arm64 native GitHub-hosted native CI: failure
GitHub / darwin amd64 native GitHub-hosted native CI: failure
GitHub / linux amd64 native GitHub-hosted native CI: success
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 / checks (push) Failing after 25m31s
ci / build (amd64, linux, ubuntu-24.04) (push) Failing after 9m28s
ci / release (push) Skipped
editor: show documentation navigation icons
2026-11-10 02:20:58 +03:00

33 lines
1.1 KiB
Go

//go:build !aego_runtime
package docs
import "testing"
func TestNavigationIconsAreHostProvidedAndCopied(t *testing.T) {
r := Assemble(Sources{})
tasks := map[string]string{"guide": "file.art"}
refs := map[string]string{"package": "cat.node"}
r.SetNavigationIcons(tasks, refs)
tasks["guide"] = "wrong"
refs["package"] = "wrong"
if got := r.NavigationTaskIcon("guide"); got != "file.art" {
t.Fatalf("task icon = %q", got)
}
if got := r.NavigationReferenceIcon("package"); got != "cat.node" {
t.Fatalf("reference icon = %q", got)
}
other := Assemble(Sources{})
if other.NavigationTaskIcon("guide") != "" || other.NavigationReferenceIcon("package") != "" {
t.Fatal("navigation policy leaked to another registry")
}
r.SetNavigationIcons(nil, nil)
if r.NavigationTaskIcon("guide") != "" || r.NavigationReferenceIcon("package") != "" {
t.Fatal("clearing a policy did not remove its icons")
}
var absent *Registry
if absent.NavigationTaskIcon("guide") != "" || absent.NavigationReferenceIcon("package") != "" {
t.Fatal("nil registry should not provide icon overrides")
}
}