Skip to content

Commit

Permalink
add link text for the remove committee member button that is only see…
Browse files Browse the repository at this point in the history
…n by screen readers (sr-only)
  • Loading branch information
amtuannguyen committed Oct 20, 2024
1 parent 707b598 commit 428eef3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/views/committee_members/_committee_member.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<%= hidden_field_tag "committee_member_ids[]", committee_member.id %>
<% if @thesis.id && can?(:destroy, committee_member) && @thesis.status != Thesis::PUBLISHED %>
<%= link_to student_thesis_committee_member_path(@student, @thesis, committee_member),
method: :delete, class: "btn btn-close", remote: true, "data-delete": "#{committee_member.name} (#{committee_member.role})" do %>&nbsp;<% end %>
method: :delete, class: "btn btn-close", remote: true, "title": "Remove #{committee_member.name} (#{committee_member.role})", "data-delete": "#{committee_member.name} (#{committee_member.role})" do %>
<span class="sr-only">Remove <%= "#{committee_member.name} (#{committee_member.role})" %></span>
<% end %>
<% end %>
</div>
2 changes: 1 addition & 1 deletion test/system/theses_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class ThesesTest < ApplicationSystemTestCase

assert_selector 'a[data-delete="test2, test1 (Committee Member)"]', visible: true

find('a[data-delete="test2, test1 (Committee Member)"]').click(x: 12, y: 12)
click_link('Remove test2, test1 (Committee Member)')

assert_no_selector 'span', text: 'test2, test1'
end
Expand Down

0 comments on commit 428eef3

Please sign in to comment.