Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
fix regression and add test
Browse files Browse the repository at this point in the history
  • Loading branch information
bobheadxi committed Aug 10, 2024
1 parent ba6c7aa commit 9ae24a6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (opts ListEnterpriseSubscriptionsOptions) toQueryConditions() (where, limit
if *opts.IsArchived {
whereConds = append(whereConds, "archived_at IS NOT NULL")
} else {
whereConds = append(whereConds, "archived IS NUlL")
whereConds = append(whereConds, "archived_at IS NUlL")
}
}
if len(opts.DisplayNameSubstring) > 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,22 @@ func SubscriptionsStoreList(t *testing.T, ctx context.Context, s *subscriptions.
assert.Equal(t, s1.ID, ss[0].ID)
})

t.Run("list by not archived", func(t *testing.T) {
t.Parallel()

ss, err := s.List(
ctx,
subscriptions.ListEnterpriseSubscriptionsOptions{
IsArchived: pointers.Ptr(false),
},
)
require.NoError(t, err)
assert.NotEmpty(t, ss)
for _, s := range ss {
assert.Nil(t, s.ArchivedAt)
}
})

t.Run("list with page size", func(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit 9ae24a6

Please sign in to comment.