mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Merge branch 'master' into room-properties
This commit is contained in:
commit
45602119ca
@ -209,9 +209,17 @@ describe('Message', () => {
|
||||
mutation: createMessageMutation(),
|
||||
variables: {
|
||||
roomId,
|
||||
content: 'Another nice message to other chatting user',
|
||||
content: 'A nice response message to chatting user',
|
||||
}
|
||||
})
|
||||
authenticatedUser = await chattingUser.toJson()
|
||||
await mutate({
|
||||
mutation: createMessageMutation(),
|
||||
variables: {
|
||||
roomId,
|
||||
content: 'And another nice message to other chatting user',
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
it('returns the messages', async () => {
|
||||
@ -233,11 +241,18 @@ describe('Message', () => {
|
||||
},
|
||||
{
|
||||
id: expect.any(String),
|
||||
content: 'Another nice message to other chatting user',
|
||||
content: 'A nice response message to chatting user',
|
||||
author: {
|
||||
id: 'other-chatting-user',
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
id: expect.any(String),
|
||||
content: 'And another nice message to other chatting user',
|
||||
author: {
|
||||
id: 'chatting-user',
|
||||
},
|
||||
}
|
||||
],
|
||||
},
|
||||
})
|
||||
|
||||
@ -24,11 +24,11 @@ export default {
|
||||
const writeTxResultPromise = session.writeTransaction(async (transaction) => {
|
||||
const createMessageCypher = `
|
||||
MATCH (currentUser:User { id: $currentUserId })-[:CHATS_IN]->(room:Room { id: $roomId })
|
||||
MERGE (currentUser)-[:CREATED]->(message:Message)-[:INSIDE]->(room)
|
||||
ON CREATE SET
|
||||
message.createdAt = toString(datetime()),
|
||||
message.id = apoc.create.uuid(),
|
||||
message.content = $content
|
||||
CREATE (currentUser)-[:CREATED]->(message:Message {
|
||||
createdAt: toString(datetime()),
|
||||
id: apoc.create.uuid(),
|
||||
content: $content
|
||||
})-[:INSIDE]->(room)
|
||||
RETURN message { .* }
|
||||
`
|
||||
const createMessageTxResponse = await transaction.run(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user