@@ -601,16 +601,133 @@ describe('Type System Printer', () => {
601601 ` ) ;
602602 } ) ;
603603
604- it ( 'Prints an empty description' , ( ) => {
605- const schema = buildSingleFieldSchema ( {
606- type : GraphQLString ,
604+ it ( 'Prints an empty descriptions' , ( ) => {
605+ const args = {
606+ someArg : { description : '' , type : GraphQLString } ,
607+ anotherArg : { description : '' , type : GraphQLString } ,
608+ } ;
609+
610+ const fields = {
611+ someField : { description : '' , type : GraphQLString , args } ,
612+ anotherField : { description : '' , type : GraphQLString , args } ,
613+ } ;
614+
615+ const queryType = new GraphQLObjectType ( {
616+ name : 'Query' ,
607617 description : '' ,
618+ fields,
619+ } ) ;
620+
621+ const scalarType = new GraphQLScalarType ( {
622+ name : 'SomeScalar' ,
623+ description : '' ,
624+ } ) ;
625+
626+ const interfaceType = new GraphQLInterfaceType ( {
627+ name : 'SomeInterface' ,
628+ description : '' ,
629+ fields,
630+ } ) ;
631+
632+ const unionType = new GraphQLUnionType ( {
633+ name : 'SomeUnion' ,
634+ description : '' ,
635+ types : [ queryType ] ,
636+ } ) ;
637+
638+ const enumType = new GraphQLEnumType ( {
639+ name : 'SomeEnum' ,
640+ description : '' ,
641+ values : {
642+ SOME_VALUE : { description : '' } ,
643+ ANOTHER_VALUE : { description : '' } ,
644+ } ,
645+ } ) ;
646+
647+ const someDirective = new GraphQLDirective ( {
648+ name : 'someDirective' ,
649+ description : '' ,
650+ args,
651+ locations : [ DirectiveLocation . QUERY ] ,
652+ } ) ;
653+
654+ const schema = new GraphQLSchema ( {
655+ description : '' ,
656+ query : queryType ,
657+ types : [ scalarType , interfaceType , unionType , enumType ] ,
658+ directives : [ someDirective ] ,
608659 } ) ;
609660
610661 expectPrintedSchema ( schema ) . to . equal ( dedent `
662+ """"""
663+ schema {
664+ query: Query
665+ }
666+
667+ """"""
668+ directive @someDirective(
669+ """"""
670+ someArg: String
671+
672+ """"""
673+ anotherArg: String
674+ ) on QUERY
675+
676+ """"""
677+ scalar SomeScalar
678+
679+ """"""
680+ interface SomeInterface {
681+ """"""
682+ someField(
683+ """"""
684+ someArg: String
685+
686+ """"""
687+ anotherArg: String
688+ ): String
689+
690+ """"""
691+ anotherField(
692+ """"""
693+ someArg: String
694+
695+ """"""
696+ anotherArg: String
697+ ): String
698+ }
699+
700+ """"""
701+ union SomeUnion = Query
702+
703+ """"""
611704 type Query {
612705 """"""
613- singleField: String
706+ someField(
707+ """"""
708+ someArg: String
709+
710+ """"""
711+ anotherArg: String
712+ ): String
713+
714+ """"""
715+ anotherField(
716+ """"""
717+ someArg: String
718+
719+ """"""
720+ anotherArg: String
721+ ): String
722+ }
723+
724+ """"""
725+ enum SomeEnum {
726+ """"""
727+ SOME_VALUE
728+
729+ """"""
730+ ANOTHER_VALUE
614731 }
615732 ` ) ;
616733 } ) ;
0 commit comments