Skip to content

Commit

Permalink
Remove duplicate fields test
Browse files Browse the repository at this point in the history
  • Loading branch information
Enrico committed Feb 28, 2020
1 parent d7e68bb commit e1416b5
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions core/src/test/scala/caliban/validation/ValidationSchemaSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,7 @@ object ValidationSchemaSpec
assertM(gql.interpreter.run, fails[ValidationError](hasField("msg", _.msg, equalTo(expectedMessage))))

suite("ValidationSchemaSpec")({
def checkInputObject(
__type: __Type,
expectedMessage: String
) = {
val validate = Validator.validateSchema(RootType(__Type(kind = SCALAR), Some(__type), None))
assertM(validate.run, fails[ValidationError](hasField("msg", _.msg, equalTo(expectedMessage))))
}

def inputValue(name: String, t: __Type): __InputValue =
__InputValue(name = name, `type` = () => t, description = None, defaultValue = None)

def inputObject(inputs: __InputValue*): __Type =
__Type(
name = Some("inputObject"),
kind = INPUT_OBJECT,
inputFields = Some(inputs.toList)
)

suite("InputObjects")(
testM("any input field must have a unique name within an Input Object") {
checkInputObject(
inputObject(inputValue("duplicate", __Type(SCALAR)), inputValue("duplicate", __Type(SCALAR))),
"InputObject has repeated fields: duplicate"
)
},
testM("name can't start with '__'") {
check(
graphQL(resolverWrongMutationUnderscore),
Expand Down

0 comments on commit e1416b5

Please sign in to comment.