Skip to content

Commit

Permalink
Expanded findBreakingChanges test with missing case. (#993)
Browse files Browse the repository at this point in the history
  • Loading branch information
excitement-engineer authored and leebyron committed Aug 14, 2017
1 parent 0779c36 commit 0eb070f
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion src/utilities/__tests__/findBreakingChanges-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,36 @@ describe('findBreakingChanges', () => {
}
});

const interface1 = new GraphQLInterfaceType({
name: 'Interface1',
fields: {
field1: { type: GraphQLString },
},
resolveType: () => null,
});

const typeThatLosesInterfaceOld = new GraphQLObjectType({
name: 'TypeThatGainsInterface1',
interfaces: [
interface1
],
fields: {
field1: {
type: GraphQLString,
},
},
});

const typeThaLosesInterfaceNew = new GraphQLObjectType({
name: 'TypeThatGainsInterface1',
interfaces: [],
fields: {
field1: {
type: GraphQLString,
},
},
});

const oldSchema = new GraphQLSchema({
query: queryType,
types: [
Expand All @@ -1222,7 +1252,8 @@ describe('findBreakingChanges', () => {
typeThatHasBreakingFieldChangesOld,
unionTypeThatLosesATypeOld,
enumTypeThatLosesAValueOld,
argThatChanges
argThatChanges,
typeThatLosesInterfaceOld
]
});

Expand All @@ -1234,6 +1265,8 @@ describe('findBreakingChanges', () => {
unionTypeThatLosesATypeNew,
enumTypeThatLosesAValueNew,
argChanged,
typeThaLosesInterfaceNew,
interface1
]
});

Expand Down Expand Up @@ -1279,6 +1312,11 @@ describe('findBreakingChanges', () => {
description: 'ArgThatChanges.field1 arg id has changed ' +
'type from Int to String',
},
{
type: BreakingChangeType.INTERFACE_REMOVED_FROM_OBJECT,
description: 'TypeThatGainsInterface1 no longer implements ' +
'interface Interface1.',
}
];
expect(findBreakingChanges(oldSchema, newSchema)).to.eql(
expectedBreakingChanges
Expand Down

0 comments on commit 0eb070f

Please sign in to comment.