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 2 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
4 changes: 1 addition & 3 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -572,9 +572,7 @@ en:
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
20 changes: 20 additions & 0 deletions test/integration/api/services_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,25 @@ class SettingsTest < self
page = Nokogiri::HTML::Document.parse(response.body)
hosted_option = page.at_css('#service_deployment_option_hosted')
assert hosted_option.attribute('checked').present?

# Istio
service.update!(deployment_option: 'service_mesh_istio')
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)

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

assert_equal page_deployment_options_collection, deployment_options_collection
lvillen marked this conversation as resolved.
Show resolved Hide resolved
end

test 'update the settings' do
Expand Down Expand Up @@ -199,6 +218,7 @@ class SettingsTest < self
def update_params(oidc_id: nil)
@update_params ||= { service:
{ intentions_required: '0',
deployment_option: 'service_mesh_istio',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this line I wanted to test that we can actually change the Deployment option, also that the Istio option was available and that everything was working as expected.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is incorrect to set it globally like that. I see tests that expect it to be apicast. I don't know how they pass. But either case, in your test case, you can do:

      put admin_service_path(service), params: update_params(deployment_option: 'service_mesh_istio')

Then check value is what you expect. For example you can do this on line 93 instead of setting it directly.

buyers_manage_apps: '0',
referrer_filters_required: '1',
custom_keys_enabled: '1',
Expand Down