diff --git a/app/views/admin/enterprises/form/_permalink.html.haml b/app/views/admin/enterprises/form/_permalink.html.haml index 5c2a43a7b03..87c138286a5 100644 --- a/app/views/admin/enterprises/form/_permalink.html.haml +++ b/app/views/admin/enterprises/form/_permalink.html.haml @@ -15,8 +15,6 @@ %span.unavailable.hidden{data: { "permalink-target": "unavailable" }} = t('js.unavailable') %i.icon-remove-sign - - - unless @enterprise.sells == 'none' .row .three.columns.alpha %label= t('.link_to_front') diff --git a/app/views/admin/enterprises/form/_primary_details.html.haml b/app/views/admin/enterprises/form/_primary_details.html.haml index 830cd108b4d..27965fb421f 100644 --- a/app/views/admin/enterprises/form/_primary_details.html.haml +++ b/app/views/admin/enterprises/form/_primary_details.html.haml @@ -32,4 +32,4 @@ = f.radio_button :visible, "hidden", 'ng-model' => 'Enterprise.visible' = f.label :visible, t('.hidden'), value: 'hidden' -= render partial: 'admin/enterprises/form/permalink' \ No newline at end of file += render partial: 'admin/enterprises/form/permalink' diff --git a/spec/system/admin/enterprises_spec.rb b/spec/system/admin/enterprises_spec.rb index 2cd8b23e883..995b15ae0c1 100644 --- a/spec/system/admin/enterprises_spec.rb +++ b/spec/system/admin/enterprises_spec.rb @@ -87,12 +87,12 @@ fill_in 'enterprise_name', with: 'Eaterprises' - accept_alert do - click_link "Admin Only" - end + accept_alert { click_link "Admin Only" } + choose 'Own' + + accept_alert { click_link "Primary Details" } fill_in 'enterprise_permalink', with: 'eaterprises-permalink' expect(page).to have_selector '.available' - choose 'Own' # Require login to view shopfront or for checkout accept_alert do @@ -119,34 +119,36 @@ fill_in_trix_editor 'enterprise_long_description', with: 'This is an interesting long description' - # Check StimulusJs switching of sidebar elements - accept_alert do - click_link "Primary Details" - end - # Unchecking hides the Properties tab + accept_alert { click_link "Primary Details" } uncheck 'enterprise_is_primary_producer' + accept_alert { click_link "Admin Only" } choose 'None' expect(page).not_to have_selector "[data-test=link_for_enterprise_fees]" expect(page).not_to have_selector "[data-test=link_for_payment_methods]" expect(page).not_to have_selector "[data-test=link_for_shipping_methods]" expect(page).not_to have_selector "[data-test=link_for_properties]" # Checking displays the Properties tab + accept_alert { click_link "Primary Details" } check 'enterprise_is_primary_producer' expect(page).to have_selector "[data-test=link_for_enterprise_fees]" expect(page).not_to have_selector "[data-test=link_for_payment_methods]" expect(page).not_to have_selector "[data-test=link_for_shipping_methods]" expect(page).to have_selector "[data-test=link_for_properties]" + accept_alert { click_link "Primary Details" } uncheck 'enterprise_is_primary_producer' + accept_alert { click_link "Admin Only" } choose 'Own' expect(page).to have_selector "[data-test=link_for_enterprise_fees]" expect(page).to have_selector "[data-test=link_for_payment_methods]" expect(page).to have_selector "[data-test=link_for_shipping_methods]" + accept_alert { click_link "Admin Only" } choose 'Any' expect(page).to have_selector "[data-test=link_for_enterprise_fees]" expect(page).to have_selector "[data-test=link_for_payment_methods]" expect(page).to have_selector "[data-test=link_for_shipping_methods]" + accept_alert { click_link "Primary Details" } page.find("#enterprise_group_ids-ts-control").set(eg1.name) page.find("#enterprise_group_ids-ts-dropdown .option.active").click