diff --git a/spec/features/inputs/nested_select_input_spec.rb b/spec/features/inputs/nested_select_input_spec.rb index 1f18f5db..6259fa8e 100644 --- a/spec/features/inputs/nested_select_input_spec.rb +++ b/spec/features/inputs/nested_select_input_spec.rb @@ -67,7 +67,11 @@ it "shows filled select controls based on defined city_id", js: true do on_input_ctx("invoice_country") { expect_slimselect_selection("Chile") } - on_input_ctx("invoice_region") { expect_slimselect_selection("Metropolitana") } + on_input_ctx("invoice_region") do + expect_slimselect_selection("Metropolitana") + expect_slimselect_option("Antofagasta") + expect_slimselect_option("Cuyo") + end on_input_ctx("invoice_city") { expect_slimselect_selection("Santiago") } end diff --git a/spec/support/capybara_helpers.rb b/spec/support/capybara_helpers.rb index 7503e2f4..fdbe98b6 100644 --- a/spec/support/capybara_helpers.rb +++ b/spec/support/capybara_helpers.rb @@ -93,6 +93,10 @@ def expect_slimselect_empty_selection expect(page).to have_css(".ss-main", text: /Select Value/) end + def expect_slimselect_option(text) + expect(page).to have_css(".ss-option", text: /#{text}/) + end + def expect_slimselect_result_text_to_eq(result_number, text) expect(page).to have_css( "div.ss-option:nth-child(#{result_number})", text: /#{text}/