Skip to content

Commit

Permalink
Updates BOM system spec - prepares for #10123
Browse files Browse the repository at this point in the history
  • Loading branch information
filipefurtad0 committed Dec 16, 2022
1 parent 1ca305a commit 39bd9e0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/system/admin/bulk_order_management_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,17 @@
create(:order_with_distributor, state: 'complete', shipment_state: 'ready', completed_at: Time.zone.now,
order_cycle: oc2 )
}
let!(:o3) {
create(:order_with_distributor, state: 'complete', shipment_state: 'ready', completed_at: Time.zone.now + 10.days,
order_cycle: oc2 )
}
let!(:li1) { create(:line_item_with_shipment, order: o1 ) }
let!(:li2) { create(:line_item_with_shipment, order: o2 ) }
let!(:li3) { create(:line_item_with_shipment, order: o3 ) }

before do
oc2.update!(orders_close_at: Time.zone.now + 2.weeks)
oc2.update!(orders_open_at: Time.zone.now + 1.week)
visit_bulk_order_management
end

Expand All @@ -447,6 +454,18 @@
expect(page).to have_selector "tr#li_#{li1.id}"
expect(page).to have_selector "tr#li_#{li2.id}"
end

it "selecting an OC pre-selects the date range from that OC" do
pending("#10123")
click_on_select2 oc1.name, from: "order_cycle_filter"
expect(find("input.datepicker").value).to eq "#{oc1.orders_open_at.strftime('%F')} to #{oc1.orders_close_at.strftime('%F')}"
click_on_select2 oc2.name, from: "order_cycle_filter"
expect(find("input.datepicker").value).to eq "#{oc2.orders_open_at.strftime('%F')} to #{oc2.orders_close_at.strftime('%F')}"
find("input.datepicker").click # selecting a date range, within oc2
select_dates_from_daterangepicker(o3.completed_at - 1.day, o3.completed_at + 1.day)
expect(page).to have_selector "tr#li_#{li3.id}"
page.find('.filter-actions .button.icon-search').click
end
end

context "combination of filters" do
Expand Down

0 comments on commit 39bd9e0

Please sign in to comment.