mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Fix cypress tests/frontend implementation
- Co-authored-by: Wolfgang Huß <wolle.huss@pjannto.com>
This commit is contained in:
parent
bcf9680ad9
commit
5347f734af
@ -255,7 +255,7 @@ export default {
|
|||||||
'MATCH (this)-[:BLOCKED]-(u:User {id: $cypherParams.currentUserId}) RETURN COUNT(u) >= 1',
|
'MATCH (this)-[:BLOCKED]-(u:User {id: $cypherParams.currentUserId}) RETURN COUNT(u) >= 1',
|
||||||
isMuted:
|
isMuted:
|
||||||
'MATCH (this)<-[:MUTED]-(u:User {id: $cypherParams.currentUserId}) RETURN COUNT(u) >= 1',
|
'MATCH (this)<-[:MUTED]-(u:User {id: $cypherParams.currentUserId}) RETURN COUNT(u) >= 1',
|
||||||
hasBlocked:
|
isBlocked:
|
||||||
'MATCH (this)<-[:BLOCKED]-(u:User {id: $cypherParams.currentUserId}) RETURN COUNT(u) >= 1',
|
'MATCH (this)<-[:BLOCKED]-(u:User {id: $cypherParams.currentUserId}) RETURN COUNT(u) >= 1',
|
||||||
},
|
},
|
||||||
count: {
|
count: {
|
||||||
|
|||||||
@ -68,7 +68,7 @@ type User {
|
|||||||
RETURN COUNT(u) >= 1
|
RETURN COUNT(u) >= 1
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
hasBlocked: Boolean! @cypher(
|
isBlocked: Boolean! @cypher(
|
||||||
statement: """
|
statement: """
|
||||||
MATCH (this)<-[:BLOCKED]-(user:User {id: $cypherParams.currentUserId})
|
MATCH (this)<-[:BLOCKED]-(user:User {id: $cypherParams.currentUserId})
|
||||||
RETURN COUNT(user) >= 1
|
RETURN COUNT(user) >= 1
|
||||||
|
|||||||
@ -591,13 +591,18 @@ Then("I should see no users in my blocked users list", () => {
|
|||||||
.should('contain', "So far, you have not blocked anybody.")
|
.should('contain', "So far, you have not blocked anybody.")
|
||||||
})
|
})
|
||||||
|
|
||||||
Then("I should not see {string} from the content menu in the user info box", link => {
|
Then("I {string} see {string} from the content menu in the user info box", (condition, link) => {
|
||||||
cy.get(".user-content-menu .base-button").click()
|
cy.get(".user-content-menu .base-button").click()
|
||||||
cy.get(".popover .ds-menu-item-link")
|
cy.get(".popover .ds-menu-item-link")
|
||||||
.should('not.contain', link)
|
.should(condition === 'should' ? 'contain' : 'not.contain', link)
|
||||||
})
|
})
|
||||||
|
|
||||||
Then('I should not see {string} button', button => {
|
Then('I should not see {string} button', button => {
|
||||||
cy.get('.ds-card-content')
|
cy.get('.ds-card-content .action-buttons')
|
||||||
.should('not.contain', '.action-buttons')
|
.should('have.length', 1)
|
||||||
|
})
|
||||||
|
|
||||||
|
Then('I should see the {string} button', button => {
|
||||||
|
cy.get('.ds-card-content .action-buttons .base-button')
|
||||||
|
.should('contain', button)
|
||||||
})
|
})
|
||||||
|
|||||||
@ -11,6 +11,7 @@ Feature: Block a User
|
|||||||
Scenario: Block a user
|
Scenario: Block a user
|
||||||
Given I am on the profile page of the annoying user
|
Given I am on the profile page of the annoying user
|
||||||
When I click on "Block user" from the content menu in the user info box
|
When I click on "Block user" from the content menu in the user info box
|
||||||
|
And I "should" see "Unblock user" from the content menu in the user info box
|
||||||
And I navigate to my "Blocked users" settings page
|
And I navigate to my "Blocked users" settings page
|
||||||
Then I can see the following table:
|
Then I can see the following table:
|
||||||
| Avatar | Name |
|
| Avatar | Name |
|
||||||
@ -28,6 +29,7 @@ Feature: Block a User
|
|||||||
When I visit the profile page of the annoying user
|
When I visit the profile page of the annoying user
|
||||||
And I click on "Block user" from the content menu in the user info box
|
And I click on "Block user" from the content menu in the user info box
|
||||||
And I get removed from his follower collection
|
And I get removed from his follower collection
|
||||||
|
And I "should" see "Unblock user" from the content menu in the user info box
|
||||||
|
|
||||||
Scenario: Posts of blocked users are not filtered from search results
|
Scenario: Posts of blocked users are not filtered from search results
|
||||||
Given "Harassing User" wrote a post "You can still see my posts"
|
Given "Harassing User" wrote a post "You can still see my posts"
|
||||||
@ -53,5 +55,6 @@ Feature: Block a User
|
|||||||
Scenario: Blocked users should not see link or button to unblock, only blocking users
|
Scenario: Blocked users should not see link or button to unblock, only blocking users
|
||||||
Given a user has blocked me
|
Given a user has blocked me
|
||||||
When I visit the profile page of the annoying user
|
When I visit the profile page of the annoying user
|
||||||
And I should not see "Unblock user" from the content menu in the user info box
|
And I "should not" see "Unblock user" from the content menu in the user info box
|
||||||
|
And I should see the "Follow" button
|
||||||
And I should not see "Unblock user" button
|
And I should not see "Unblock user" button
|
||||||
@ -172,7 +172,7 @@ export default {
|
|||||||
icon: 'microphone-slash',
|
icon: 'microphone-slash',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (this.resource.hasBlocked) {
|
if (this.resource.isBlocked) {
|
||||||
routes.push({
|
routes.push({
|
||||||
label: this.$t(`settings.blocked-users.unblock`),
|
label: this.$t(`settings.blocked-users.unblock`),
|
||||||
callback: () => {
|
callback: () => {
|
||||||
|
|||||||
@ -24,6 +24,7 @@ export default i18n => {
|
|||||||
createdAt
|
createdAt
|
||||||
followedByCurrentUser
|
followedByCurrentUser
|
||||||
isMuted
|
isMuted
|
||||||
|
isBlocked
|
||||||
blocked
|
blocked
|
||||||
following(first: 7) {
|
following(first: 7) {
|
||||||
...user
|
...user
|
||||||
|
|||||||
@ -97,7 +97,7 @@
|
|||||||
:post="post"
|
:post="post"
|
||||||
@createComment="createComment"
|
@createComment="createComment"
|
||||||
/>
|
/>
|
||||||
<ds-placeholder v-else>
|
<ds-placeholder v-if="post.author.blocked">
|
||||||
{{ $t('settings.blocked-users.explanation.commenting-disabled') }}
|
{{ $t('settings.blocked-users.explanation.commenting-disabled') }}
|
||||||
<br />
|
<br />
|
||||||
{{ $t('settings.blocked-users.explanation.commenting-explanation') }}
|
{{ $t('settings.blocked-users.explanation.commenting-explanation') }}
|
||||||
|
|||||||
@ -67,14 +67,14 @@
|
|||||||
</ds-flex-item>
|
</ds-flex-item>
|
||||||
</ds-flex>
|
</ds-flex>
|
||||||
<div v-if="!myProfile" class="action-buttons">
|
<div v-if="!myProfile" class="action-buttons">
|
||||||
<base-button v-if="user.hasBlocked" @click="unblockUser(user)">
|
<base-button v-if="user.isBlocked" @click="unblockUser(user)">
|
||||||
{{ $t('settings.blocked-users.unblock') }}
|
{{ $t('settings.blocked-users.unblock') }}
|
||||||
</base-button>
|
</base-button>
|
||||||
<base-button v-if="user.isMuted" @click="unmuteUser(user)">
|
<base-button v-if="user.isMuted" @click="unmuteUser(user)">
|
||||||
{{ $t('settings.muted-users.unmute') }}
|
{{ $t('settings.muted-users.unmute') }}
|
||||||
</base-button>
|
</base-button>
|
||||||
<hc-follow-button
|
<hc-follow-button
|
||||||
v-if="!(user.hasBlocked || user.isMuted)"
|
v-if="!user.isMuted && !user.isBlocked"
|
||||||
:follow-id="user.id"
|
:follow-id="user.id"
|
||||||
:is-followed="user.followedByCurrentUser"
|
:is-followed="user.followedByCurrentUser"
|
||||||
@optimistic="optimisticFollow"
|
@optimistic="optimisticFollow"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user