@@ -618,16 +618,133 @@ describe('Type System Printer', () => {
618618 ` ) ;
619619 } ) ;
620620
621- it ( 'Prints an empty description' , ( ) => {
622- const schema = buildSingleFieldSchema ( {
623- type : GraphQLString ,
621+ it ( 'Prints an empty descriptions' , ( ) => {
622+ const args = {
623+ someArg : { description : '' , type : GraphQLString } ,
624+ anotherArg : { description : '' , type : GraphQLString } ,
625+ } ;
626+
627+ const fields = {
628+ someField : { description : '' , type : GraphQLString , args } ,
629+ anotherField : { description : '' , type : GraphQLString , args } ,
630+ } ;
631+
632+ const queryType = new GraphQLObjectType ( {
633+ name : 'Query' ,
624634 description : '' ,
635+ fields,
636+ } ) ;
637+
638+ const scalarType = new GraphQLScalarType ( {
639+ name : 'SomeScalar' ,
640+ description : '' ,
641+ } ) ;
642+
643+ const interfaceType = new GraphQLInterfaceType ( {
644+ name : 'SomeInterface' ,
645+ description : '' ,
646+ fields,
647+ } ) ;
648+
649+ const unionType = new GraphQLUnionType ( {
650+ name : 'SomeUnion' ,
651+ description : '' ,
652+ types : [ queryType ] ,
653+ } ) ;
654+
655+ const enumType = new GraphQLEnumType ( {
656+ name : 'SomeEnum' ,
657+ description : '' ,
658+ values : {
659+ SOME_VALUE : { description : '' } ,
660+ ANOTHER_VALUE : { description : '' } ,
661+ } ,
662+ } ) ;
663+
664+ const someDirective = new GraphQLDirective ( {
665+ name : 'someDirective' ,
666+ description : '' ,
667+ args,
668+ locations : [ DirectiveLocation . QUERY ] ,
669+ } ) ;
670+
671+ const schema = new GraphQLSchema ( {
672+ description : '' ,
673+ query : queryType ,
674+ types : [ scalarType , interfaceType , unionType , enumType ] ,
675+ directives : [ someDirective ] ,
625676 } ) ;
626677
627678 expectPrintedSchema ( schema ) . to . equal ( dedent `
679+ """"""
680+ schema {
681+ query: Query
682+ }
683+
684+ """"""
685+ directive @someDirective(
686+ """"""
687+ someArg: String
688+
689+ """"""
690+ anotherArg: String
691+ ) on QUERY
692+
693+ """"""
694+ scalar SomeScalar
695+
696+ """"""
697+ interface SomeInterface {
698+ """"""
699+ someField(
700+ """"""
701+ someArg: String
702+
703+ """"""
704+ anotherArg: String
705+ ): String
706+
707+ """"""
708+ anotherField(
709+ """"""
710+ someArg: String
711+
712+ """"""
713+ anotherArg: String
714+ ): String
715+ }
716+
717+ """"""
718+ union SomeUnion = Query
719+
720+ """"""
628721 type Query {
629722 """"""
630- singleField: String
723+ someField(
724+ """"""
725+ someArg: String
726+
727+ """"""
728+ anotherArg: String
729+ ): String
730+
731+ """"""
732+ anotherField(
733+ """"""
734+ someArg: String
735+
736+ """"""
737+ anotherArg: String
738+ ): String
739+ }
740+
741+ """"""
742+ enum SomeEnum {
743+ """"""
744+ SOME_VALUE
745+
746+ """"""
747+ ANOTHER_VALUE
631748 }
632749 ` ) ;
633750 } ) ;
0 commit comments