Skip to content

Commit e02cf5a

Browse files
committed
FIELD_CHANGED_KIND was updated in both implem and test
1 parent 23c29c5 commit e02cf5a

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

src/utilities/__tests__/findBreakingChanges-test.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,50 +142,98 @@ describe('findBreakingChanges', () => {
142142
type: BreakingChangeType.FIELD_CHANGED_KIND,
143143
description: 'Type1.field3 changed type from String to Boolean.',
144144
});
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');
145149
expect(changes[2]).to.deep.include({
146150
type: BreakingChangeType.FIELD_CHANGED_KIND,
147151
description: 'Type1.field4 changed type from TypeA to TypeB.',
148152
});
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');
149157
expect(changes[3]).to.deep.include({
150158
type: BreakingChangeType.FIELD_CHANGED_KIND,
151159
description: 'Type1.field6 changed type from String to [String].',
152160
});
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');
153165
expect(changes[4]).to.deep.include({
154166
type: BreakingChangeType.FIELD_CHANGED_KIND,
155167
description: 'Type1.field7 changed type from [String] to String.',
156168
});
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');
157173
expect(changes[5]).to.deep.include({
158174
type: BreakingChangeType.FIELD_CHANGED_KIND,
159175
description: 'Type1.field9 changed type from Int! to Int.',
160176
});
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');
161181
expect(changes[6]).to.deep.include({
162182
type: BreakingChangeType.FIELD_CHANGED_KIND,
163183
description: 'Type1.field10 changed type from [Int]! to [Int].',
164184
});
185+
// $FlowFixMe
186+
expect(changes[6].oldNode.type.kind).to.equal('NonNullType');
187+
// $FlowFixMe
188+
expect(changes[6].newNode.type.kind).to.equal('ListType');
165189
expect(changes[7]).to.deep.include({
166190
type: BreakingChangeType.FIELD_CHANGED_KIND,
167191
description: 'Type1.field11 changed type from Int to [Int]!.',
168192
});
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');
169197
expect(changes[8]).to.deep.include({
170198
type: BreakingChangeType.FIELD_CHANGED_KIND,
171199
description: 'Type1.field13 changed type from [Int!] to [Int].',
172200
});
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');
173205
expect(changes[9]).to.deep.include({
174206
type: BreakingChangeType.FIELD_CHANGED_KIND,
175207
description: 'Type1.field14 changed type from [Int] to [[Int]].',
176208
});
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');
177213
expect(changes[10]).to.deep.include({
178214
type: BreakingChangeType.FIELD_CHANGED_KIND,
179215
description: 'Type1.field15 changed type from [[Int]] to [Int].',
180216
});
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');
181221
expect(changes[11]).to.deep.include({
182222
type: BreakingChangeType.FIELD_CHANGED_KIND,
183223
description: 'Type1.field16 changed type from Int! to [Int]!.',
184224
});
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');
185229
expect(changes[12]).to.deep.include({
186230
type: BreakingChangeType.FIELD_CHANGED_KIND,
187231
description: 'Type1.field18 changed type from [[Int!]!] to [[Int!]].',
188232
});
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');
189237
});
190238

191239
it('should detect if fields on input types changed kind or were removed', () => {

0 commit comments

Comments
 (0)