From c82468b1b32ad5bfb347fe65cd5dcfb6680795d1 Mon Sep 17 00:00:00 2001 From: mo khan Date: Wed, 7 May 2025 10:47:31 -0700 Subject: refactor: provide context to repository to apply timeout --- app/controllers/sparkles/controller_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/controllers/sparkles/controller_test.go') diff --git a/app/controllers/sparkles/controller_test.go b/app/controllers/sparkles/controller_test.go index b2c7752..8a1717d 100644 --- a/app/controllers/sparkles/controller_test.go +++ b/app/controllers/sparkles/controller_test.go @@ -17,7 +17,7 @@ func TestSparkles(t *testing.T) { t.Run("GET /sparkles", func(t *testing.T) { sparkle, _ := domain.NewSparkle("@tanuki for helping me") store := db.NewRepository[*domain.Sparkle]() - store.Save(sparkle) + store.Save(t.Context(), sparkle) mux := http.NewServeMux() controller := New(store) @@ -75,8 +75,8 @@ func TestSparkles(t *testing.T) { }) t.Run("saves the sparkle to the db", func(t *testing.T) { - assert.Equal(t, 1, len(repository.All())) - item := repository.All()[0] + assert.Equal(t, 1, len(repository.All(t.Context()))) + item := repository.All(t.Context())[0] assert.Equal(t, "@tanuki", item.Sparklee) assert.Equal(t, "for reviewing my code!", item.Reason) -- cgit v1.2.3