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.
32 lines
720 B
Go
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")
|
|
}
|
|
}
|