Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into ISAICP-6139
Browse files Browse the repository at this point in the history
  • Loading branch information
pfrenssen committed Apr 13, 2021
2 parents d6bcb0e + 2404260 commit 0ed2d91
Show file tree
Hide file tree
Showing 37 changed files with 1,035 additions and 140 deletions.
1 change: 1 addition & 0 deletions tests/behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ default:
'group menu edit table': '#menu-overview'
'eif recommendations': '.eif-recommendations table'
'member administration': '.og-members-overview table'
'member permissions': 'table.form-table__member-permissions'
'licence comparer': 'table[data-drupal-selector="licence-comparer"]'
'pipeline log': 'table.joinup-pipeline-log-table'
'subscribers report': 'table'
Expand Down
22 changes: 10 additions & 12 deletions tests/features/collection/collection.member_administration.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@api @email @group-a @terms
@api @group-a @terms
Feature: Collection membership administration
In order to build a community
As a collection facilitator
Expand Down Expand Up @@ -31,12 +31,12 @@ Feature: Collection membership administration
| Medical diagnosis | Kathie Cumbershot | | pending |

Scenario: Only one instance of the "Apply to selected items" should exist.
When I am logged in as a moderator
And I go to the "Medical diagnosis" collection
And I click "Members" in the "Left sidebar"
Given I am logged in as a moderator
And I am on the members page of "Medical diagnosis"
Then I should see the button "Apply to selected items" in the "Members admin form header" region
But I should not see the button "Apply to selected items" in the "Members admin form actions" region

@email
Scenario: Request a membership
When I am logged in as "Donald Duck"
And all e-mails have been sent
Expand All @@ -54,6 +54,7 @@ Feature: Collection membership administration
| subject | Joinup: A user has requested to join your collection |
| body | Donald Duck has requested to join your collection "Medical diagnosis" as a member. |

@email
Scenario: Approve a membership
# Check that a member with pending state does not have access to add new content.
Given I am logged in as "Kathie Cumbershot"
Expand All @@ -63,15 +64,13 @@ Feature: Collection membership administration

# Check that the facilitator can also see the approve action.
Given I am logged in as "Turkey Ham"
And I go to the "Medical diagnosis" collection
Then I click "Members" in the "Left sidebar"
And I am on the members page of "Medical diagnosis"
Then I select "Approve the pending membership(s)" from "Action"

# Approve a membership.
Given I am logged in as "Lisa Cuddy"
When all e-mails have been sent
And I go to the "Medical diagnosis" collection
And I click "Members" in the "Left sidebar"
And all e-mails have been sent
And I am on the members page of "Medical diagnosis"
Then the "Action" select should contain the following options:
| Approve the pending membership(s) |
| Block the selected membership(s) |
Expand Down Expand Up @@ -145,10 +144,9 @@ Feature: Collection membership administration

@email
Scenario: Reject a membership
When I am logged in as "Lisa Cuddy"
Given I am logged in as "Lisa Cuddy"
And all e-mails have been sent
And I go to the "Medical diagnosis" collection
Then I click "Members" in the "Left sidebar"
And I am on the members page of "Medical diagnosis"
# Assert that the user does not see the default OG tab.
Then I should not see the link "Group"
And I check the box "Update the member Kathie Cumbershot"
Expand Down
3 changes: 1 addition & 2 deletions tests/features/collection/collection.member_count.feature
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ Feature: Collection homepage

# Approve the membership.
Given I am logged in as "Thorin"
And I go to the "Exactly the same collection, but closed" collection
And I click "Members" in the "Left sidebar"
And I am on the members page of "Exactly the same collection, but closed"
# Assert that the user does not see the default OG tab.
Then I should not see the link "Group"
And I check the box "Update the member Some goblin"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ Feature: Type something to filter the listing the member list

Scenario Outline: All users are allowed to filter the users by a combined search field and the role.
Given I am logged in as "<user>"
When I go to the homepage of the "Coffee makers" collection
And I click "Members" in the "Left sidebar"
And I am on the members page of "Coffee makers"
Then the following fields should be present "Type something to filter the list, Roles"

Examples:
Expand All @@ -42,10 +41,9 @@ Feature: Type something to filter the listing the member list
| queenson |

Scenario: Moderators should be able to filter users in the table in the collection members page.
When I am logged in as "séamusline"
And I go to the homepage of the "Coffee makers" collection
And I click "Members" in the "Left sidebar"
And I fill in "Type something to filter the list" with "bro"
Given I am logged in as "séamusline"
And I am on the members page of "Coffee makers"
When I fill in "Type something to filter the list" with "bro"
And I press "Apply"

Then the "member administration" table should contain the following columns:
Expand Down
3 changes: 1 addition & 2 deletions tests/features/collection/join-leave.feature
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ Feature: Joining and leaving collections through the web interface
Then I should see the text "You are owner of this collection. Before you leave this collection, you should transfer the ownership to another member."
And I should not see the button "Confirm"

When I go to the homepage of the "Insectarium" collection
And I click "Members"
When I go to the members page of "Insectarium"
And I select the "newcomer researcher" row
And I select "Transfer the ownership of the collection to the selected member" from "Action"
And I press "Apply to selected items"
Expand Down
2 changes: 1 addition & 1 deletion tests/features/collection/notification.collection.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Feature: Notification test for the collection transitions.
In order to manage my collections
As an user that is related to the collection
I want to receive a notification an event occurs.
I want to receive a notification when an event occurs

Scenario: Notifications should be sent whenever an event is occurring related to a collection.
Given the following owner:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,38 @@ Feature: Notification test for the discussion transitions on a post moderated pa
Examples:
| moderation | roles |
| no | |
| yes | author |
| yes | author |

Scenario: No notifications should be sent when a discussion is orphaned
Given collections:
| title | state |
| Event Horizon Telescope | validated |
And discussion content:
| title | collection | state |
| How do the jets fire into space? | Event Horizon Telescope | validated |
And users:
| Username |
| Lindsey McCray |
| Cambria Falconer |
| Monroe Fearchar |
And collection user memberships:
| collection | user | roles |
| Event Horizon Telescope | Lindsey McCray | owner, facilitator |
And discussion subscriptions:
| username | title |
| Cambria Falconer | How do the jets fire into space? |
And comments:
| message | author | parent |
| Huge magnetic fields | Monroe Fearchar | How do the jets fire into space? |

When all e-mails have been sent
And I am logged in as a moderator
And I go to the homepage of the "Event Horizon Telescope" collection
And I click "Edit" in the "Entity actions" region
And I click "Delete"
And I press "Delete"
Then the following email should have been sent:
| recipient | Lindsey McCray |
| subject | Joinup: Your collection has been deleted by the moderation team |
| body | The Joinup moderation team deleted the collection Event Horizon Telescope |
And 1 e-mail should have been sent
10 changes: 4 additions & 6 deletions tests/features/joinup_collection/membership.feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,17 @@ Feature: Tests membership to Joinup collection.
And user "jane" is member of "Joinup" collection

Given I am logged in as a user with the moderator role
And I go to the homepage of the "An arbitrary collection" collection
And I click "Members"
And I check "edit-og-membership-bulk-form-0"
And I am on the members page of "An arbitrary collection"
When I check "edit-og-membership-bulk-form-0"
And I select "Delete the selected membership(s)" from "Action"

When I press "Apply to selected items"
And I press "Apply to selected items"
Then I should see the heading "Are you sure you want to delete the selected membership from the 'An arbitrary collection' collection?"
And I should see "The member joe will be deleted from the 'An arbitrary collection' collection."
And I should see "This action cannot be undone."

When I press "Confirm"
Then I should see the success message "The member joe has been deleted from the 'An arbitrary collection' collection."

Given I go to the homepage of the "Joinup" collection
And I click "Members"
Given I am on the members page of "Joinup"
Then the available options in the "Action" select should not include the "Delete the selected membership(s)" options
3 changes: 1 addition & 2 deletions tests/features/joinup_core/owner_deletion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ Feature: Deletion of collection and solution owners
| An owned group | Group owner 2 | owner |
| An owned group | Group member | |
And I am logged in as "Site moderator"
And I go to the homepage of the "An owned group" <type>
And I click "Members"
And I am on the members page of "An owned group"
And I select the "Group owner 1" row
And I select the "Group owner 2" row

Expand Down
19 changes: 7 additions & 12 deletions tests/features/joinup_core/transfer_group_ownership.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ Feature: As a group (collection or solution) owner or site moderator
@email
Scenario Outline: Administrators, moderators and owners can transfer the group ownership.
Given I am logged in as "<user>"
And I go to the homepage of the "<title>" <type>
And I click "Members"
And I am on the members page of "<title>"

# Try to transfer the ownership to the current owner.
Given I select the "cruel" row
Expand Down Expand Up @@ -97,8 +96,7 @@ Feature: As a group (collection or solution) owner or site moderator

Scenario Outline: Group facilitators do not have access to transfer ownership.
Given I am logged in as "shy"
And I go to the homepage of the "<title>" <type>
Given I click "Members"
And I am on the members page of "<title>"
Then the available options in the "Action" select should not include the "Transfer the ownership of the <type> to the selected member" options

Examples:
Expand All @@ -124,24 +122,21 @@ Feature: As a group (collection or solution) owner or site moderator
| Rivers Of Babylon | shy | facilitator |

Given I am logged in as "shy"
And I go to the homepage of the "Rivers Of Babylon" solution
Given I click "Members"
And I am on the members page of "Rivers Of Babylon"
Then the available options in the "Action" select should not include the "Transfer the ownership of the solution to the selected member" options

Given I am logged in as "loner"
And I go to the homepage of the "Babylon" collection
Given I click "Members"
And I am on the members page of "Babylon"
Then the available options in the "Action" select should not include the "Transfer the ownership of the solution to the selected member" options

# In Joinup every owner is also a facilitator, so if a normal member is
# promoted to owner, they should also become a facilitator.
Scenario Outline: If ownership is transferred to a normal member, it should also include the facilitator role
Given I am logged in as "light"
And I go to the homepage of the "<title>" <group type>
And I click "Members"
And I select the "loner" row
And I am on the members page of "<title>"
When I select the "loner" row
And I select "Transfer the ownership of the <group type> to the selected member" from "Action"
When I press "Apply to selected items"
And I press "Apply to selected items"
Then I should see "Are you sure you want to transfer the ownership of <title> <group type> to Freyja Stefánsdóttir?"
When I press "Confirm"
Then I should see "Ownership of <title> <group type> transferred from users Finnur Robertsson, Edda Agnarsdóttir to Freyja Stefánsdóttir."
Expand Down
Loading

0 comments on commit 0ed2d91

Please sign in to comment.