Skip to content

Commit

Permalink
Unwanted text in product settings RadioGroup option (#3030)
Browse files Browse the repository at this point in the history
Fix Product > Integration > Settings: Unwanted text in product settings RadioGroup deployment option
  • Loading branch information
lvillen authored and akostadinov committed Aug 8, 2022
1 parent 1c41716 commit ddf288c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 20 deletions.
12 changes: 1 addition & 11 deletions app/javascript/src/Settings/styles/authentication.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
.hidden {
display: none !important;
}

#service_deployment_option_input {
label span,
.inline-hints {
display: none;
}
}
.deployment_option_hosted label::after {
content: ' 3scale managed';
}
}
6 changes: 2 additions & 4 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -567,14 +567,12 @@ en:

self_managed: APIcast self-managed
self_managed_hint: Manage your own NGINX based API gateway for ultimate flexibility and customization.
hosted: APIcast
hosted: APIcast 3scale managed
hosted_hint: a 3scale managed NGINX based API gateway for quick and reliable integrations
apicast: APIcast
apicast_hint: Nginx reverse proxy server.

service_mesh_istio: |
Istio
<span>A uniform way to secure, connect, and monitor microservices.</span>
service_mesh_istio: Istio

on_amazon: Amazon
plugin_ruby: |
Expand Down
36 changes: 31 additions & 5 deletions test/integration/api/services_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,31 +63,57 @@ class SettingsTest < self
end
end

test 'shows the correct deployment option' do
test 'shows and update the correct deployment option' do
# Default value
service.stubs(:deployment_option).returns(nil)
get settings_admin_service_path(service)

page = Nokogiri::HTML::Document.parse(response.body)
hosted_option = page.at_css('#service_deployment_option_hosted')
assert hosted_option.attribute('checked').present?
service.unstub(:deployment_option)

# Self managed
service.update!(deployment_option: 'self_managed')
put admin_service_path(service), params: update_params.deep_merge(service: { deployment_option: 'self_managed' })

assert_equal 'Product information updated.', flash[:notice]

get settings_admin_service_path(service)

page = Nokogiri::HTML::Document.parse(response.body)
self_managed_option = page.at_css('#service_deployment_option_self_managed')
assert self_managed_option.attribute('checked').present?

# Hosted
service.update!(deployment_option: 'hosted')
put admin_service_path(service), params: update_params.deep_merge(service: { deployment_option: 'hosted' })

assert_equal 'Product information updated.', flash[:notice]

get settings_admin_service_path(service)

page = Nokogiri::HTML::Document.parse(response.body)
hosted_option = page.at_css('#service_deployment_option_hosted')
assert hosted_option.attribute('checked').present?

# Istio
put admin_service_path(service), params: update_params.deep_merge(service: { deployment_option: 'service_mesh_istio' })

assert_equal 'Product information updated.', flash[:notice]

get settings_admin_service_path(service)

page = Nokogiri::HTML::Document.parse(response.body)
istio_option = page.at_css('#service_deployment_option_service_mesh_istio')
assert istio_option.attribute('checked').present?
end

test 'receives proper names and values from deployment options' do
get settings_admin_service_path(service)

page = Nokogiri::HTML::Document.parse(response.body)

deployment_options = page.css('[name="service[deployment_option]"]').map{|i| [i.parent.text, i[:value]]}
expected_deployment_options = [['APIcast 3scale managed', 'hosted'], ['APIcast self-managed', 'self_managed'], ['Istio', 'service_mesh_istio']]

assert_equal expected_deployment_options, deployment_options
end

test 'shows and update authentication options' do
Expand Down

0 comments on commit ddf288c

Please sign in to comment.