You've already forked agentic-coding-workflow
27 lines
616 B
Go
27 lines
616 B
Go
package notify
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
"log/slog"
|
|
"testing"
|
|
|
|
"github.com/google/uuid"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestDummy_Send_LogsAndReturnsNil(t *testing.T) {
|
|
var buf bytes.Buffer
|
|
log := slog.New(slog.NewJSONHandler(&buf, nil))
|
|
d := NewDummyNotifier(log)
|
|
|
|
require.Equal(t, ChannelDummy, d.Name())
|
|
err := d.Send(context.Background(), Message{
|
|
ID: uuid.New(), UserID: uuid.New(),
|
|
Topic: "x", Severity: SeverityInfo, Title: "hi", Body: "world",
|
|
})
|
|
require.NoError(t, err)
|
|
require.Contains(t, buf.String(), "notify[dummy]")
|
|
require.Contains(t, buf.String(), `"topic":"x"`)
|
|
}
|