@@ -142,50 +142,98 @@ describe('findBreakingChanges', () => {
142
142
type : BreakingChangeType . FIELD_CHANGED_KIND ,
143
143
description : 'Type1.field3 changed type from String to Boolean.' ,
144
144
} ) ;
145
+ // $FlowFixMe
146
+ expect ( changes [ 1 ] . oldNode . type . name . value ) . to . equal ( 'String' ) ;
147
+ // $FlowFixMe
148
+ expect ( changes [ 1 ] . newNode . type . name . value ) . to . equal ( 'Boolean' ) ;
145
149
expect ( changes [ 2 ] ) . to . deep . include ( {
146
150
type : BreakingChangeType . FIELD_CHANGED_KIND ,
147
151
description : 'Type1.field4 changed type from TypeA to TypeB.' ,
148
152
} ) ;
153
+ // $FlowFixMe
154
+ expect ( changes [ 2 ] . oldNode . type . name . value ) . to . equal ( 'TypeA' ) ;
155
+ // $FlowFixMe
156
+ expect ( changes [ 2 ] . newNode . type . name . value ) . to . equal ( 'TypeB' ) ;
149
157
expect ( changes [ 3 ] ) . to . deep . include ( {
150
158
type : BreakingChangeType . FIELD_CHANGED_KIND ,
151
159
description : 'Type1.field6 changed type from String to [String].' ,
152
160
} ) ;
161
+ // $FlowFixMe
162
+ expect ( changes [ 3 ] . oldNode . type . name . value ) . to . equal ( 'String' ) ;
163
+ // $FlowFixMe
164
+ expect ( changes [ 3 ] . newNode . type . kind ) . to . equal ( 'ListType' ) ;
153
165
expect ( changes [ 4 ] ) . to . deep . include ( {
154
166
type : BreakingChangeType . FIELD_CHANGED_KIND ,
155
167
description : 'Type1.field7 changed type from [String] to String.' ,
156
168
} ) ;
169
+ // $FlowFixMe
170
+ expect ( changes [ 4 ] . oldNode . type . kind ) . to . equal ( 'ListType' ) ;
171
+ // $FlowFixMe
172
+ expect ( changes [ 4 ] . newNode . type . name . value ) . to . equal ( 'String' ) ;
157
173
expect ( changes [ 5 ] ) . to . deep . include ( {
158
174
type : BreakingChangeType . FIELD_CHANGED_KIND ,
159
175
description : 'Type1.field9 changed type from Int! to Int.' ,
160
176
} ) ;
177
+ // $FlowFixMe
178
+ expect ( changes [ 5 ] . oldNode . type . kind ) . to . equal ( 'NonNullType' ) ;
179
+ // $FlowFixMe
180
+ expect ( changes [ 5 ] . newNode . type . name . value ) . to . equal ( 'Int' ) ;
161
181
expect ( changes [ 6 ] ) . to . deep . include ( {
162
182
type : BreakingChangeType . FIELD_CHANGED_KIND ,
163
183
description : 'Type1.field10 changed type from [Int]! to [Int].' ,
164
184
} ) ;
185
+ // $FlowFixMe
186
+ expect ( changes [ 6 ] . oldNode . type . kind ) . to . equal ( 'NonNullType' ) ;
187
+ // $FlowFixMe
188
+ expect ( changes [ 6 ] . newNode . type . kind ) . to . equal ( 'ListType' ) ;
165
189
expect ( changes [ 7 ] ) . to . deep . include ( {
166
190
type : BreakingChangeType . FIELD_CHANGED_KIND ,
167
191
description : 'Type1.field11 changed type from Int to [Int]!.' ,
168
192
} ) ;
193
+ // $FlowFixMe
194
+ expect ( changes [ 7 ] . oldNode . type . name . value ) . to . equal ( 'Int' ) ;
195
+ // $FlowFixMe
196
+ expect ( changes [ 7 ] . newNode . type . kind ) . to . equal ( 'NonNullType' ) ;
169
197
expect ( changes [ 8 ] ) . to . deep . include ( {
170
198
type : BreakingChangeType . FIELD_CHANGED_KIND ,
171
199
description : 'Type1.field13 changed type from [Int!] to [Int].' ,
172
200
} ) ;
201
+ // $FlowFixMe
202
+ expect ( changes [ 8 ] . oldNode . type . type . kind ) . to . equal ( 'NonNullType' ) ;
203
+ // $FlowFixMe
204
+ expect ( changes [ 8 ] . newNode . type . kind ) . to . equal ( 'ListType' ) ;
173
205
expect ( changes [ 9 ] ) . to . deep . include ( {
174
206
type : BreakingChangeType . FIELD_CHANGED_KIND ,
175
207
description : 'Type1.field14 changed type from [Int] to [[Int]].' ,
176
208
} ) ;
209
+ // $FlowFixMe
210
+ expect ( changes [ 9 ] . oldNode . type . type . name . value ) . to . equal ( 'Int' ) ;
211
+ // $FlowFixMe
212
+ expect ( changes [ 9 ] . newNode . type . type . kind ) . to . equal ( 'ListType' ) ;
177
213
expect ( changes [ 10 ] ) . to . deep . include ( {
178
214
type : BreakingChangeType . FIELD_CHANGED_KIND ,
179
215
description : 'Type1.field15 changed type from [[Int]] to [Int].' ,
180
216
} ) ;
217
+ // $FlowFixMe
218
+ expect ( changes [ 10 ] . oldNode . type . type . kind ) . to . equal ( 'ListType' ) ;
219
+ // $FlowFixMe
220
+ expect ( changes [ 10 ] . newNode . type . type . name . value ) . to . equal ( 'Int' ) ;
181
221
expect ( changes [ 11 ] ) . to . deep . include ( {
182
222
type : BreakingChangeType . FIELD_CHANGED_KIND ,
183
223
description : 'Type1.field16 changed type from Int! to [Int]!.' ,
184
224
} ) ;
225
+ // $FlowFixMe
226
+ expect ( changes [ 11 ] . oldNode . type . type . name . value ) . to . equal ( 'Int' ) ;
227
+ // $FlowFixMe
228
+ expect ( changes [ 11 ] . newNode . type . type . kind ) . to . equal ( 'ListType' ) ;
185
229
expect ( changes [ 12 ] ) . to . deep . include ( {
186
230
type : BreakingChangeType . FIELD_CHANGED_KIND ,
187
231
description : 'Type1.field18 changed type from [[Int!]!] to [[Int!]].' ,
188
232
} ) ;
233
+ // $FlowFixMe
234
+ expect ( changes [ 12 ] . oldNode . type . type . kind ) . to . equal ( 'NonNullType' ) ;
235
+ // $FlowFixMe
236
+ expect ( changes [ 12 ] . newNode . type . type . kind ) . to . equal ( 'ListType' ) ;
189
237
} ) ;
190
238
191
239
it ( 'should detect if fields on input types changed kind or were removed' , ( ) => {
0 commit comments