test(01-02): add failing test for typed events and context

- Cover Fire/Collect/UntilHandled, priority, panics and bus isolation
- Require towel actor/org/collection/locale accessors on context
- Assert hello command demonstrates all three dispatch modes
This commit is contained in:
Jakub Zych
2026-09-16 13:27:53 +02:00
parent 86969739ae
commit 36c152f4bb
4 changed files with 260 additions and 6 deletions

View File

@@ -7,8 +7,21 @@ import (
"strconv"
"strings"
"testing"
"git.golem15.com/golem15/summercms/compass"
)
func TestEventBusesAreAppScoped(t *testing.T) {
a := New(&compass.Config{})
b := New(&compass.Config{})
if a.Events == nil || b.Events == nil {
t.Fatal("App must own an event bus")
}
if a.Events == b.Events {
t.Fatal("apps must not share a bus")
}
}
func TestDoesNotImportParty(t *testing.T) {
entries, err := os.ReadDir(".")
if err != nil {