Skip to content

Commit e0fb703

Browse files
committed
update tests
1 parent 3d8faca commit e0fb703

File tree

3 files changed

+70
-71
lines changed

3 files changed

+70
-71
lines changed

src/utilities/__tests__/buildASTSchema-test.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ schema {
6868
}
6969
7070
type HelloScalars {
71-
str: String
72-
int: Int
71+
bool: Boolean
7372
float: Float
7473
id: ID
75-
bool: Boolean
74+
int: Int
75+
str: String
7676
}
7777
`;
7878
const output = cycleOutput(body);
@@ -196,11 +196,11 @@ schema {
196196
}
197197
198198
type HelloScalars {
199-
nonNullStr: String!
200-
listOfStrs: [String]
201199
listOfNonNullStrs: [String!]
202-
nonNullListOfStrs: [String]!
200+
listOfStrs: [String]
203201
nonNullListOfNonNullStrs: [String!]!
202+
nonNullListOfStrs: [String]!
203+
nonNullStr: String!
204204
}
205205
`;
206206
const output = cycleOutput(body);
@@ -215,8 +215,8 @@ schema {
215215
}
216216
217217
type Recurse {
218-
str: String
219218
recurse: Recurse
219+
str: String
220220
}
221221
`;
222222
const output = cycleOutput(body);
@@ -250,10 +250,10 @@ schema {
250250
}
251251
252252
type Hello {
253-
str(int: Int): String
253+
booleanToStr(bool: Boolean): String
254254
floatToStr(float: Float): String
255255
idToStr(id: ID): String
256-
booleanToStr(bool: Boolean): String
256+
str(int: Int): String
257257
strToStr(bool: String): String
258258
}
259259
`;
@@ -450,9 +450,9 @@ schema {
450450
}
451451
452452
type HelloScalars {
453-
str: String
454-
int: Int
455453
bool: Boolean
454+
int: Int
455+
str: String
456456
}
457457
458458
type Mutation {
@@ -471,9 +471,9 @@ schema {
471471
}
472472
473473
type HelloScalars {
474-
str: String
475-
int: Int
476474
bool: Boolean
475+
int: Int
476+
str: String
477477
}
478478
479479
type Subscription {
@@ -527,9 +527,9 @@ enum MyEnum {
527527
}
528528
529529
type Query {
530+
enum: MyEnum
530531
field1: String @deprecated
531532
field2: Int @deprecated(reason: "Because I said so")
532-
enum: MyEnum
533533
}
534534
`;
535535
const output = cycleOutput(body);

src/utilities/__tests__/extendSchema-test.js

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ describe('extendSchema', () => {
158158
expect(printSchema(testSchema)).to.equal(originalPrint);
159159
expect(printSchema(extendedSchema)).to.equal(
160160
`type Bar implements SomeInterface {
161+
foo: Foo
161162
name: String
162163
some: SomeInterface
163-
foo: Foo
164164
}
165165
166166
type Biz {
@@ -169,16 +169,16 @@ type Biz {
169169
170170
type Foo implements SomeInterface {
171171
name: String
172+
newField: String
172173
some: SomeInterface
173174
tree: [Foo]!
174-
newField: String
175175
}
176176
177177
type Query {
178178
foo: Foo
179-
someUnion: SomeUnion
180179
someEnum: SomeEnum
181180
someInterface(id: ID!): SomeInterface
181+
someUnion: SomeUnion
182182
}
183183
184184
enum SomeEnum {
@@ -251,9 +251,9 @@ union SomeUnion = Foo | Biz
251251
expect(printSchema(testSchema)).to.equal(originalPrint);
252252
expect(printSchema(extendedSchema)).to.equal(
253253
`type Bar implements SomeInterface {
254+
foo: Foo
254255
name: String
255256
some: SomeInterface
256-
foo: Foo
257257
}
258258
259259
type Biz {
@@ -268,9 +268,9 @@ type Foo implements SomeInterface {
268268
269269
type Query {
270270
foo: Foo
271-
someUnion: SomeUnion
272271
someEnum: SomeEnum
273272
someInterface(id: ID!): SomeInterface
273+
someUnion: SomeUnion
274274
}
275275
276276
enum SomeEnum {
@@ -309,9 +309,9 @@ type Unused {
309309
expect(printSchema(testSchema)).to.equal(originalPrint);
310310
expect(printSchema(extendedSchema)).to.equal(
311311
`type Bar implements SomeInterface {
312+
foo: Foo
312313
name: String
313314
some: SomeInterface
314-
foo: Foo
315315
}
316316
317317
type Biz {
@@ -320,9 +320,9 @@ type Biz {
320320
321321
type Foo implements SomeInterface {
322322
name: String
323+
newField(arg1: String, arg2: NewInputObj!): String
323324
some: SomeInterface
324325
tree: [Foo]!
325-
newField(arg1: String, arg2: NewInputObj!): String
326326
}
327327
328328
input NewInputObj {
@@ -333,9 +333,9 @@ input NewInputObj {
333333
334334
type Query {
335335
foo: Foo
336-
someUnion: SomeUnion
337336
someEnum: SomeEnum
338337
someInterface(id: ID!): SomeInterface
338+
someUnion: SomeUnion
339339
}
340340
341341
enum SomeEnum {
@@ -364,9 +364,9 @@ union SomeUnion = Foo | Biz
364364
expect(printSchema(testSchema)).to.equal(originalPrint);
365365
expect(printSchema(extendedSchema)).to.equal(
366366
`type Bar implements SomeInterface {
367+
foo: Foo
367368
name: String
368369
some: SomeInterface
369-
foo: Foo
370370
}
371371
372372
type Biz {
@@ -375,16 +375,16 @@ type Biz {
375375
376376
type Foo implements SomeInterface {
377377
name: String
378+
newField(arg1: SomeEnum!): SomeEnum
378379
some: SomeInterface
379380
tree: [Foo]!
380-
newField(arg1: SomeEnum!): SomeEnum
381381
}
382382
383383
type Query {
384384
foo: Foo
385-
someUnion: SomeUnion
386385
someEnum: SomeEnum
387386
someInterface(id: ID!): SomeInterface
387+
someUnion: SomeUnion
388388
}
389389
390390
enum SomeEnum {
@@ -414,9 +414,9 @@ union SomeUnion = Foo | Biz
414414
expect(printSchema(testSchema)).to.equal(originalPrint);
415415
expect(printSchema(extendedSchema)).to.equal(
416416
`type Bar implements SomeInterface {
417+
foo: Foo
417418
name: String
418419
some: SomeInterface
419-
foo: Foo
420420
}
421421
422422
type Biz implements SomeInterface {
@@ -433,9 +433,9 @@ type Foo implements SomeInterface {
433433
434434
type Query {
435435
foo: Foo
436-
someUnion: SomeUnion
437436
someEnum: SomeEnum
438437
someInterface(id: ID!): SomeInterface
438+
someUnion: SomeUnion
439439
}
440440
441441
enum SomeEnum {
@@ -490,9 +490,9 @@ union SomeUnion = Foo | Biz
490490
expect(printSchema(testSchema)).to.equal(originalPrint);
491491
expect(printSchema(extendedSchema)).to.equal(
492492
`type Bar implements SomeInterface {
493+
foo: Foo
493494
name: String
494495
some: SomeInterface
495-
foo: Foo
496496
}
497497
498498
type Biz {
@@ -501,14 +501,14 @@ type Biz {
501501
502502
type Foo implements SomeInterface {
503503
name: String
504-
some: SomeInterface
505-
tree: [Foo]!
506-
newObject: NewObject
504+
newEnum: NewEnum
507505
newInterface: NewInterface
508-
newUnion: NewUnion
506+
newObject: NewObject
509507
newScalar: NewScalar
510-
newEnum: NewEnum
511508
newTree: [Foo]!
509+
newUnion: NewUnion
510+
some: SomeInterface
511+
tree: [Foo]!
512512
}
513513
514514
enum NewEnum {
@@ -534,9 +534,9 @@ union NewUnion = NewObject | NewOtherObject
534534
535535
type Query {
536536
foo: Foo
537-
someUnion: SomeUnion
538537
someEnum: SomeEnum
539538
someInterface(id: ID!): SomeInterface
539+
someUnion: SomeUnion
540540
}
541541
542542
enum SomeEnum {
@@ -569,20 +569,20 @@ union SomeUnion = Foo | Biz
569569
expect(printSchema(testSchema)).to.equal(originalPrint);
570570
expect(printSchema(extendedSchema)).to.equal(
571571
`type Bar implements SomeInterface {
572+
foo: Foo
572573
name: String
573574
some: SomeInterface
574-
foo: Foo
575575
}
576576
577577
type Biz {
578578
fizz: String
579579
}
580580
581581
type Foo implements SomeInterface, NewInterface {
582+
baz: String
582583
name: String
583584
some: SomeInterface
584585
tree: [Foo]!
585-
baz: String
586586
}
587587
588588
interface NewInterface {
@@ -591,9 +591,9 @@ interface NewInterface {
591591
592592
type Query {
593593
foo: Foo
594-
someUnion: SomeUnion
595594
someEnum: SomeEnum
596595
someInterface(id: ID!): SomeInterface
596+
someUnion: SomeUnion
597597
}
598598
599599
enum SomeEnum {
@@ -637,18 +637,18 @@ union SomeUnion = Foo | Biz
637637
expect(printSchema(testSchema)).to.equal(originalPrint);
638638
expect(printSchema(extendedSchema)).to.equal(
639639
`type Bar implements SomeInterface {
640+
foo: Foo
640641
name: String
641642
some: SomeInterface
642-
foo: Foo
643643
}
644644
645645
type Biz implements NewInterface, SomeInterface {
646-
fizz: String
647646
buzz: String
647+
fizz: String
648648
name: String
649-
some: SomeInterface
650649
newFieldA: Int
651650
newFieldB: Float
651+
some: SomeInterface
652652
}
653653
654654
type Foo implements SomeInterface {
@@ -663,9 +663,9 @@ interface NewInterface {
663663
664664
type Query {
665665
foo: Foo
666-
someUnion: SomeUnion
667666
someEnum: SomeEnum
668667
someInterface(id: ID!): SomeInterface
668+
someUnion: SomeUnion
669669
}
670670
671671
enum SomeEnum {
@@ -728,13 +728,13 @@ union SomeUnion = Foo | Biz
728728
}
729729
730730
type Query {
731-
queryField: String
732731
newQueryField: Int
732+
queryField: String
733733
}
734734
735735
type Subscription {
736-
subscriptionField: String
737736
newSubscriptionField: Int
737+
subscriptionField: String
738738
}
739739
`);
740740
});

0 commit comments

Comments
 (0)