This commit is contained in:
Matt Rider 2019-04-11 22:28:18 -03:00
parent 1e4fad8425
commit 366c5d776b
6 changed files with 9 additions and 11 deletions

View File

@ -1,5 +1,5 @@
const validURL = str => { const validURL = str => {
const isValid = str.match(/^(?:https?:\/\/)(?:[^@\n])?(?:www\.)?([^:\/\n?]+)/g) const isValid = str.match(/^(?:https?:\/\/)(?:[^@\n])?(?:www\.)?([^:/\n?]+)/g)
return !!isValid return !!isValid
} }
@ -15,4 +15,4 @@ export default {
return socialMedia return socialMedia
} }
} }
} }

View File

@ -25,7 +25,7 @@ describe('CreateSocialMedia', () => {
password: '1234' password: '1234'
}) })
}) })
afterEach(async () => { afterEach(async () => {
await factory.cleanDatabase() await factory.cleanDatabase()
}) })
@ -46,4 +46,4 @@ describe('CreateSocialMedia', () => {
await expect(client.request(mutation, variables)).rejects.toThrow('Input is not a URL') await expect(client.request(mutation, variables)).rejects.toThrow('Input is not a URL')
}) })
}) })
}) })

View File

@ -309,4 +309,3 @@ describe('change password', () => {
}) })
}) })
}) })

View File

@ -1,7 +1,7 @@
import faker from 'faker' import faker from 'faker'
import uuid from 'uuid/v4' import uuid from 'uuid/v4'
export default function create(params) { export default function create (params) {
const { const {
id = uuid(), id = uuid(),
name = faker.name.findName(), name = faker.name.findName(),

View File

@ -11,7 +11,6 @@ import { getDriver } from './bootstrap/neo4j'
import helmet from 'helmet' import helmet from 'helmet'
import decode from './jwt/decode' import decode from './jwt/decode'
dotenv.config() dotenv.config()
// check env and warn // check env and warn
const requiredEnvVars = ['MAPBOX_TOKEN', 'JWT_SECRET', 'PRIVATE_KEY_PASSPHRASE'] const requiredEnvVars = ['MAPBOX_TOKEN', 'JWT_SECRET', 'PRIVATE_KEY_PASSPHRASE']

View File

@ -26,7 +26,9 @@ describe('my-social-media.vue', () => {
mutate: jest mutate: jest
.fn() .fn()
.mockRejectedValue({ message: 'Ouch!' }) .mockRejectedValue({ message: 'Ouch!' })
.mockResolvedValueOnce({ data: { CreateSocialMeda: { id: 's1', url: socialMediaUrl } }}) .mockResolvedValueOnce({
data: { CreateSocialMeda: { id: 's1', url: socialMediaUrl } }
})
}, },
$toast: { $toast: {
error: jest.fn(), error: jest.fn(),
@ -58,9 +60,7 @@ describe('my-social-media.vue', () => {
getters = { getters = {
'auth/user': () => { 'auth/user': () => {
return { return {
socialMedia: [ socialMedia: [{ id: 's1', url: socialMediaUrl }]
{ id: 's1', url: socialMediaUrl }
]
} }
} }
} }