File tree 2 files changed +16
-33
lines changed 2 files changed +16
-33
lines changed Original file line number Diff line number Diff line change @@ -540,29 +540,18 @@ describe('Schema Builder', () => {
540
540
const ast = parse ( body ) ;
541
541
const schema = buildASTSchema ( ast ) ;
542
542
543
- expect ( schema . getType ( 'MyEnum' ) . getValues ( ) ) . to . deep . equal ( [
544
- {
545
- name : 'VALUE' ,
546
- description : '' ,
547
- isDeprecated : false ,
548
- deprecationReason : undefined ,
549
- value : 'VALUE'
550
- } ,
551
- {
552
- name : 'OLD_VALUE' ,
553
- description : '' ,
554
- isDeprecated : true ,
555
- deprecationReason : 'No longer supported' ,
556
- value : 'OLD_VALUE'
557
- } ,
558
- {
559
- name : 'OTHER_VALUE' ,
560
- description : '' ,
561
- isDeprecated : true ,
562
- deprecationReason : 'Terrible reasons' ,
563
- value : 'OTHER_VALUE'
564
- }
565
- ] ) ;
543
+ const myEnum = schema . getType ( 'MyEnum' ) ;
544
+
545
+ const value = myEnum . getValue ( 'VALUE' ) ;
546
+ expect ( value . isDeprecated ) . to . equal ( false ) ;
547
+
548
+ const oldValue = myEnum . getValue ( 'OLD_VALUE' ) ;
549
+ expect ( oldValue . isDeprecated ) . to . equal ( true ) ;
550
+ expect ( oldValue . deprecationReason ) . to . equal ( 'No longer supported' ) ;
551
+
552
+ const otherValue = myEnum . getValue ( 'OTHER_VALUE' ) ;
553
+ expect ( otherValue . isDeprecated ) . to . equal ( true ) ;
554
+ expect ( otherValue . deprecationReason ) . to . equal ( 'Terrible reasons' ) ;
566
555
567
556
const rootFields = schema . getType ( 'Query' ) . getFields ( ) ;
568
557
expect ( rootFields . field1 . isDeprecated ) . to . equal ( true ) ;
Original file line number Diff line number Diff line change @@ -215,16 +215,10 @@ describe('extendSchema', () => {
215
215
expect ( deprecatedFieldDef . deprecationReason ) . to . equal ( 'not used anymore' ) ;
216
216
217
217
const deprecatedEnumDef = extendedSchema
218
- . getType ( 'EnumWithDeprecatedValue' ) ;
219
- expect ( deprecatedEnumDef . getValues ( ) ) . to . deep . equal ( [
220
- {
221
- name : 'DEPRECATED' ,
222
- description : '' ,
223
- isDeprecated : true ,
224
- deprecationReason : 'do not use' ,
225
- value : 'DEPRECATED'
226
- }
227
- ] ) ;
218
+ . getType ( 'EnumWithDeprecatedValue' )
219
+ . getValue ( 'DEPRECATED' ) ;
220
+ expect ( deprecatedEnumDef . isDeprecated ) . to . equal ( true ) ;
221
+ expect ( deprecatedEnumDef . deprecationReason ) . to . equal ( 'do not use' ) ;
228
222
} ) ;
229
223
230
224
it ( 'extends objects with deprecated fields' , ( ) => {
You can’t perform that action at this time.
0 commit comments