mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
implemented chat seed
This commit is contained in:
parent
65a6e219db
commit
f9da762253
@ -11,6 +11,8 @@ import {
|
|||||||
changeGroupMemberRoleMutation,
|
changeGroupMemberRoleMutation,
|
||||||
} from '../graphql/groups'
|
} from '../graphql/groups'
|
||||||
import { createPostMutation } from '../graphql/posts'
|
import { createPostMutation } from '../graphql/posts'
|
||||||
|
import { createRoomMutation } from '../graphql/rooms'
|
||||||
|
import { createMessageMutation } from '../graphql/messages'
|
||||||
import { createCommentMutation } from '../graphql/comments'
|
import { createCommentMutation } from '../graphql/comments'
|
||||||
import { categories } from '../constants/categories'
|
import { categories } from '../constants/categories'
|
||||||
|
|
||||||
@ -1553,6 +1555,90 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
|
|||||||
)
|
)
|
||||||
|
|
||||||
await Factory.build('donations')
|
await Factory.build('donations')
|
||||||
|
|
||||||
|
// Chat
|
||||||
|
authenticatedUser = await huey.toJson()
|
||||||
|
const { data: roomHueyPeter } = await mutate({
|
||||||
|
mutation: createRoomMutation(),
|
||||||
|
variables: {
|
||||||
|
userId: (await peterLustig.toJson()).id,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
for (let i = 0; i < 30; i++) {
|
||||||
|
authenticatedUser = await huey.toJson()
|
||||||
|
await mutate({
|
||||||
|
mutation: createMessageMutation(),
|
||||||
|
variables: {
|
||||||
|
roomId: roomHueyPeter?.CreateRoom.id,
|
||||||
|
content: faker.lorem.sentence(),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
authenticatedUser = await peterLustig.toJson()
|
||||||
|
await mutate({
|
||||||
|
mutation: createMessageMutation(),
|
||||||
|
variables: {
|
||||||
|
roomId: roomHueyPeter?.CreateRoom.id,
|
||||||
|
content: faker.lorem.sentence(),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
authenticatedUser = await huey.toJson()
|
||||||
|
const { data: roomHueyJenny } = await mutate({
|
||||||
|
mutation: createRoomMutation(),
|
||||||
|
variables: {
|
||||||
|
userId: (await jennyRostock.toJson()).id,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
for (let i = 0; i < 10000; i++) {
|
||||||
|
authenticatedUser = await huey.toJson()
|
||||||
|
await mutate({
|
||||||
|
mutation: createMessageMutation(),
|
||||||
|
variables: {
|
||||||
|
roomId: roomHueyJenny?.CreateRoom.id,
|
||||||
|
content: faker.lorem.sentence(),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
authenticatedUser = await jennyRostock.toJson()
|
||||||
|
await mutate({
|
||||||
|
mutation: createMessageMutation(),
|
||||||
|
variables: {
|
||||||
|
roomId: roomHueyJenny?.CreateRoom.id,
|
||||||
|
content: faker.lorem.sentence(),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const user of additionalUsers) {
|
||||||
|
authenticatedUser = await jennyRostock.toJson()
|
||||||
|
const { data: room } = await mutate({
|
||||||
|
mutation: createRoomMutation(),
|
||||||
|
variables: {
|
||||||
|
userId: (await user.toJson()).id,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
for (let i = 0; i < 30; i++) {
|
||||||
|
authenticatedUser = await jennyRostock.toJson()
|
||||||
|
await mutate({
|
||||||
|
mutation: createMessageMutation(),
|
||||||
|
variables: {
|
||||||
|
roomId: room?.CreateRoom.id,
|
||||||
|
content: faker.lorem.sentence(),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
authenticatedUser = await user.toJson()
|
||||||
|
await mutate({
|
||||||
|
mutation: createMessageMutation(),
|
||||||
|
variables: {
|
||||||
|
roomId: room?.CreateRoom.id,
|
||||||
|
content: faker.lorem.sentence(),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* eslint-disable-next-line no-console */
|
/* eslint-disable-next-line no-console */
|
||||||
console.log('Seeded Data...')
|
console.log('Seeded Data...')
|
||||||
await driver.close()
|
await driver.close()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user