Skip to content

Commit 91e28d5

Browse files
chore(GraphQL): remove skipped tests (#6078)
Fixes GRAPHQL-562.
1 parent 3f91f29 commit 91e28d5

File tree

3 files changed

+2
-101
lines changed

3 files changed

+2
-101
lines changed

graphql/e2e/custom_logic/cmd/graphqlresponse.yaml

-18
Original file line numberDiff line numberDiff line change
@@ -437,24 +437,6 @@
437437
getPosts(input: [PostFilterInput]): [Post!]
438438
}
439439
440-
- name: getPostswithLike
441-
schema: |
442-
input PostFilterInput{
443-
id: ID!
444-
text: String!
445-
likes: Int
446-
}
447-
448-
type Post {
449-
id: ID!
450-
text: String
451-
comments: Post!
452-
}
453-
454-
type Query{
455-
getPosts(input: [PostFilterInput]): [Post!]
456-
}
457-
458440
- name: "carsschema"
459441
schema: |
460442
type Car {

graphql/e2e/custom_logic/cmd/main.go

-14
Original file line numberDiff line numberDiff line change
@@ -595,19 +595,6 @@ func getPosts(w http.ResponseWriter, r *http.Request) {
595595
check2(fmt.Fprint(w, generateIntrospectionResult(graphqlResponses["getPosts"].Schema)))
596596
}
597597

598-
func getPostswithLike(w http.ResponseWriter, r *http.Request) {
599-
_, err := verifyGraphqlRequest(r, expectedGraphqlRequest{
600-
urlSuffix: "/getPostswithLike",
601-
body: ``,
602-
})
603-
if err != nil {
604-
check2(w.Write([]byte(err.Error())))
605-
return
606-
}
607-
608-
check2(fmt.Fprint(w, generateIntrospectionResult(graphqlResponses["getPostswithLike"].Schema)))
609-
}
610-
611598
type input struct {
612599
ID string `json:"uid"`
613600
}
@@ -1229,7 +1216,6 @@ func main() {
12291216
bsch := graphql.MustParseSchema(graphqlResponses["batchOperationSchema"].Schema, &query{})
12301217
bh := &relay.Handler{Schema: bsch}
12311218
http.HandleFunc("/getPosts", getPosts)
1232-
http.HandleFunc("/getPostswithLike", getPostswithLike)
12331219
http.Handle("/gqlUserNames", bh)
12341220
http.Handle("/gqlCars", bh)
12351221
http.HandleFunc("/gqlCarsWithErrors", gqlCarsWithErrorHandler)

graphql/e2e/custom_logic/custom_logic_test.go

+2-69
Original file line numberDiff line numberDiff line change
@@ -2001,51 +2001,6 @@ func TestCustomGraphqlMissingTypeForBatchedFieldInput(t *testing.T) {
20012001
"PostFilterInput.\n")
20022002
}
20032003

2004-
func TestCustomGraphqlInvalidArgForBatchedField(t *testing.T) {
2005-
t.Skip()
2006-
schema := `
2007-
type Post {
2008-
id: ID!
2009-
text: String
2010-
comments: Post! @custom(http: {
2011-
url: "http://mock:8888/getPosts",
2012-
method: "POST",
2013-
mode: BATCH
2014-
graphql: "query { getPosts(input: [{name: $id}]) }"
2015-
})
2016-
}
2017-
`
2018-
res := updateSchema(t, schema)
2019-
require.Equal(t, `{"updateGQLSchema":null}`, string(res.Data))
2020-
require.Len(t, res.Errors, 1)
2021-
require.Equal(t, "resolving updateGQLSchema failed because input:9: Type Post"+
2022-
"; Field comments: inside graphql in @custom directive, argument `name` is not present "+
2023-
"in remote query `getPosts`.\n", res.Errors[0].Error())
2024-
}
2025-
2026-
func TestCustomGraphqlArgTypeMismatchForBatchedField(t *testing.T) {
2027-
t.Skip()
2028-
schema := `
2029-
type Post {
2030-
id: ID!
2031-
likes: Int
2032-
text: String
2033-
comments: Post! @custom(http: {
2034-
url: "http://mock:8888/getPostswithLike",
2035-
method: "POST",
2036-
mode: BATCH
2037-
graphql: "query { getPosts(input: [{id: $id, text: $likes}]) }"
2038-
})
2039-
}
2040-
`
2041-
res := updateSchema(t, schema)
2042-
require.Equal(t, `{"updateGQLSchema":null}`, string(res.Data))
2043-
require.Len(t, res.Errors, 1)
2044-
require.Equal(t, "resolving updateGQLSchema failed because input:10: Type Post"+
2045-
"; Field comments: inside graphql in @custom directive, found type mismatch for variable"+
2046-
" `$likes` in query `getPosts`, expected `Int`, got `String!`.\n", res.Errors[0].Error())
2047-
}
2048-
20492004
func TestCustomGraphqlMissingRequiredArgument(t *testing.T) {
20502005
schema := `
20512006
type Country @remote {
@@ -2086,28 +2041,6 @@ func TestCustomGraphqlMissingRequiredArgument(t *testing.T) {
20862041
" `setCountry` is missing, it is required by remote mutation.")
20872042
}
20882043

2089-
func TestCustomGraphqlMissingRequiredArgumentForBatchedField(t *testing.T) {
2090-
t.Skip()
2091-
schema := `
2092-
type Post {
2093-
id: ID!
2094-
text: String
2095-
comments: Post! @custom(http: {
2096-
url: "http://mock:8888/getPosts",
2097-
method: "POST",
2098-
mode: BATCH
2099-
graphql: "query { getPosts(input: [{id: $id}]) }"
2100-
})
2101-
}
2102-
`
2103-
res := updateSchema(t, schema)
2104-
require.Equal(t, `{"updateGQLSchema":null}`, string(res.Data))
2105-
require.Len(t, res.Errors, 1)
2106-
require.Equal(t, "resolving updateGQLSchema failed because input:9: Type Post"+
2107-
"; Field comments: inside graphql in @custom directive, argument `text` in query "+
2108-
"`getPosts` is missing, it is required by remote query.\n", res.Errors[0].Error())
2109-
}
2110-
21112044
// this one accepts an object and returns an object
21122045
func TestCustomGraphqlMutation1(t *testing.T) {
21132046
schema := `
@@ -2458,7 +2391,7 @@ func TestRestCustomLogicInDeepNestedField(t *testing.T) {
24582391

24592392
result = params.ExecuteAsPost(t, alphaURL)
24602393
common.RequireNoGQLErrors(t, result)
2461-
require.JSONEq(t, string(result.Data), `
2394+
testutil.CompareJSON(t, `
24622395
{
24632396
"querySearchTweets": [
24642397
{
@@ -2479,5 +2412,5 @@ func TestRestCustomLogicInDeepNestedField(t *testing.T) {
24792412
}
24802413
}
24812414
]
2482-
}`)
2415+
}`, string(result.Data))
24832416
}

0 commit comments

Comments
 (0)