Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
johrstrom committed Oct 18, 2024
1 parent 375b14d commit 20d4935
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions apps/dashboard/test/system/batch_connect_widgets_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,33 @@ def make_bc_app(dir, form)
refute(find("##{bc_ele_id('eastern_city')}", visible: false).visible?)
end
end

test 'weird ids like aa_b_cc work' do
Dir.mktmpdir do |dir|
form = <<~HEREDOC
form:
- aa
- aa_b_cc
attributes:
aa:
widget: select
options:
- [ "foo", "foo", data-hide-aa-b-cc: true]
- ['bar', 'bar']
aa_b_cc:
widget: text_field
HEREDOC

make_bc_app(dir, form)
visit new_batch_connect_session_context_url('sys/app')

# foo is default, so aa_b_cc should be hidden
assert('foo', find("##{bc_ele_id('aa')}").value)
refute(find("##{bc_ele_id('aa_b_cc')}", visible: false).visible?)

# select bar, and now aa_b_cc is available.
select('bar', from: bc_ele_id('aa'))
assert(find("##{bc_ele_id('aa_b_cc')}").visible?)
end
end
end

0 comments on commit 20d4935

Please sign in to comment.