Skip to content

Commit

Permalink
revert schema fixture change
Browse files Browse the repository at this point in the history
  • Loading branch information
nasdf committed Sep 20, 2024
1 parent 17b7482 commit 5727a12
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 41 deletions.
1 change: 0 additions & 1 deletion tests/integration/query/simple/with_filter/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ var userCollectionGQLSchema = (`
HeightM: Float
Verified: Boolean
CreatedAt: DateTime
FavoriteNumbers: [Int!]
}
`)

Expand Down
8 changes: 7 additions & 1 deletion tests/integration/query/simple/with_filter/with_and_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ func TestQuerySimple_WithInlineIntArray_GreaterThanAndLessThanFilter_Succeeds(t
test := testUtils.TestCase{
Description: "Simple query with logical compound filter (and) on inline int array",
Actions: []any{
testUtils.SchemaUpdate{
Schema: `type Users {
Name: String
FavoriteNumbers: [Int!]
}`,
},
testUtils.CreateDoc{
Doc: `{
"Name": "Bob",
Expand Down Expand Up @@ -106,5 +112,5 @@ func TestQuerySimple_WithInlineIntArray_GreaterThanAndLessThanFilter_Succeeds(t
},
}

executeTestCase(t, test)
testUtils.ExecuteTestCase(t, test)
}
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ func TestQuerySimpleWithDateTimeGEFilterBlockWithNilValue(t *testing.T) {
Results: map[string]any{
"Users": []map[string]any{
{
"Name": "John",
"Name": "Bob",
},
{
"Name": "Bob",
"Name": "John",
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ func TestQuerySimpleWithHeightMGEFilterBlockWithNilValue(t *testing.T) {
Results: map[string]any{
"Users": []map[string]any{
{
"Name": "Bob",
"Name": "John",
},
{
"Name": "John",
"Name": "Bob",
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ func TestQuerySimpleWithIntGEFilterBlockWithNilValue(t *testing.T) {
Results: map[string]any{
"Users": []map[string]any{
{
"Name": "John",
"Name": "Bob",
},
{
"Name": "Bob",
"Name": "John",
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ func TestQuerySimpleWithFloatGreaterThanFilterBlock(t *testing.T) {
Results: map[string]any{
"Users": []map[string]any{
{
"Name": "Bob",
"Name": "John",
},
{
"Name": "John",
"Name": "Bob",
},
},
},
Expand Down
16 changes: 8 additions & 8 deletions tests/integration/query/simple/with_filter/with_in_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ func TestQuerySimpleWithIntInFilter(t *testing.T) {
}`,
Results: map[string]any{
"Users": []map[string]any{
{
"Name": "Alice",
"Age": int64(19),
},
{
"Name": "Carlo",
"Age": int64(55),
},
{
"Name": "Alice",
"Age": int64(19),
},
},
},
},
Expand Down Expand Up @@ -164,16 +164,16 @@ func TestQuerySimpleWithIntInFilterWithNullValue(t *testing.T) {
Results: map[string]any{
"Users": []map[string]any{
{
"Name": "Alice",
"Age": int64(19),
"Name": "Fred",
"Age": nil,
},
{
"Name": "Carlo",
"Age": int64(55),
},
{
"Name": "Fred",
"Age": nil,
"Name": "Alice",
"Age": int64(19),
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ func TestQuerySimpleWithBoolNotEqualsNilFilterBlock(t *testing.T) {
Results: map[string]any{
"Users": []map[string]any{
{
"Name": "Fred",
"Name": "John",
},
{
"Name": "John",
"Name": "Fred",
},
},
},
Expand Down Expand Up @@ -134,10 +134,10 @@ func TestQuerySimpleWithBoolNotEqualsFalseFilterBlock(t *testing.T) {
Results: map[string]any{
"Users": []map[string]any{
{
"Name": "Bob",
"Name": "John",
},
{
"Name": "John",
"Name": "Bob",
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ func TestQuerySimpleWithDateTimeNotEqualsNilFilterBlock(t *testing.T) {
Results: map[string]any{
"Users": []map[string]any{
{
"Name": "John",
"Name": "Bob",
},
{
"Name": "Bob",
"Name": "John",
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ func TestQuerySimpleWithFloatNotEqualsNilFilterBlock(t *testing.T) {
Results: map[string]any{
"Users": []map[string]any{
{
"Name": "Bob",
"Name": "John",
},
{
"Name": "John",
"Name": "Bob",
},
},
},
Expand Down
16 changes: 8 additions & 8 deletions tests/integration/query/simple/with_filter/with_not_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ func TestQuerySimple_WithNotEqualToXFilter_NoError(t *testing.T) {
"Name": "John",
"Age": int64(21),
},
{
"Name": "Alice",
"Age": int64(19),
},
{
"Name": "Bob",
"Age": int64(32),
},
{
"Name": "Alice",
"Age": int64(19),
},
},
},
},
Expand Down Expand Up @@ -270,10 +270,6 @@ func TestQuerySimple_WithNotEqualToXAndNotYFilter_NoError(t *testing.T) {
"Name": "John",
"Age": int64(21),
},
{
"Name": "Alice",
"Age": int64(19),
},
{
"Name": "Bob",
"Age": int64(32),
Expand All @@ -282,6 +278,10 @@ func TestQuerySimple_WithNotEqualToXAndNotYFilter_NoError(t *testing.T) {
"Name": "Carlo",
"Age": int64(55),
},
{
"Name": "Alice",
"Age": int64(19),
},
},
},
},
Expand Down
20 changes: 13 additions & 7 deletions tests/integration/query/simple/with_filter/with_or_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ func TestQuerySimpleWithIntEqualToXOrYFilter(t *testing.T) {
}`,
Results: map[string]any{
"Users": []map[string]any{
{
"Name": "Alice",
"Age": int64(19),
},
{
"Name": "Carlo",
"Age": int64(55),
},
{
"Name": "Alice",
"Age": int64(19),
},
},
},
},
Expand All @@ -74,6 +74,12 @@ func TestQuerySimple_WithInlineIntArray_EqualToXOrYFilter_Succeeds(t *testing.T)
test := testUtils.TestCase{
Description: "Simple query with logical compound filter (or) on inline int array",
Actions: []any{
testUtils.SchemaUpdate{
Schema: `type Users {
Name: String
FavoriteNumbers: [Int!]
}`,
},
testUtils.CreateDoc{
Doc: `{
"Name": "Bob",
Expand All @@ -98,16 +104,16 @@ func TestQuerySimple_WithInlineIntArray_EqualToXOrYFilter_Succeeds(t *testing.T)
Results: map[string]any{
"Users": []map[string]any{
{
"Name": "Bob",
"Name": "Alice",
},
{
"Name": "Alice",
"Name": "Bob",
},
},
},
},
},
}

executeTestCase(t, test)
testUtils.ExecuteTestCase(t, test)
}

0 comments on commit 5727a12

Please sign in to comment.