Skip to content

Commit

Permalink
Add test for invalid update filter type
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSisley committed Jan 20, 2023
1 parent b50cf98 commit 0f56f36
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/integration/collection/update/simple/with_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,28 @@ import (
testUtils "github.com/sourcenetwork/defradb/tests/integration/collection"
)

func TestUpdateWithInvalidFilterType(t *testing.T) {
test := testUtils.TestCase{
Description: "Test update users with invalid filter type",
Docs: map[string][]string{},
CollectionCalls: map[string][]func(client.Collection) error{
"users": []func(c client.Collection) error{
func(c client.Collection) error {
ctx := context.Background()
// test with an invalid filter type
_, err := c.UpdateWithFilter(ctx, t, `{
"Name": "Eric"
}`)
return err
},
},
},
ExpectedError: "invalid filter",
}

executeTestCase(t, test)
}

func TestUpdateWithEmptyFilter(t *testing.T) {
test := testUtils.TestCase{
Description: "Test update users with empty filter",
Expand Down

0 comments on commit 0f56f36

Please sign in to comment.