diff --git a/app/views/admin/questions/_success_text.html.erb b/app/views/admin/questions/_success_text.html.erb index 73c1d47f8..c06bdc4f9 100644 --- a/app/views/admin/questions/_success_text.html.erb +++ b/app/views/admin/questions/_success_text.html.erb @@ -39,11 +39,11 @@ }); }); - $("#form_success_text_heading").on("keyup", function(event, b) { - $(".fba-alert.usa-alert--success h3.usa-alert__heading").text(event.target.value) + $("#form_success_text_heading").on("keyup", function(event) { + $(".fba-alert.usa-alert--success h2.usa-alert__heading").text(event.target.value) }); - $("#form_success_text").on("keyup", function(event, b) { + $("#form_success_text").on("keyup", function(event) { $(".fba-alert.usa-alert--success .usa-alert__text").html(event.target.value) }); }) diff --git a/spec/features/admin/forms_spec.rb b/spec/features/admin/forms_spec.rb index 7dafaaa7e..604c90485 100644 --- a/spec/features/admin/forms_spec.rb +++ b/spec/features/admin/forms_spec.rb @@ -474,14 +474,16 @@ end it 'has inline editable success text heading that can be updated and saved' do - find_field(id: 'form_success_text_heading').set('"Sucesssss Header!"') - find_field(id: 'form_success_text_heading').native.send_key :tab + fill_in('form_success_text_heading', with: 'Successful Header!', fill_options: { clear: :backspace }) + find('#form_success_text_heading').native.send_key :tab + expect(find(".fba-alert.usa-alert.usa-alert--success .usa-alert__heading")).to have_content('Successful Header!') wait_for_ajax - expect(find_field(id: 'form_success_text_heading').value).to have_content('Sucesssss Header!') + expect(find_field(id: 'form_success_text_heading').value).to have_content('Successful Header!') + expect(find(".fba-alert.usa-alert.usa-alert--success .usa-alert__heading")).to have_content('Successful Header!') # and persists after refresh visit questions_admin_form_path(form) - expect(find_field(id: 'form_success_text_heading').value).to have_content('Sucesssss Header!') + expect(find_field(id: 'form_success_text_heading').value).to have_content('Successful Header!') end it 'has inline editable success text textbox that can be updated and saved' do