Skip to content

Commit 9929e9f

Browse files
spawniaIvanGoncharov
authored andcommitted
Vary the test case for building client schemas with enum (#2254)
Instead of repeating basically the same enum value five times, I changed the test to be less repetitive but have more variance in test scenarios.
1 parent 96132b2 commit 9929e9f

File tree

1 file changed

+5
-32
lines changed

1 file changed

+5
-32
lines changed

src/utilities/__tests__/buildClientSchema-test.js

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -341,20 +341,11 @@ describe('Type System: build schema from introspection', () => {
341341
value: 1,
342342
},
343343
FRUITS: {
344-
description: 'Foods that are fruits.',
345344
value: 2,
346345
},
347346
OILS: {
348-
description: 'Foods that are oils.',
349347
value: 3,
350-
},
351-
DAIRY: {
352-
description: 'Foods that are dairy.',
353-
value: 4,
354-
},
355-
MEAT: {
356-
description: 'Foods that are meat.',
357-
value: 5,
348+
deprecationReason: 'Too fatty',
358349
},
359350
},
360351
});
@@ -399,7 +390,7 @@ describe('Type System: build schema from introspection', () => {
399390
},
400391
{
401392
name: 'FRUITS',
402-
description: 'Foods that are fruits.',
393+
description: null,
403394
value: 'FRUITS',
404395
isDeprecated: false,
405396
deprecationReason: null,
@@ -408,28 +399,10 @@ describe('Type System: build schema from introspection', () => {
408399
},
409400
{
410401
name: 'OILS',
411-
description: 'Foods that are oils.',
402+
description: null,
412403
value: 'OILS',
413-
isDeprecated: false,
414-
deprecationReason: null,
415-
extensions: undefined,
416-
astNode: undefined,
417-
},
418-
{
419-
name: 'DAIRY',
420-
description: 'Foods that are dairy.',
421-
value: 'DAIRY',
422-
isDeprecated: false,
423-
deprecationReason: null,
424-
extensions: undefined,
425-
astNode: undefined,
426-
},
427-
{
428-
name: 'MEAT',
429-
description: 'Foods that are meat.',
430-
value: 'MEAT',
431-
isDeprecated: false,
432-
deprecationReason: null,
404+
isDeprecated: true,
405+
deprecationReason: 'Too fatty',
433406
extensions: undefined,
434407
astNode: undefined,
435408
},

0 commit comments

Comments
 (0)