package buscompose import ( "slices" "testing" ) // The grants part may create each seat's ask stream it makes (AskStreamsOf), by its name alone (lead-47, 2026-11-15: the bus // refused SEAT_MESH_BUILDS's create because the part's account named no such stream). func TestTheGrantsPartMayCreateTheSeatsAskStreams(t *testing.T) { got := declaredStreamsOf(Records{AskStreams: []string{"SEAT_MESH_BUILDS"}}) if !slices.Contains(got, "SEAT_MESH_BUILDS") { t.Fatalf("declared streams %v lack the builds seat's ask stream", got) } perms, err := PermissionsFor(Principal{Kind: KindModule, Node: "one", Module: GrantsModule, CreatesStreams: got}) if err != nil { t.Fatal(err) } if !MayPublish(perms, "$JS.API.STREAM.CREATE.SEAT_MESH_BUILDS") || MayPublish(perms, "$JS.API.STREAM.CREATE.SEAT_OTHER") { t.Errorf("the grants part's creates: %v", perms.Publish) } }