|
99 | 99 | end
|
100 | 100 | end
|
101 | 101 |
|
102 |
| - context "updating medium level" do |
103 |
| - before do |
104 |
| - on_input_ctx("invoice_region") do |
105 |
| - open_slimselect_options |
106 |
| - slimselect_search_input.set("Antof") |
| 102 | + context "when updating medium level (that uses collection option)" do |
| 103 | + context 'when searching for region that does not belong to selected country' do |
| 104 | + before do |
| 105 | + on_input_ctx("invoice_region") do |
| 106 | + open_slimselect_options |
| 107 | + slimselect_search_input.set("Cuy") |
| 108 | + end |
107 | 109 | end
|
108 |
| - end |
109 | 110 |
|
110 |
| - it "shows results based on entered text", js: true do |
111 |
| - expect_slimselect_result_text_to_eq(1, "Antofagasta") |
| 111 | + it "does not show results", js: true do |
| 112 | + expect_slimselect_no_result |
| 113 | + end |
112 | 114 | end
|
113 | 115 |
|
114 |
| - context "after click option" do |
| 116 | + context 'when searching for region that belongs to selected country' do |
115 | 117 | before do
|
116 |
| - on_input_ctx("invoice_region") { click_slimselect_option("Antofagasta") } |
| 118 | + on_input_ctx("invoice_region") do |
| 119 | + open_slimselect_options |
| 120 | + slimselect_search_input.set("Antof") |
| 121 | + end |
117 | 122 | end
|
118 | 123 |
|
119 |
| - it "sets value", js: true do |
120 |
| - on_input_ctx("invoice_region") { expect_slimselect_selection("Antofagasta") } |
| 124 | + it "shows results based on entered text", js: true do |
| 125 | + expect_slimselect_result_text_to_eq(1, "Antofagasta") |
121 | 126 | end
|
122 | 127 |
|
123 |
| - it "preserves parent value", js: true do |
124 |
| - on_input_ctx("invoice_country") { expect_slimselect_selection("Chile") } |
125 |
| - end |
| 128 | + context "when clicking option" do |
| 129 | + before do |
| 130 | + on_input_ctx("invoice_region") { click_slimselect_option("Antofagasta") } |
| 131 | + end |
126 | 132 |
|
127 |
| - it "resets children values", js: true do |
128 |
| - on_input_ctx("invoice_city") { expect_slimselect_empty_selection } |
| 133 | + it "sets value", js: true do |
| 134 | + on_input_ctx("invoice_region") { expect_slimselect_selection("Antofagasta") } |
| 135 | + end |
| 136 | + |
| 137 | + it "preserves parent value", js: true do |
| 138 | + on_input_ctx("invoice_country") { expect_slimselect_selection("Chile") } |
| 139 | + end |
| 140 | + |
| 141 | + it "resets children values", js: true do |
| 142 | + on_input_ctx("invoice_city") { expect_slimselect_empty_selection } |
| 143 | + end |
129 | 144 | end
|
130 | 145 | end
|
131 | 146 | end
|
|
0 commit comments