Merge pull request #1630 from Human-Connection/fix-for-blank-about

Fix bug where about must not be empty string
This commit is contained in:
Robert Schäfer 2019-09-18 14:39:46 +02:00 committed by GitHub
commit 6749e6a9e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -16,7 +16,7 @@ module.exports = {
wasInvited: 'boolean',
wasSeeded: 'boolean',
locationName: { type: 'string', allow: [null] },
about: { type: 'string', allow: [null] },
about: { type: 'string', allow: [null, ''] },
primaryEmail: {
type: 'relationship',
relationship: 'PRIMARY_EMAIL',

View File

@ -484,6 +484,17 @@ describe('SignupVerification', () => {
})
})
it('allowing the about field to be an empty string', async () => {
variables = { ...variables, about: '' }
await expect(mutate({ mutation, variables })).resolves.toMatchObject({
data: {
SignupVerification: expect.objectContaining({
id: expect.any(String),
}),
},
})
})
it('marks the EmailAddress as primary', async () => {
const cypher = `
MATCH(email:EmailAddress)<-[:PRIMARY_EMAIL]-(u:User {name: {name}})