From c4a6a577894355900ae76966c9775c0fd44e6f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Mon, 4 May 2026 15:27:42 +0400 Subject: [PATCH] Fix TestBuildSnapshot_RankInvariant for SQL-level filtering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test was passing UNCATEGORISED categories to buildSnapshot and expecting them to be filtered out. Now that filtering happens at the query level, the test input should only contain consent categories. Signed-off-by: Émile Ré --- pkg/cookiebanner/service_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/cookiebanner/service_test.go b/pkg/cookiebanner/service_test.go index 5859a43b6..6dcf8fb4b 100644 --- a/pkg/cookiebanner/service_test.go +++ b/pkg/cookiebanner/service_test.go @@ -273,15 +273,13 @@ func TestBuildSnapshot_RankInvariant(t *testing.T) { assert.True(t, snapshotsEqual(a, b)) }) - t.Run("Necessary comes first and uncategorised is excluded", func(t *testing.T) { + t.Run("Necessary comes first given consent-only categories", func(t *testing.T) { t.Parallel() - snap := buildSnapshot(banner, mkCategories(0, 1, 2, 3), nil) + consentOnly := mkCategories(0, 1, 2, 3)[:3] + snap := buildSnapshot(banner, consentOnly, nil) require.Len(t, snap.Categories, 3) assert.Equal(t, coredata.CookieCategoryKindNecessary, snap.Categories[0].Kind) - for _, c := range snap.Categories { - assert.NotEqual(t, coredata.CookieCategoryKindUncategorised, c.Kind) - } }) }