Update tests for GLOB match type

Rewrite worker unit tests: TestTemplateCandidates, TestGlobMatch,
TestSplitTokens, and updated TestFindMergeGroups with sandwich pattern
cases. Update e2e test to use GLOB instead of PREFIX.

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-05-06 20:45:47 +04:00
parent 0358aafb62
commit 855de92e1f
2 changed files with 245 additions and 43 deletions

View File

@@ -103,7 +103,7 @@ func TestTrackerPattern_Create(t *testing.T) {
assert.Equal(t, bannerID, result.CreateTrackerPattern.CookieBanner.ID)
})
t.Run("with PREFIX match type", func(t *testing.T) {
t.Run("with GLOB match type", func(t *testing.T) {
t.Parallel()
owner := testutil.NewClient(t, testutil.RoleOwner)
@@ -143,8 +143,8 @@ func TestTrackerPattern_Create(t *testing.T) {
err := owner.Execute(query, map[string]any{
"input": map[string]any{
"cookieCategoryId": categoryID,
"pattern": "_gat_",
"matchType": "PREFIX",
"pattern": "_gat_*",
"matchType": "GLOB",
"displayName": "GA Throttle",
"description": "Google Analytics rate limiting",
},
@@ -152,8 +152,8 @@ func TestTrackerPattern_Create(t *testing.T) {
require.NoError(t, err)
node := result.CreateTrackerPattern.TrackerPatternEdge.Node
assert.Equal(t, "_gat_", node.Pattern)
assert.Equal(t, "PREFIX", node.MatchType)
assert.Equal(t, "_gat_*", node.Pattern)
assert.Equal(t, "GLOB", node.MatchType)
assert.Nil(t, node.MaxAgeSeconds)
})