From 4558f9bba0745139eb241b23e0e5ac191bdfa84d Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Tue, 28 Jan 2020 11:03:27 +0800 Subject: [PATCH] buildClientSchema-test: remove dependency on order of types (#2406) --- src/utilities/__tests__/buildClientSchema-test.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/utilities/__tests__/buildClientSchema-test.js b/src/utilities/__tests__/buildClientSchema-test.js index 74c7ce8f39..3c0559a7dd 100644 --- a/src/utilities/__tests__/buildClientSchema-test.js +++ b/src/utilities/__tests__/buildClientSchema-test.js @@ -891,7 +891,10 @@ describe('Type System: build schema from introspection', () => { const schema = buildSchema(sdl, { assumeValid: true }); const introspection = introspectionFromSchema(schema); - expect(introspection.__schema.types[1]).to.deep.include({ + const fooIntrospection = introspection.__schema.types.find( + type => type.name === 'Foo', + ); + expect(fooIntrospection).to.deep.include({ name: 'Foo', interfaces: [{ kind: 'OBJECT', name: 'Foo', ofType: null }], }); @@ -912,7 +915,10 @@ describe('Type System: build schema from introspection', () => { const schema = buildSchema(sdl, { assumeValid: true }); const introspection = introspectionFromSchema(schema); - expect(introspection.__schema.types[1]).to.deep.include({ + const fooIntrospection = introspection.__schema.types.find( + type => type.name === 'Foo', + ); + expect(fooIntrospection).to.deep.include({ name: 'Foo', possibleTypes: [{ kind: 'UNION', name: 'Foo', ofType: null }], });