mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Add random languages to seeds
This commit is contained in:
parent
1dbd36c1e1
commit
9b67036b43
@ -1,10 +1,13 @@
|
||||
import faker from 'faker'
|
||||
import sample from 'lodash/sample'
|
||||
import { createTestClient } from 'apollo-server-testing'
|
||||
import createServer from '../server'
|
||||
import Factory from './factories'
|
||||
import { neode as getNeode, getDriver } from '../bootstrap/neo4j'
|
||||
import { gql } from '../jest/helpers'
|
||||
|
||||
const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
|
||||
|
||||
/* eslint-disable no-multi-spaces */
|
||||
;(async function() {
|
||||
let authenticatedUser = null
|
||||
@ -341,39 +344,46 @@ import { gql } from '../jest/helpers'
|
||||
factory.create('Post', {
|
||||
author: peterLustig,
|
||||
id: 'p0',
|
||||
language: sample(languages),
|
||||
image: faker.image.unsplash.food(),
|
||||
categoryIds: ['cat16'],
|
||||
}),
|
||||
factory.create('Post', {
|
||||
author: bobDerBaumeister,
|
||||
id: 'p1',
|
||||
language: sample(languages),
|
||||
image: faker.image.unsplash.technology(),
|
||||
categoryIds: ['cat1'],
|
||||
}),
|
||||
factory.create('Post', {
|
||||
author: huey,
|
||||
id: 'p3',
|
||||
language: sample(languages),
|
||||
categoryIds: ['cat3'],
|
||||
}),
|
||||
factory.create('Post', {
|
||||
author: dewey,
|
||||
id: 'p4',
|
||||
language: sample(languages),
|
||||
categoryIds: ['cat4'],
|
||||
}),
|
||||
factory.create('Post', {
|
||||
author: louie,
|
||||
id: 'p5',
|
||||
language: sample(languages),
|
||||
categoryIds: ['cat5'],
|
||||
}),
|
||||
factory.create('Post', {
|
||||
authorId: 'u1',
|
||||
id: 'p6',
|
||||
language: sample(languages),
|
||||
image: faker.image.unsplash.buildings(),
|
||||
categoryIds: ['cat6'],
|
||||
}),
|
||||
factory.create('Post', {
|
||||
author: huey,
|
||||
id: 'p9',
|
||||
language: sample(languages),
|
||||
categoryIds: ['cat9'],
|
||||
}),
|
||||
factory.create('Post', {
|
||||
@ -384,23 +394,27 @@ import { gql } from '../jest/helpers'
|
||||
factory.create('Post', {
|
||||
author: louie,
|
||||
id: 'p11',
|
||||
language: sample(languages),
|
||||
image: faker.image.unsplash.people(),
|
||||
categoryIds: ['cat11'],
|
||||
}),
|
||||
factory.create('Post', {
|
||||
author: bobDerBaumeister,
|
||||
id: 'p13',
|
||||
language: sample(languages),
|
||||
categoryIds: ['cat13'],
|
||||
}),
|
||||
factory.create('Post', {
|
||||
author: jennyRostock,
|
||||
id: 'p14',
|
||||
language: sample(languages),
|
||||
image: faker.image.unsplash.objects(),
|
||||
categoryIds: ['cat14'],
|
||||
}),
|
||||
factory.create('Post', {
|
||||
author: huey,
|
||||
id: 'p15',
|
||||
language: sample(languages),
|
||||
categoryIds: ['cat15'],
|
||||
}),
|
||||
])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user