# WIP'ed sill OA access not implemented
#  AUT-930 Workstation accounting deprecation
@accounting
@ows_accounting
@frontend_accounting
@wip
Feature: Accounting Checks - Workstation
  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

  Background:
    Given an orchard employee cypress_manager_2 visits OA
    And I log in to OA

  # Use label 7123
  # WARNING: Do NOT use label 19405 or Outstanding Balance scenarios will fail!
  @id_3c575424b81a8322bf8ba9df9c29f3e5764c6f9da3d7259a09291750c7ca795f
  Scenario: Add label check
    And I navigate to add check payable oa page
    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
  @id_b284009de580092c07309b2d1c808fe26bcb2afffc0e3246a4d6bf672a572e8e
  Scenario: Search for invalid UPC
    And A nonexistent check
    When I search for the check
    Then I should see the Check Payable Results page with no results

  @id_f03204a656736de4387b74394eb6f95c5e4dafebefcf940ef2a7f15247e02562
  Scenario: Valid upload manual adjustments
    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

  @id_f346be3cd6b1fccb75999ac92c937141a9a62a2bce04e0973cf69ce4ae5dd03f
  Scenario: Invalid upload manual adjustments
    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

  @id_3d351e465d5224044778b56a424e6ae831054c535738b9eaf09c4f9acdd42eb9
  Scenario: Invalid upload check deletions
    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
  @id_3c6f06ad0a61163eadbf53a934c3e8622636270e7d6da997283ecd99c09e64c5
  Scenario: Add compilations manual adjustment
    When I enter a manual adjustment
    Then I should see a message that the adjustment were 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 an orchard employee label_7123 for workstation
    And I log in to workstation silently
    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
