mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Match user by id instead of email, update feature
This commit is contained in:
parent
94288ced54
commit
80f664dd78
@ -104,14 +104,14 @@ export default {
|
||||
addSocialMedia: async (_, { url }, { driver, user }) => {
|
||||
const session = driver.session()
|
||||
|
||||
const { email } = user
|
||||
const { id } = user
|
||||
const result = await session.run(
|
||||
`MATCH (user:User {email: $userEmail})
|
||||
`MATCH (user:User {id: $userId})
|
||||
SET user.socialMedia = user.socialMedia + $url
|
||||
RETURN user {.socialMedia}
|
||||
`,
|
||||
{
|
||||
userEmail: email,
|
||||
userId: id,
|
||||
url
|
||||
}
|
||||
)
|
||||
@ -119,6 +119,7 @@ export default {
|
||||
const [currentUser] = result.records.map(record => {
|
||||
return record.get('user')
|
||||
})
|
||||
console.log(currentUser)
|
||||
return currentUser.socialMedia
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,4 +11,6 @@ Feature: List Social Media Accounts
|
||||
Scenario: Adding Social Media
|
||||
Given I click on the "My social media" link
|
||||
Then I should be on the "/settings/my-social-media" page
|
||||
And I should be able to add a social media link
|
||||
When I add a social media link
|
||||
Then it gets saved successfully
|
||||
And the new social media link shows up on the page
|
||||
@ -77,14 +77,20 @@ Then('I should be on the {string} page', page => {
|
||||
.should('contain', 'My social media')
|
||||
})
|
||||
|
||||
Then('I should be able to add a social media link', () => {
|
||||
Then('I add a social media link', () => {
|
||||
cy.get("input[name='social-media']")
|
||||
.type('https://freeradical.zone/@mattwr18')
|
||||
.get('button')
|
||||
.contains('Add social media')
|
||||
.click()
|
||||
.get('.iziToast-message')
|
||||
})
|
||||
|
||||
Then('it gets saved successfully', () => {
|
||||
cy.get('.iziToast-message')
|
||||
.should('contain', 'Updated user')
|
||||
.get('a')
|
||||
})
|
||||
|
||||
Then('the new social media link shows up on the page', () => {
|
||||
cy.get('a')
|
||||
.contains("src='https://freeradical.zone/@mattwr18'")
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user