Project share page

BDD file with acceptance criteria and user permissions for the project share page.
Feature: As a user I want to invite groups and collaborators to an item

Scenario Outline: Viewing the collaborators and groups list on Share Modal with Edit permissions
 Given  I am <role>
 And  I am viewing <itemType> share modal
 Then  I should be able to search
 And  I should be able to manage invites

Examples:
| role | itemType |
| OWNER | project |
| OWNER | folder |
| OWNER | user test |
| ADMIN | project |
| ADMIN | folder |
| ADMIN | user test |
| EDITOR | project |
| EDITOR | folder |
| EDITOR | user test |

Scenario Outline: Viewing the collaborators and groups list on Share Modal with Read-Only permissions
 Given  I am <role>
 And  I am viewing <itemType> share modal
 Then  I should not have access to search
 And  I should not be able to manage invites

Examples:
| role | itemType |
| INTERNAL_REVIEWER | project |
| INTERNAL_REVIEWER | folder |
| INTERNAL_REVIEWER | user test |
| EXTERNAL_REVIEWER | project |
| EXTERNAL_REVIEWER | folder |
| EXTERNAL_REVIEWER | user test |

Scenario Outline: Viewing the groups empty state with Edit permissions
 Given  I am a <role>
 And  I am viewing <itemType> share modal with no groups
 Then  I should see an empty state
 And  I should see a CTA encouraging me to add a group

Examples:
| role | itemType |
| OWNER | project |
| OWNER | user test |
| ADMIN | project |
| ADMIN | user test |
| EDITOR | project |
| EDITOR | user test |

Scenario Outline: Viewing the groups empty state with Read-Only permissions
 Given  I am a <role>
 And  I am viewing <itemType> share modal with no groups
 Then  I should see an empty state
 And  I should not see a CTA encouraging me to add a group

Examples:
| role | itemType |
| INTERNAL_REVIEWER | project |
| INTERNAL_REVIEWER | user test |
| EXTERNAL_REVIEWER | project |
| EXTERNAL_REVIEWER | user test |

Scenario Outline: Editors with Invite Rights accessing the Invite People To Workspace modal
 Given  I am an Editor
 And  I have invite permissions
 When  I am on the <item> Share Modal with URL <shareUrl>
 And  I click on "Invite people"
 Then  I should be redirected to the Invite People To Workspace modal with URL <inviteURL>

Examples:
| item | shareUrl | inviteURL |
| project | /project/\d+/share | /project/\d+/invite |
| folder | /folder/\w\w\d\w{4}\d\w+/share | /folder/\w\w\d\w{4}\d\w+/invite |
| user test | /user-test/\d+/project/\d+/share | /user-test/\d+/project/\d+/invite |

Scenario Outline: Editors without Invite Rights accessing the Invite People To Workspace modal
 Given  I am an Editor
 And  I do not have invite permissions
 When  I am on the <item> Share Modal
 Then  I should not be able to access the Invite People To Workspace modal from the Share Modal

Examples:
| item |
| project |
| folder |
| user test |

Scenario Outline: Users with the correct permissions accessing the Add On Create Group flow
 Given  I have edit permissions
 And  I am on the <item> Share Modal with URL <shareUrl>
 When  I search for a group that does not exist on a <item>
 And  I click on the Create Group CTA
 Then  I should be redirected to the Add on Create Group flow with URL <createGroupUrl>

Examples:
| item | shareUrl | createGroupUrl |
| project | /project/\d+/share | /project/\d+/create-group |
| folder | /folder/\w\w\d\w{4}\d\w+/share | /folder/\w\w\d\w{4}\d\w+/create-group |
| user test | /user-test/\d+/project/\d+/share | /user-test/\d+/project/\d+/create-group |