feat: activity log producers

This commit is contained in:
fsylvain committed 2026-10-06 22:25:23 +02:00
1 parent 50b1649965
commit e37a46a027
93 files changed
+3396 -440

No files matched your search

+3 -3
View File
@@ -148,11 +148,11 @@ var _ article.Repository = &mockArticleRepo{}
func TestCreateArticle(t *testing.T) {
repo := newMockArticleRepo()
uc := useCases.NewCreateArticleUseCase(repo, &fakeBodyRenderer{})
uc := useCases.NewCreateArticleUseCase(repo, &fakeBodyRenderer{}, discardRecorder)
t.Run("Valid Title", func(t *testing.T) {
cmd := useCases.CreateArticleCommand{Title: "Valid Title", Body: "Content"}
res, err := uc.CreateArticle(cmd)
res, err := uc.CreateArticle(testCtx, cmd)
if err != nil {
t.Fatalf("Expected no error, got %v", err)
}
@@ -163,7 +163,7 @@ func TestCreateArticle(t *testing.T) {
t.Run("Short Title", func(t *testing.T) {
cmd := useCases.CreateArticleCommand{Title: "Ab", Body: "Content"}
_, err := uc.CreateArticle(cmd)
_, err := uc.CreateArticle(testCtx, cmd)
if !errors.Is(err, article.ErrInvalidTitle) {
t.Errorf("Expected ErrInvalidTitle")
}