Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#4594] allow zero inventory items to be selected for audit #4833

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

danielabar
Copy link
Collaborator

Resolves #4594

Description

Allow newly added items that are not in a storage location to be selected for audit, which effectively initializes them.

Also ensure inactive items cannot be selected for audit. That last part about inactive items was discovered in further discussion on the issue.

Type of change

Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

For automated testing, see two new tests added to spec/system/audit_system_spec.rb:

  1. allows auditing items that are not in a storage location
  2. does not display inactive items for selection

For manual testing, create a new item, then create a new audit, pick a storage location, you should be able to select the new item for audit.

Also on the new audit screen, if you interact with the item dropdown before selecting a storage location, it should not include inactive items. In the seed data, Adult Briefs (Large/X-Large) is an inactive item.

Screenshots

Create new item:
image

Verify item not in any location:
image

Start new audit - new item is selectable:
image

Save progress - item shows up:
image

@danielabar danielabar requested a review from cielf December 8, 2024 12:29
@cielf cielf requested a review from dorner December 8, 2024 13:02
Copy link
Collaborator

@cielf cielf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passes functional testing. Thanks, @danielabar

expect(event_line_item.quantity).to eq audit_quantity
end

it "does not display inactive items for selection" do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be moved to a request test? Since we're not testing interaction, it should be fine to do that and it's a lot more lightweight.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to audit request test.

@danielabar danielabar requested a review from dorner December 11, 2024 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should be able to select items for audit that have 0 inventory.
3 participants