@accounting
@ows_accounting
@frontend_accounting
Feature: Accounting Checks
  In order to ensure the accuracy and reliability of accounting data
  As both a Workstation and OA Accounting user
  I want to be able to enter checks and verify they are reflected in WS
  * Use label 7123
  * WARNING: Do NOT use label 19405 or Outstanding Balance scenarios will fail!

  Scenario: Add label check
    Given an OA Technology_manager user
    When I am on the OA::AddCheckPayablePage
    Then I see errors when I attempt to submit a check without the required fields
    When I enter a check
    Then I should see a message that the check was successfully added
    # confirm via search
    When I search for the check
    Then I should see the check
    # TODO: Add workstation confirmation

  Scenario: Search for invalid UPC
    Given an OA Technology_manager user
    Given A nonexistent check
    When I search for the check
    Then I should see the Check Payable Results page with no results

  Scenario: Valid upload manual adjustments
    Given an OA Technology_manager user
    And I have an up-to-date UploadManualAdjustment template
    When I upload a manual adjustment spreadsheet with valid data
    Then I should see a message that the adjustments were successfully added
    # confirm via search
    Then I confirm that the new adjustments have been added

  Scenario: Invalid upload manual adjustments
    Given an OA Technology_manager user
    And I have an up-to-date UploadManualAdjustment template
    When I upload a manual adjustment spreadsheet with invalid data
    Then I should see an error message for the uploaded manual adjustment spreadsheet

  Scenario: Invalid upload check deletions
    Given an OA Technology_manager user
    Given I have an up-to-date UploadCheckDeletion template
    When I upload a check deletion spreadsheet with invalid data
    Then I should see an error message for the uploaded delete check spreadsheet

  # will need to investigate further: can only see manual adjustments up to the end of the last quarter
  Scenario: Add compilations manual adjustment
    Given an OA Technology_manager user
    Given I am on the OA::AddManualAdjustmentPage
    When I enter a manual adjustment
    Then I should see a message that the adjustment was successfully added
    # Confirm via search
    Then I confirm that the new adjustment has been added
    Given we aren't in the middle of an accounting run
    Given a Workstation label_7123 user
    When I am on the accounting breakdown page for the current period
    And I view the Compilations pop-over
    Then I confirm that the added adjustment is present
