Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

downcase auto modules so they are dynamic as well #3905

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def filter_versions?
# normalize module names so they can be accessed through methods.
# see https://github.com/OSC/ondemand/issues/2933
def normalize_module(module_name)
module_name.to_s.gsub('-', '_')
module_name.to_s.gsub('-', '_').downcase
end

private
Expand Down
34 changes: 34 additions & 0 deletions apps/dashboard/test/system/batch_connect_widgets_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -282,4 +282,38 @@ def make_bc_app(dir, form)
assert_equal('Four', find("[for='#{bc_ele_id('vector_four')}']").text)
end
end

test 'auto modules something' do
Dir.mktmpdir do |dir|
with_modified_env({ OOD_MODULE_FILE_DIR: 'test/fixtures/modules' }) do
form = <<~HEREDOC
cluster: owens
form:
- auto_modules_R
- module_hider
attributes:
module_hider:
widget: select
options:
- ['show', 'show']
- ['hide', 'hide', data-hide-auto-modules-r: true]
HEREDOC

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

# just to be sure auto_modules_r actually populates with module options
assert_equal(20, find_all_options('auto_modules_r', nil).size)
assert(find("##{bc_ele_id('auto_modules_r')}").visible?)

# select hide and auto_modules_r isn't visible anymore.
select('hide', from: bc_ele_id('module_hider'))
refute(find("##{bc_ele_id('auto_modules_r')}", visible: :hidden).visible?)

# select show and it's back.
select('show', from: bc_ele_id('module_hider'))
assert(find("##{bc_ele_id('auto_modules_r')}").visible?)
end
end
end
end
Loading