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

Unwanted text in product settings RadioGroup option #3030

Merged
merged 6 commits into from
Aug 5, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
lvillen marked this conversation as resolved.
Show resolved Hide resolved

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 'update the settings' do
Expand Down