Skip to content

Commit

Permalink
Fix cancel button for feedback forms
Browse files Browse the repository at this point in the history
Closes #4570
  • Loading branch information
maxkadel authored and christinach committed Dec 12, 2024
1 parent 313c8b4 commit 3b8db22
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/views/catalog/_ask_a_question_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<%= f.input :title, as: :hidden %>
<%= f.input :feedback_desc, as: :hidden %>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
<%= f.submit "Send", class: "btn btn-primary", data: {bs_dismiss: "modal"}, id: 'submit-question' %>
<button type="button" class="btn btn-secondary" data-bl-dismiss="modal">Cancel</button>
<%= f.submit "Send", class: "btn btn-primary", data: {bl_dismiss: "modal"}, id: 'submit-question' %>
</div>
<% end %>
</div>
2 changes: 1 addition & 1 deletion app/views/catalog/_report_biased_results_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</div>

<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-secondary" data-bl-dismiss="modal">Cancel</button>
<%= f.submit "Send", class: "btn btn-primary", id: 'submit-question' %>
</div>
<% end %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/catalog/_report_harmful_language_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
<%= f.input_field :context, hidden: true %><br>
<%= f.input :feedback_desc, as: :hidden %>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
<%= f.submit "Send", class: "btn btn-primary", data: {bs_dismiss: "modal"}, id: 'submit-question' %>
<button type="button" class="btn btn-secondary" data-bl-dismiss="modal">Cancel</button>
<%= f.submit "Send", class: "btn btn-primary", data: {bl_dismiss: "modal"}, id: 'submit-question' %>
</div>
<% end %>
</div>
4 changes: 2 additions & 2 deletions app/views/catalog/_suggest_correction_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<%= f.input :title, as: :hidden %>
<%= f.input :feedback_desc, as: :hidden %>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
<%= f.submit "Send", class: "btn btn-primary", data: {bs_dismiss: "modal"}, id: 'submit-suggestion' %>
<button type="button" class="btn btn-secondary" data-bl-dismiss="modal">Cancel</button>
<%= f.submit "Send", class: "btn btn-primary", data: {bl_dismiss: "modal"}, id: 'submit-suggestion' %>
</div>
<% end %>
</div>
13 changes: 13 additions & 0 deletions spec/system/suggest_correction_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,17 @@
expect(page).to have_text 'Your suggestion has been submitted'
end
end
describe 'pressing the cancel button' do
before do
stub_holding_locations
visit '/catalog/99105509673506421'
scroll_to(:bottom) # needed when js: true
click_link 'Suggest a Correction'
end
it 'closes the modal', js: true do
expect(page).to have_text('Please use this area to report errors or omissions')
click_button 'Cancel'
expect(page).not_to have_text('Please use this area to report errors or omissions')
end
end
end

0 comments on commit 3b8db22

Please sign in to comment.