Skip to content

Commit

Permalink
Merge pull request #2102 from samvera/hyrax-5-upgrade-restore-ci-spec
Browse files Browse the repository at this point in the history
🧹 Fix button class for Bootstrap 3 to 4
  • Loading branch information
jeremyf authored Dec 21, 2023
2 parents 956249c + 7184607 commit b7bc2f2
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions spec/features/admin_set_form_participants_tab_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'rails_helper'

RSpec.describe 'AdminSet form Participants tab', type: :feature, js: true, clean: true, ci: 'skip' do
RSpec.describe 'AdminSet form Participants tab', type: :feature, js: true, clean: true do
include Warden::Test::Helpers

context 'as an admin user' do
Expand Down Expand Up @@ -63,7 +63,7 @@
text: group.humanized_name
).click
find('select#permission_template_access_grants_attributes_0_access option', text: 'Manager').click
find('input.btn-info').click
find('input.btn-secondary').click
end

expect(find('table.managers-table')).to have_content(group.name.titleize)
Expand All @@ -86,7 +86,7 @@
text: group.humanized_name
).click
find('select#permission_template_access_grants_attributes_0_access option', text: 'Depositor').click
find('input.btn-info').click
find('input.btn-secondary').click
end

expect(find('table.managers-table')).not_to have_content(group.name.titleize)
Expand All @@ -109,7 +109,7 @@
text: group.humanized_name
).click
find('select#permission_template_access_grants_attributes_0_access option', text: 'Viewer').click
find('input.btn-info').click
find('input.btn-secondary').click
end

expect(find('table.managers-table')).not_to have_content(group.name.titleize)
Expand All @@ -136,10 +136,9 @@
.find(:xpath, '//td[@data-agent="admin"]')
.find(:xpath, '..')['innerHTML']
expect(manager_row_html).to include('<td data-agent="admin">Repository Administrators</td>')
expect(manager_row_html).to include(
'<input class="btn btn-danger" disabled="disabled" ' \
'title="The repository administrators group cannot be removed" type="submit" value="Remove">'
)
# rubocop:disable Metrics/LineLength
expect(manager_row_html).to include('<input class="btn btn-sm btn-danger disabled" disabled="disabled" title="The repository administrators group cannot be removed" type="submit" value="Remove">')
# rubocop:enable Metrics/LineLength
end

it 'shows an enabled remove button next to Repository Administrator group as a Depositor' do
Expand All @@ -149,14 +148,14 @@
text: "Repository Administrators"
).click
find('select#permission_template_access_grants_attributes_0_access option', text: 'Depositor').click
find('input.btn-info').click
find('input.btn-secondary').click
end

depositor_row_html = find('table.depositors-table')
.find(:xpath, './/td[@data-agent="admin"]')
.find(:xpath, '..')['innerHTML']
expect(depositor_row_html).to include('<td data-agent="admin">Repository Administrators</td>')
expect(depositor_row_html).to include('<input class="btn btn-danger" type="submit" value="Remove">')
expect(depositor_row_html).to include('<input class="btn btn-sm btn-danger" type="submit" value="Remove">')
end

it 'shows an enabled remove button next to Repository Administrator group as a Viewer' do
Expand All @@ -166,14 +165,14 @@
text: "Repository Administrators"
).click
find('select#permission_template_access_grants_attributes_0_access option', text: 'Viewer').click
find('input.btn-info').click
find('input.btn-secondary').click
end

viewer_row_html = find('table.viewers-table')
.find(:xpath, './/td[@data-agent="admin"]')
.find(:xpath, '..')['innerHTML']
expect(viewer_row_html).to include('<td data-agent="admin">Repository Administrators</td>')
expect(viewer_row_html).to include('<input class="btn btn-danger" type="submit" value="Remove">')
expect(viewer_row_html).to include('<input class="btn btn-sm btn-danger" type="submit" value="Remove">')
end
end
end
Expand Down

0 comments on commit b7bc2f2

Please sign in to comment.