Created
September 28, 2017 12:30
-
-
Save ddialar/9a78e3013b1721abacd01f61a41a2af1 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 PhoneNumberType from '../../../src/graphql/models/phone.number.type'; | |
describe('Testing PhoneNumberType ...', () => { | |
test('fields integrity when it is used as \'ObjectType\'.', () => { | |
let phoneNumberFields = PhoneNumberType.ObjectType.getFields(); | |
expect(phoneNumberFields).toHaveProperty('number'); | |
expect(phoneNumberFields.number.type).toMatchObject(new graphql.GraphQLNonNull(graphql.GraphQLString)); | |
expect(phoneNumberFields).toHaveProperty('description'); | |
expect(phoneNumberFields.description.type).toMatchObject(graphql.GraphQLString); | |
}); | |
test('fields integrity when it is used as \'InputType\'.', () => { | |
let phoneNumberFields = PhoneNumberType.InputType.getFields(); | |
expect(phoneNumberFields).toHaveProperty('number'); | |
expect(phoneNumberFields.number.type).toMatchObject(new graphql.GraphQLNonNull(graphql.GraphQLString)); | |
expect(phoneNumberFields).toHaveProperty('description'); | |
expect(phoneNumberFields.description.type).toMatchObject(graphql.GraphQLString); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment