Skip to content

Commit 4558f9b

Browse files
buildClientSchema-test: remove dependency on order of types (#2406)
1 parent 4589229 commit 4558f9b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/utilities/__tests__/buildClientSchema-test.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,10 @@ describe('Type System: build schema from introspection', () => {
891891
const schema = buildSchema(sdl, { assumeValid: true });
892892
const introspection = introspectionFromSchema(schema);
893893

894-
expect(introspection.__schema.types[1]).to.deep.include({
894+
const fooIntrospection = introspection.__schema.types.find(
895+
type => type.name === 'Foo',
896+
);
897+
expect(fooIntrospection).to.deep.include({
895898
name: 'Foo',
896899
interfaces: [{ kind: 'OBJECT', name: 'Foo', ofType: null }],
897900
});
@@ -912,7 +915,10 @@ describe('Type System: build schema from introspection', () => {
912915
const schema = buildSchema(sdl, { assumeValid: true });
913916
const introspection = introspectionFromSchema(schema);
914917

915-
expect(introspection.__schema.types[1]).to.deep.include({
918+
const fooIntrospection = introspection.__schema.types.find(
919+
type => type.name === 'Foo',
920+
);
921+
expect(fooIntrospection).to.deep.include({
916922
name: 'Foo',
917923
possibleTypes: [{ kind: 'UNION', name: 'Foo', ofType: null }],
918924
});

0 commit comments

Comments
 (0)