fix(test): update tests for event bus + room-based Hub signatures
- integration_test: pass events.Bus to NewRouter - handler_test: pass events.Bus to handler.New - hub_test: add mock MembershipChecker, JWT token generation, replace hub.clients with totalClients() helper for room-based Hub Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
06122dfe9e
commit
fc3dc39b82
3 changed files with 50 additions and 17 deletions
|
|
@ -17,6 +17,7 @@ import (
|
|||
"github.com/gorilla/websocket"
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
|
||||
"github.com/multica-ai/multica/server/internal/events"
|
||||
"github.com/multica-ai/multica/server/internal/realtime"
|
||||
)
|
||||
|
||||
|
|
@ -60,7 +61,8 @@ func TestMain(m *testing.M) {
|
|||
hub := realtime.NewHub()
|
||||
go hub.Run()
|
||||
|
||||
router := NewRouter(pool, hub)
|
||||
bus := events.NewBus()
|
||||
router := NewRouter(pool, hub, bus)
|
||||
testServer = httptest.NewServer(router)
|
||||
|
||||
// Login to get a real JWT token
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue