Skip to content

Commit

Permalink
test: Test filter in filter tests (sourcenetwork#473)
Browse files Browse the repository at this point in the history
Previously filter tests would pass if the filter does nothing (i.e. filter code was non-existent), as the full set of data was expected to be returned
  • Loading branch information
AndrewSisley authored May 27, 2022
1 parent 6dcb8d0 commit 85a56fe
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/integration/query/simple/with_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ func TestQuerySimpleWithKeyFilterBlock(t *testing.T) {
(`{
"Name": "John",
"Age": 21
}`),
(`{
"Name": "Bob",
"Age": 32
}`)},
},
Results: []map[string]interface{}{
Expand Down Expand Up @@ -239,6 +243,10 @@ func TestQuerySimpleWithStringFilterBlock(t *testing.T) {
(`{
"Name": "John",
"Age": 21
}`),
(`{
"Name": "Bob",
"Age": 32
}`)},
},
Results: []map[string]interface{}{
Expand Down Expand Up @@ -266,6 +274,10 @@ func TestQuerySimpleWithStringFilterBlockAndSelect(t *testing.T) {
(`{
"Name": "John",
"Age": 21
}`),
(`{
"Name": "Bob",
"Age": 32
}`)},
},
Results: []map[string]interface{}{
Expand All @@ -286,6 +298,10 @@ func TestQuerySimpleWithStringFilterBlockAndSelect(t *testing.T) {
(`{
"Name": "John",
"Age": 21
}`),
(`{
"Name": "Bob",
"Age": 32
}`)},
},
Results: []map[string]interface{}{
Expand Down Expand Up @@ -332,6 +348,10 @@ func TestQuerySimpleWithNumberEqualsFilterBlock(t *testing.T) {
(`{
"Name": "John",
"Age": 21
}`),
(`{
"Name": "Bob",
"Age": 32
}`)},
},
Results: []map[string]interface{}{
Expand Down Expand Up @@ -360,6 +380,10 @@ func TestQuerySimpleWithNumberGreaterThanFilterBlock(t *testing.T) {
(`{
"Name": "John",
"Age": 21
}`),
(`{
"Name": "Bob",
"Age": 19
}`)},
},
Results: []map[string]interface{}{
Expand Down

0 comments on commit 85a56fe

Please sign in to comment.