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

options with hyphens still dont work right #1676

Merged
1 commit merged into from
Dec 21, 2021
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
2 changes: 1 addition & 1 deletion apps/dashboard/app/javascript/packs/batchConnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const setValueLookup = {};
const hideLookup = {};

// the regular expression for mountain casing
const mcRex = /[[-_]([a-z])|([_-][0-9])/g;
const mcRex = /[-_]([a-z])|([_-][0-9])/g;

function bcElement(name) {
return `${bcPrefix}_${name.toLowerCase()}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,19 @@ attributes:
- [
"2.7",
data-option-for-node-type-advanced: false,
data-option-for-node-type-other-40ish-option: false,
data-set-bc-account: 'python27'
]
- [
"3.1",
data-option-for-node-type-advanced: false,
data-option-for-node-type-other-40ish-option: false,
data-set-bc-account: 'python31'
]
- [
"3.2",
data-option-for-node-type-advanced: false,
data-option-for-node-type-other-40ish-option: false,
data-set-bc-account: 'python32'
]
- [
Expand Down
19 changes: 18 additions & 1 deletion apps/dashboard/test/system/batch_connect_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def setup
assert find("##{bc_ele_id('advanced_options')}").visible?
end

test 'options with hyphens' do
test 'options with hyphens set min & max' do
visit new_batch_connect_session_context_url('sys/bc_jupyter')

# defaults
Expand All @@ -318,6 +318,23 @@ def setup
assert_equal 48, find_max('bc_num_slots')
end

test 'options with hyphens get hidden' do
visit new_batch_connect_session_context_url('sys/bc_jupyter')

# defaults
assert_equal 'owens', find_value('cluster')
assert_equal 'any', find_value('node_type')
assert_equal '2.7', find_value('python_version')

# now switch node type and find that 2.7, and more, are hidden and 3.6 is the choice now
# even when the options has hyphens in it
select('other-40ish-option', from: bc_ele_id('node_type'))
assert_equal 'display: none;', find_option_style('python_version', '2.7')
assert_equal 'display: none;', find_option_style('python_version', '3.1')
assert_equal 'display: none;', find_option_style('python_version', '3.2')
assert_equal '3.6', find("##{bc_ele_id('python_version')}").value
end

test 'options with numbers' do
visit new_batch_connect_session_context_url('sys/bc_jupyter')

Expand Down