@settings
@userdetail
Feature: Settings - Manage Users

  @id_29aca085062c9e248dc603dd5b01c80305c5c6703119850a5ccc83202e9b2617
  Scenario: Users can be invited
    Given an orchard employee admin for settings
    And I log in to Settings silently
    And I can navigate to Manage Users
    When I invite a new user as account with Frenchkiss Records • 6971 access
    And I can navigate to Manage Users
    Then I see my invited user in the manage users table

  @id_4027451a0d33df85144951c48ab17d2ca963b009e1e2034594cc0d6277800b91
  Scenario: Users can be edited
    Given an orchard employee admin for settings
    And I log in to Settings silently
    And I can navigate to Manage Users
    When I invite a new user as account with Frenchkiss Records • 6971 access
    And I can navigate to Manage Users
    And I edit the invited user to add TVT Records access
    Then I see the edited user has correct access to TVT Records and Frenchkiss Records

  @id_3170041c35a2812c7732b2e6b63731e42bd7b277f986dac61c53894827191bbc
  Scenario: Users can be deactivated
    Given an orchard employee admin for settings
    And I log in to Settings silently
    And I can navigate to Manage Users
    And I have a new non-admin user for orchard
    And I deactivate the user
    Then I see a message confirming test user has been deactivated

  @id_7415864c9161f8329fffd371add6d657a0bd031304ae6673b6d9615dc38645ea
  Scenario: Label Admins can edit Artist Users
    Given I have a clear browser
    Given an orchard employee label_30570 for settings
    And I log in to Settings silently
    And I can navigate to Manage Users
    When I edit Rob ShieldAgain user
    Then I see access to Late Runner

  @id_6049d3cf6761abd731d5f39bc00745343fa97cfd1e0d881f18ef3d821111d66f
  Scenario: An admin can reactivate and edit a deactivated user
    Given an orchard employee admin for settings
    And I log in to Settings silently
    And I can navigate to Manage Users
    And I have a new non-admin user for orchard
    And I deactivate the user
    Then I see a message confirming test user has been deactivated
    When I reactivate the user
    And I can navigate to Manage Users
    When I edit the invited user to add TVT Records access
    And I can navigate to Manage Users
    And I edit the invited user to add Frenchkiss Records access
    Then I see the edited user has correct access to TVT Records and Frenchkiss Records

  # with admin role
  @id_5232d06cf7a8ff357dbb7270afe309b6dadf9570b9e83ad701f2b5531e41fc20
  Scenario: Super Admin can add allOrchardLabels vendor to user with an admin role
    Given I have a clear browser
    Given an orchard employee admin for settings
    And I log in to Settings silently
    And I can navigate to Manage Users
    When I invite a new admin user as account with All Orchard Labels • * access
    And I can navigate to Manage Users
    Then I see my invited user in the manage users table

  # with analytics role
  @id_9a121f0534882a677c647414fd6ac597a7e5abfeeaa50fcb2959b01848c7aad0
  Scenario: Super Admin can add allOrchardLabels vendor to user with an analytics role only
    Given I have a clear browser
    Given an orchard employee admin for settings
    And I log in to Settings silently
    And I can navigate to Manage Users
    When I invite a new user as account with All Orchard Labels • analytics access
    And I can navigate to Manage Users
    Then I see my invited user in the manage users table

  @id_6de58f3a2d487c1613e8b3c519ce2085b214f4bc3f6d79abb01cfbdf8b2f6c1a
  Scenario: Super Admin can add allOrchardLabels vendor to user with supported domain only
    Given I have a clear browser
    Given an orchard employee admin for settings
    And I log in to Settings silently
    And I can navigate to Manage Users
    When I invite a unsupported account with All Orchard Labels • * access
    Then I should see the error message
