Files
weichen 143ee934b8 feat(collab): free-lane chat, claim-on-view, lease ownership, notify inbox
Open member free-lane for chat initiation; auto-claim on author view;
harden lease persist/ownership with readable DOC_BUSY; add notification
inbox and supplement-impact HTTP decision APIs wired to composition root.
2026-09-24 11:49:43 +00:00

32 lines
720 B
Go

package server
import "testing"
func TestIsFreeLaneIntent(t *testing.T) {
if !IsFreeLaneIntent("conversation.chat") {
t.Fatal("chat should be free-lane")
}
if !IsFreeLaneIntent("project.fact.supplement") {
t.Fatal("supplement should be free-lane")
}
if IsFreeLaneIntent("document.review.submit") {
t.Fatal("submit must stay duty-gated")
}
if IsFreeLaneIntent("task.run") {
t.Fatal("task.run must stay gated")
}
}
func TestAllowFreeLaneChatInitiation(t *testing.T) {
var s Server
if !s.allowFreeLaneChatInitiation(42, 7) {
t.Fatal("member should initiate")
}
if s.allowFreeLaneChatInitiation(0, 7) {
t.Fatal("no project")
}
if s.allowFreeLaneChatInitiation(42, 0) {
t.Fatal("no user")
}
}