Skip to content
Snippets Groups Projects
Commit 4cee71b7 authored by ronaldtebrake's avatar ronaldtebrake Committed by GitHub
Browse files

Merge pull request #260 from goalgorilla/feature/DS-2853

DS-2853 - 2 behat tests for like
parents fd083f49 76c28f3c
No related branches found
Tags 1.0.0-beta10 8.x-1.0-beta10
No related merge requests found
......@@ -46,6 +46,7 @@ function _social_like_get_permissions($role) {
'add or remove like votes on comment of comment',
'add or remove like votes on post_comment of comment',
'add or remove like votes on topic of node',
'add or remove like votes on event of node',
];
// Content manager.
......@@ -54,5 +55,9 @@ function _social_like_get_permissions($role) {
// Site manager.
$permissions['sitemanager'] = [];
return $permissions[$role];
if (isset($permissions[$role])) {
return $permissions[$role];
}
return [];
}
@api @like @stability @DS-2968
Feature: Create event like
Benefit: In order to like an event
Role: As a LU
Goal/desire: I want to be able to like an event
Scenario: Successfully create mention in a post
Given users:
| name | mail | status | field_profile_first_name | field_profile_last_name |
| user_1 | mail_1@example.com | 1 | Albert | Einstein |
| user_2 | mail_2@example.com | 1 | Isaac | Newton |
And I am logged in as "user_1"
And I am on "user"
And I click "Events"
And I click "Create Event"
When I fill in the following:
| Title | Event for likes |
| Date | 2025-01-01 |
| Time | 11:00:00 |
| Location name | GG HQ |
And I fill in the "edit-body-0-value" WYSIWYG editor with "Body description text."
And I press "Save"
Then I should see "Event for likes has been created."
Given I am logged in as "user_2"
And I open the "event" node with title "Event for likes"
Then I should see "Event for likes"
And I should see "Albert Einstein"
And I click the xth "0" element with the css ".vote-like a"
And I wait for AJAX to finish
Given I am logged in as "user_1"
And I click the xth "0" element with the css ".notification-bell a"
Then I should see "Notification centre"
And I should see "Isaac Newton likes your content"
@api @like @stability @DS-2969
Feature: Create event like
Benefit: In order to like an event
Role: As a LU
Goal/desire: I want to be able to like an event
Scenario: Successfully create mention in a post
Given users:
| name | mail | status | field_profile_first_name | field_profile_last_name |
| user_1 | mail_1@example.com | 1 | Marie | Curie |
| user_2 | mail_2@example.com | 1 | Charles | Darwin |
And I am logged in as "user_1"
And I am on "user"
And I click "Topics"
And I click "Create Topic"
When I fill in the following:
| Title | Topic for likes |
And I fill in the "edit-body-0-value" WYSIWYG editor with "Body description text."
And I click radio button "Discussion"
And I press "Save"
Then I should see "Topic for likes has been created."
Given I am logged in as "user_2"
And I am at "newest-topics"
Then I should see "Topic for likes"
And I should see "Marie Curie"
When I click "Topic for likes"
Then I should see "Topic for likes"
And I click the xth "0" element with the css ".vote-like a"
And I wait for AJAX to finish
Given I am logged in as "user_1"
And I click the xth "0" element with the css ".notification-bell a"
Then I should see "Notification centre"
And I should see "Charles Darwin likes your content"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment