Skip to content

Commit

Permalink
moar tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nadavsteindler committed Dec 17, 2024
1 parent bd63f30 commit 8325295
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions pkg/catalog/catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func TestCatalog_ListRepositories(t *testing.T) {
wantErr: false,
},
{
name: "first",
name: "firstCatalog",
args: args{
limit: 1,
after: "",
Expand All @@ -126,7 +126,7 @@ func TestCatalog_ListRepositories(t *testing.T) {
wantErr: false,
},
{
name: "second",
name: "secondCatalog",
args: args{
limit: 1,
after: "re",
Expand All @@ -140,7 +140,7 @@ func TestCatalog_ListRepositories(t *testing.T) {
wantErr: false,
},
{
name: "third",
name: "thirdCatalog",
args: args{
limit: 2,
after: "repo1",
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit 8325295

Please sign in to comment.