From 83252951ee4c086f4a47de6f22ae497022683312 Mon Sep 17 00:00:00 2001 From: nadavsteindler Date: Tue, 17 Dec 2024 17:14:36 +0200 Subject: [PATCH] moar tests --- pkg/catalog/catalog_test.go | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/pkg/catalog/catalog_test.go b/pkg/catalog/catalog_test.go index 9880f80f6c5..11877a52556 100644 --- a/pkg/catalog/catalog_test.go +++ b/pkg/catalog/catalog_test.go @@ -112,7 +112,7 @@ func TestCatalog_ListRepositories(t *testing.T) { wantErr: false, }, { - name: "first", + name: "firstCatalog", args: args{ limit: 1, after: "", @@ -126,7 +126,7 @@ func TestCatalog_ListRepositories(t *testing.T) { wantErr: false, }, { - name: "second", + name: "secondCatalog", args: args{ limit: 1, after: "re", @@ -140,7 +140,7 @@ func TestCatalog_ListRepositories(t *testing.T) { wantErr: false, }, { - name: "third", + name: "thirdCatalog", args: args{ limit: 2, after: "repo1", @@ -199,6 +199,35 @@ func TestCatalog_ListRepositories(t *testing.T) { wantHasMore: false, wantErr: false, }, + { + name: "common_pagedSearchString1", + args: args{ + limit: 2, + after: "", + prefix: "", + searchString: "o2", + }, + want: []*catalog.Repository{ + {Name: "repo2", StorageNamespace: "storage3", DefaultBranch: "main3", CreationDate: now}, + {Name: "repo22", StorageNamespace: "storage4", DefaultBranch: "main4", CreationDate: now}, + }, + wantHasMore: true, + wantErr: false, + }, + { + name: "common_pagedSearchString2", + args: args{ + limit: 2, + after: "repo22", + prefix: "", + searchString: "o2", + }, + want: []*catalog.Repository{ + {Name: "repo23", StorageNamespace: "storage5", DefaultBranch: "main5", CreationDate: now}, + }, + wantHasMore: false, + wantErr: false, + }, { name: "after_and_searchString", args: args{