Editing project groups

BDD file with acceptance criteria for editing groups on a project.
Feature: As a user with edit access I want to add or remove a group

Scenario Outline: Initial load
 Given  I have clicked on the groups Tab on <itemType> share modal
 Then  I should see a loading state until the groups have loaded

Examples:
| itemType |
| project |
| user test |
| folder |

Scenario Outline: Searching for an existing Group
 Given  I search for a group on a <itemType>
 Then  I can see the group(s) whose name match my search term

Examples:
| itemType |
| project |
| user test |
| folder |

Scenario Outline: Searching for a Group that doesn't exist
 Given  I search for a group that doesn't exist on a <itemType>
 Then  I should see a message explaining that I should create a group

Examples:
| itemType |
| project |
| user test |
| folder |

Scenario Outline: Adding a group
 Given  I have searched for a group on a <itemType>
 And  I add the group
 Then  I should see the group successfully added
 And  the group should be displayed in the groups list
 And  the group's members should be added to the collaborators list

Examples:
| itemType |
| project |
| user test |
| folder |

Scenario Outline: Adding a group that has already been added
 Given  I have searched for a group on a <itemType>
 And  the group has already been added
 Then  I should see the group is already added
 And  I should not be able to add it again

Examples:
| itemType |
| project |
| user test |
| folder |

Scenario Outline: Removing a group
 Given  I can see the list of groups added to a <itemType>
 When  I remove one of these groups
 Then  the group should be removed
 And  I should not see the deleted group displayed in groups list
 And  the group's members should also be removed from the collaborators list

Examples:
| itemType |
| project |
| user test |
| folder |

Scenario Outline: Removing a group member from the collaborators list
 Given  I can see a list of collaborators on a <itemType>
 When  I try to remove a collaborator who is part of a group on the <itemType>
 Then  I should not be able to remove the collaborator
 And  I should see visual feedback explaining that the user is part of a group on this <itemType>

Examples:
| itemType |
| project |
| user test |
| folder |

Scenario Outline: Adding a group fails
 Given  I have attempted to add a group to a <itemType> and it fails
 Then  I should see visual feedback explaining that there was an error adding the group
 And  it should ask me to try again

Examples:
| itemType |
| project |
| user test |
| folder |

Scenario Outline: Removing a group from fails
 Given  I have attempted to remove a group from a <itemType> and it fails
 Then  I should see visual feedback explaining that there was an error removing the group
 And  it should ask me to try again

Examples:
| itemType |
| project |
| user test |
| folder |