Created
September 28, 2017 13:13
-
-
Save ddialar/dad29948173cf3f4dd619b21ed2ee586 to your computer and use it in GitHub Desktop.
This file contains 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 'jest'; | |
import * as graphql from 'graphql'; | |
import * as EmailAddressType from '../../../src/graphql/models/email.address.type'; | |
describe('Testing EmailAddressType ...', () => { | |
test('fields integrity when it is used as \'ObjectType\'.', () => { | |
let emailAddressFields = EmailAddressType.ObjectType.getFields(); | |
expect(emailAddressFields).toHaveProperty('email'); | |
expect(emailAddressFields.email.type).toMatchObject(new graphql.GraphQLNonNull(graphql.GraphQLString)); | |
expect(emailAddressFields).toHaveProperty('description'); | |
expect(emailAddressFields.description.type).toMatchObject(graphql.GraphQLString); | |
}); | |
test('fields integrity when it is used as \'InputType\'.', () => { | |
let emailAddressFields = EmailAddressType.InputType.getFields(); | |
expect(emailAddressFields).toHaveProperty('email'); | |
expect(emailAddressFields.email.type).toMatchObject(new graphql.GraphQLNonNull(graphql.GraphQLString)); | |
expect(emailAddressFields).toHaveProperty('description'); | |
expect(emailAddressFields.description.type).toMatchObject(graphql.GraphQLString); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment