Last active
May 30, 2018 15:57
-
-
Save aofleejay/d34df8825e8a1952c495d725dd60cade to your computer and use it in GitHub Desktop.
Test Character type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { GraphQLString, GraphQLNonNull } from 'graphql' | |
import { expect } from 'chai' | |
import rootSchema from '../../src/schemas/rootSchema' | |
describe('Test schema', () => { | |
it('has correct character schema', () => { | |
const characterSchema = rootSchema.getTypeMap().Character.getFields() | |
expect(characterSchema).to.have.property('name') | |
expect(characterSchema.name.type).to.deep.equals(GraphQLString) | |
expect(characterSchema).to.have.property('id') | |
expect(characterSchema.id.type).to.deep.equals(new GraphQLNonNull(GraphQLString)) | |
expect(characterSchema).to.have.property('gender') | |
expect(characterSchema.gender.type).to.deep.equals(rootSchema.getTypeMap().Gender) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment