Files
archie/modules/chat/tools_test.go
T
sam 0ad4374a2a refactor(judgement): rename action classes to action types and raises to autonomy proposals
- tables judgement.action_types, action_type_resets, action_type_approvals and autonomy_proposals (migration 00063)
- governance setting propose_autonomy_after, approval request kind autonomy, policy resource kind action_type
- /api/action-types replaces /api/classes; the detail lists autonomy_proposals
- an autonomy proposal stores the identity ID of the account that answered it
2026-11-23 23:43:45 +11:00

27 lines
840 B
Go

package chat
import "testing"
// TestDashboardPathStaysInTheDashboard guards the link the agent can offer
// the operator: it must never lead off the dashboard or outside its pages.
func TestDashboardPathStaysInTheDashboard(t *testing.T) {
cases := map[string]bool{
"/runs": true,
"/runs/0b8f6c1e-4a7e-4f6d": true,
"/controls/github:merge_pr": true,
"//evil.example/runs": false,
"https://evil.example/runs": false,
"javascript:alert(1)": false,
"/runs/../settings": false,
"/runs/a/b": false,
"/runs/..": false,
"/admin": false,
"runs": false,
}
for path, want := range cases {
if got := dashboardPath(path); got != want {
t.Errorf("dashboardPath(%q) = %v, want %v", path, got, want)
}
}
}