feat: add miner event log tab

This commit is contained in:
2026-04-29 23:38:38 +02:00
parent 61e140fb03
commit f131f0bc71
9 changed files with 371 additions and 36 deletions
+18
View File
@@ -9,6 +9,7 @@ import (
"parasocial/internal/auth"
"parasocial/internal/irc"
"parasocial/internal/miner"
"parasocial/internal/twitch"
)
@@ -206,6 +207,23 @@ func TestResolveStreamerEntriesRefreshUpdatesWatchedChannels(t *testing.T) {
})
}
func TestNewMinerLogSinkBridgesMinerEntriesIntoStreamerUpdates(t *testing.T) {
ch := make(chan StreamerUpdate, 1)
newMinerLogSink(ch)(miner.LogEntry{
Login: "alpha_live",
Line: "pubsub points earned: balance=42",
})
update := <-ch
if update.Miner == nil {
t.Fatal("expected miner update")
}
if update.Miner.Login != "alpha_live" || update.Miner.Line != "pubsub points earned: balance=42" {
t.Fatalf("miner update = %#v", update.Miner)
}
}
type serviceOption func(*fakeStreamerService)
func streamService(options ...serviceOption) *fakeStreamerService {