Feature: Joining an occupied table

  @javascript
  Scenario: Happy flow
    Given there is an open supplier with a menu
    And there is a signed in user with an active order
    And I am on the user homepage
    When another user scans the QR code on the table
    And the other user clicks the join table button
    Then the other user should see a join table waiting message
    And the original user should see a join request message
    When the original user approves the other user's join request
    Then the original user should not see the join request anymore
    And the other user should be added to the active list
    And the other user should be redirected to active list it just joined

  @javascript
  Scenario: Original user rejects the join request
    Given there is an open supplier with a menu
    And there is a signed in user with an active order
    And I am on the user homepage
    When another user scans the QR code on the table
    And the other user clicks the join table button
    Then the other user should see a join table waiting message
    And the original user should see a join request message
    When the original user rejects the other user's join request
    Then the original user should not see the join request anymore
    And the other user should not be added to the active list
    And the other user should see a join reject message
