Replace redundant spec helper method

This commit is contained in:
Maikel Linke
2026-02-19 12:56:12 +11:00
parent 424e25f83e
commit d770049d2d
2 changed files with 4 additions and 8 deletions

View File

@@ -1,10 +1,6 @@
# frozen_string_literal: true
module TomSelectHelper
def tomselect_open(field_name)
page.find("##{field_name}-ts-control").click
end
def tomselect_multiselect(value, options)
tomselect_wrapper = page.find_field(options[:from]).sibling(".ts-wrapper")
tomselect_wrapper.find(".ts-control").click

View File

@@ -100,10 +100,10 @@ RSpec.describe '
end
it "order cycles appear in descending order by close date on orders page" do
tomselect_open('q_order_cycle_id_in').click
expect(find('#q_order_cycle_id_in',
visible: :all)[:innerHTML]).to have_content(/.*Four.*Three.*Two.*Five/m)
open_tomselect_to_validate!(page, 'q_order_cycle_id_in') do
oc_html = find('#q_order_cycle_id_in', visible: :all)[:innerHTML]
expect(oc_html).to have_content(/.*Four.*Three.*Two.*Five/m)
end
end
it "filter by multiple order cycles" do