API filter tests (#958)

* API filter tests.  Requires that PR https://github.com/hashicorp/boundary/pull/957 is merged and tagged first.

* Updating /api dependency.
This commit is contained in:
Todd Knight authored and GitHub committed 2021-02-22 14:37:14 -07:00
1 parent 1906a7311b
commit 909026ed3d
11 files changed
+72 -1

No files matched your search

+7
View File
@@ -38,6 +38,13 @@ func TestList(t *testing.T) {
pl, err = scps.List(tc.Context(), org.GetPublicId())
require.NoError(err)
assert.ElementsMatch(comparableSlice(expected), comparableSlice(pl.Items))
filterItem := pl.Items[3]
pl, err = scps.List(tc.Context(), org.GetPublicId(),
scopes.WithFilter(fmt.Sprintf(`"/item/id"==%q`, filterItem.Id)))
require.NoError(err)
assert.Len(pl.Items, 1)
assert.Equal(filterItem.Id, pl.Items[0].Id)
}
func comparableSlice(in []*scopes.Scope) []scopes.Scope {