Skip to content

Commit

Permalink
Remove pending distribution system spec
Browse files Browse the repository at this point in the history
  • Loading branch information
coalest committed Dec 10, 2024
1 parent 61562ab commit 01b0ade
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions spec/system/distribution_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -699,34 +699,6 @@
end
end

context "with dropdown options changed while open", skip: "select2 not working correctly with cuprite" do
it "preserves selected option" do
item_1, item_2, item_3 = View::Inventory.new(organization.id).items_for_location(storage_location.id).map(&:db_item)
TestInventory.create_inventory(
organization,
{ storage_location.id => { item_1.id => 10, item_2.id => 20, item_3.id => 30 } }
)

visit new_distribution_path

# Open item name dropdown with default dropdown options
page.find(:css, "span[title=\"Choose an item\"]").click

# Selecting storage location triggers ajax call to populate item name dropdowns
# We trigger the selection via javascript to reduce chance of a race condition
page.execute_script("$('select.storage-location-source').val('1').trigger('change')")

# Wait for ajax call to repopulate the select2 dropdown options
expect(page).to have_css("li.select2-results__option", text: "3T Diapers (30)")

# Select the old option name (without the quantity shown)
page.find("li.select2-results__option", text: "3T Diapers (30)").click

# Ensure new dropdown option is selected (rather than first option in dropdown - the default)
expect(page).to have_select("distribution_line_items_attributes_0_item_id", selected: "#{item_3.name} (30)")
end
end

context "via barcode entry" do
let(:existing_barcode) { create(:barcode_item) }
let(:item_with_barcode) { existing_barcode.item }
Expand Down

0 comments on commit 01b0ade

Please sign in to comment.