Skip to content

Commit e903e32

Browse files
committed
fix test
1 parent 029957d commit e903e32

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/http/handler_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"log/slog"
66
"net/http"
77
"net/http/httptest"
8+
"slices"
89
"sort"
910
"testing"
1011

@@ -273,8 +274,11 @@ func TestHTTPHandlerRoutes(t *testing.T) {
273274
var capturedInventory *inventory.Inventory
274275
var capturedCtx context.Context
275276

276-
// Create feature checker that reads from context (same as production)
277-
featureChecker := createHTTPFeatureChecker()
277+
// Create feature checker that reads from context without whitelist validation
278+
// (the whitelist is tested separately; here we test the filtering logic)
279+
featureChecker := func(ctx context.Context, flag string) (bool, error) {
280+
return slices.Contains(ghcontext.GetHeaderFeatures(ctx), flag), nil
281+
}
278282

279283
apiHost, err := utils.NewAPIHost("https://api.github.com")
280284
require.NoError(t, err)

0 commit comments

Comments
 (0)